diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-07-04 07:15:53 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-07-04 07:15:53 +0000 |
commit | 87fbb7092b8f8b2f0db0f361c3d625e19de57cd9 (patch) | |
tree | 3c302f710cbaa03e3c0d46549e8982771b12b8a5 /source3/include | |
parent | 9e9e73303ec10a64bd744b9b33f4e6cd7d394f03 (diff) | |
download | samba-87fbb7092b8f8b2f0db0f361c3d625e19de57cd9.tar.gz samba-87fbb7092b8f8b2f0db0f361c3d625e19de57cd9.tar.bz2 samba-87fbb7092b8f8b2f0db0f361c3d625e19de57cd9.zip |
The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
(This used to be commit debb471267960e56005a741817ebd227ecfc512a)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/config.h.in | 3 | ||||
-rw-r--r-- | source3/include/includes.h | 8 | ||||
-rw-r--r-- | source3/include/kanji.h | 741 | ||||
-rw-r--r-- | source3/include/safe_string.h | 7 | ||||
-rw-r--r-- | source3/include/smb.h | 34 | ||||
-rw-r--r-- | source3/include/smb_macros.h | 24 | ||||
-rw-r--r-- | source3/include/vfs.h | 38 |
7 files changed, 73 insertions, 782 deletions
diff --git a/source3/include/config.h.in b/source3/include/config.h.in index a983f49890..fa6c34dc44 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -1,4 +1,4 @@ -/* include/config.h.in. Generated automatically from configure.in by autoheader. */ +/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */ /* Define if on AIX 3. System headers sometimes define this. @@ -216,6 +216,7 @@ #undef HAVE_VASPRINTF_DECL #undef HAVE_SNPRINTF_DECL #undef HAVE_VSNPRINTF_DECL +#undef HAVE_NATIVE_ICONV /* The number of bytes in a int. */ #undef SIZEOF_INT diff --git a/source3/include/includes.h b/source3/include/includes.h index c5f4720a5a..9ed7401df3 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -361,6 +361,10 @@ #include <sys/shm.h> #endif /* HAVE_SYS_SHM_H */ +#ifdef HAVE_NATIVE_ICONV +#include <iconv.h> +#endif + /* * Define VOLATILE if needed. */ @@ -656,9 +660,6 @@ extern int errno; #include "byteorder.h" -#include "kanji.h" -#include "charset.h" - #include "ntdomain.h" #include "msdfs.h" @@ -1016,6 +1017,7 @@ extern int DEBUGLEVEL; #define F_SETLKW 14 #endif + /* Needed for sys_dlopen/sys_dlsym/sys_dlclose */ #ifndef RTLD_GLOBAL #define RTLD_GLOBAL 0 diff --git a/source3/include/kanji.h b/source3/include/kanji.h deleted file mode 100644 index 58774a699d..0000000000 --- a/source3/include/kanji.h +++ /dev/null @@ -1,741 +0,0 @@ -/* - Unix SMB/Netbios implementation. - Version 1.9. - Kanji Extensions - Copyright (C) Andrew Tridgell 1992-1998 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - Adding for Japanese language by <fujita@ainix.isac.co.jp> 1994.9.5 - and extend coding system to EUC/SJIS/JIS/HEX at 1994.10.11 - and add all jis codes sequence at 1995.8.16 - Notes: Hexadecimal code by <ohki@gssm.otuka.tsukuba.ac.jp> - and add upper/lower case conversion 1997.8.21 -*/ -#ifndef _KANJI_H_ -#define _KANJI_H_ - -/* FOR SHIFT JIS CODE */ -#define is_shift_jis(c) \ - ((0x81 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0x9f) \ - || (0xe0 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xfc)) -#define is_shift_jis2(c) \ - (0x40 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xfc \ - && ((unsigned char) (c)) != 0x7f) -#define is_kana(c) ((0xa0 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xdf)) - -/* case conversion */ -#define is_sj_upper2(c) \ - ((0x60 <= (unsigned char) (c)) && ((unsigned char) (c) <= 0x79)) -#define is_sj_lower2(c) \ - ((0x81 <= (unsigned char) (c)) && ((unsigned char) (c) <= 0x9A)) -#define sjis_alph 0x82 -#define is_sj_alph(c) (sjis_alph == (unsigned char) (c)) -#define is_sj_upper(c1, c2) (is_sj_alph (c1) && is_sj_upper2 (c2)) -#define is_sj_lower(c1, c2) (is_sj_alph (c1) && is_sj_lower2 (c2)) -#define sj_toupper2(c) \ - (is_sj_lower2 (c) ? ((int) ((unsigned char) (c) - 0x81 + 0x60)) : \ - ((int) (unsigned char) (c))) -#define sj_tolower2(c) \ - (is_sj_upper2 (c) ? ((int) ((unsigned char) (c) - 0x60 + 0x81)) : \ - ((int) (unsigned char) (c))) - -#define is_sj_ru_upper2(c) \ - ((0x40 <= (unsigned char) (c)) && ((unsigned char) (c) <= 0x60)) -#define is_sj_ru_lower2(c) \ - (((0x70 <= (unsigned char) (c)) && ((unsigned char) (c) <= 0x7e)) || \ - ((0x80 <= (unsigned char) (c)) && ((unsigned char) (c) <= 0x91))) -#define sjis_russian 0x84 -#define is_sj_russian(c) (sjis_russian == (unsigned char) (c)) -#define is_sj_ru_upper(c1, c2) (is_sj_russian (c1) && is_sj_ru_upper2 (c2)) -#define is_sj_ru_lower(c1, c2) (is_sj_russian (c1) && is_sj_ru_lower2 (c2)) -#define sj_ru_toupper2(c) \ - (is_sj_ru_lower2 (c) ? ((int) ((unsigned char) (c) + \ - (((unsigned char)(c) >= 0x4f) ? (0x70 - 0x40) : (0x80 - 0x4f)))) : \ - ((int) (unsigned char) (c))) -#define sj_ru_tolower2(c) \ - (is_sj_ru_upper2 (c) ? ((int) ((unsigned char) (c) - \ - (((unsigned char)(c) >= 0x80) ? (0x70 - 0x40) : (0x80 - 0x4f)))) : \ - ((int) (unsigned char) (c))) - -#ifdef _KANJI_C_ -/* FOR EUC CODE */ -#define euc_kana (0x8e) -#define is_euc_kana(c) (((unsigned char) (c)) == euc_kana) -#define is_euc(c) (0xa0 < ((unsigned char) (c)) && ((unsigned char) (c)) < 0xff) - -#define euc_sup (0x8f) -#define is_euc_sup(c) (((unsigned char ) (c)) == euc_sup) - -/* FOR JIS CODE */ -/* default jis third shift code, use for output */ -#ifndef JIS_KSO -#define JIS_KSO 'B' -#endif -#ifndef JIS_KSI -#define JIS_KSI 'J' -#endif -/* in: \E$B or \E$@ */ -/* out: \E(J or \E(B or \E(H */ -#define jis_esc (0x1b) -#define jis_so (0x0e) -#define jis_so1 ('$') -#define jis_so2 ('B') -#define jis_si (0x0f) -#define jis_si1 ('(') -#define jis_si2 ('J') -#define is_esc(c) (((unsigned char) (c)) == jis_esc) -#define is_so1(c) (((unsigned char) (c)) == jis_so1) -#define is_so2(c) (((unsigned char) (c)) == jis_so2 || ((unsigned char) (c)) == '@') -#define is_si1(c) (((unsigned char) (c)) == jis_si1) -#define is_si2(c) (((unsigned char) (c)) == jis_si2 || ((unsigned char) (c)) == 'B' \ - || ((unsigned char) (c)) == 'H') -#define is_so(c) (((unsigned char) (c)) == jis_so) -#define is_si(c) (((unsigned char) (c)) == jis_si) -#define junet_kana1 ('(') -#define junet_kana2 ('I') -#define is_juk1(c) (((unsigned char) (c)) == junet_kana1) -#define is_juk2(c) (((unsigned char) (c)) == junet_kana2) - -#define _KJ_ROMAN (0) -#define _KJ_KANJI (1) -#define _KJ_KANA (2) - -/* FOR HEX */ -#define HEXTAG ':' -#define hex2bin(x) \ - ( ((int) '0' <= ((int) (x)) && ((int) (x)) <= (int)'9')? \ - (((int) (x))-(int)'0'): \ - ((int) 'a'<= ((int) (x)) && ((int) (x))<= (int) 'f')? \ - (((int) (x)) - (int)'a'+10): \ - (((int) (x)) - (int)'A'+10) ) -#define bin2hex(x) \ - ( (((int) (x)) >= 10)? (((int) (x))-10 + (int) 'a'): (((int) (x)) + (int) '0') ) - -/* For Hangul (Korean - code page 949). */ -#define is_hangul(c) ((0x81 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xfd)) - -/* For traditional Chinese (known as Big5 encoding - code page 950). */ -#define is_big5_c1(c) ((0xa1 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xf9)) - -/* For simplified Chinese (code page - 936). */ -#define is_simpch_c1(c) ((0xa1 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xf7)) - -#else /* not _KANJI_C_ */ - -/* - * The following is needed for AIX systems that have - * their own #defines for strchr, strrchr, strstr - * and strtok. - */ - -#ifdef strchr -#undef strchr -#endif /* strchr */ - -#ifdef strrchr -#undef strrchr -#endif /* strrchr */ - -#ifdef strstr -#undef strstr -#endif /* strstr */ - -#ifdef strtok -#undef strtok -#endif /* strtok */ - -/* Ensure we use our definitions in all other files than kanji.c. */ - -/* Function pointers we will replace. */ -extern char *(*multibyte_strchr)(const char *s, int c); -extern char *(*multibyte_strrchr)(const char *s, int c); -extern char *(*multibyte_strstr)(const char *s1, const char *s2); -extern char *(*multibyte_strtok)(char *s1, const char *s2); -extern char *(*_dos_to_unix)(char *str, BOOL overwrite); -extern char *(*_unix_to_dos)(char *str, BOOL overwrite); -extern char *(*_dos_to_dos)(char *str, BOOL overwrite); -extern BOOL (*is_multibyte_char)(char c); -extern int (*_skip_multibyte_char)(char c); - -#define strchr(s1, c) ((*multibyte_strchr)((s1), (c))) -#define strrchr(s1, c) ((*multibyte_strrchr)((s1), (c))) -#define strstr(s1, s2) ((*multibyte_strstr)((s1), (s2))) -#define strtok(s1, s2) ((*multibyte_strtok)((s1), (s2))) -#define dos_to_unix(x,y) ((*_dos_to_unix)((x), (y))) -#define unix_to_dos(x,y) ((*_unix_to_dos)((x), (y))) -#define dos_to_dos(x,y) ((*_dos_to_dos)((x), (y))) -#define skip_multibyte_char(c) ((*_skip_multibyte_char)((c))) - -#endif /* _KANJI_C_ */ - -#define UNKNOWN_CODE (-1) -#define SJIS_CODE (0) -#define EUC_CODE (1) -#define JIS7_CODE (2) -#define JIS8_CODE (3) -#define JUNET_CODE (4) -#define HEX_CODE (5) -#define CAP_CODE (6) -#define DOSV_CODE SJIS_CODE -#define EUC3_CODE (7) -#define UTF8_CODE (8) - -#ifdef _KANJI_C_ - -/* For conversion */ - -#define EXTSJISC(c) (0xf0 <= ((unsigned char)(c)) \ - && ((unsigned char)(c) <= 0xfc)) -#define GETAHI (0x81) -#define GETALO (0xac) - -typedef struct _sjis_regur_t { - int start; - int end; - int rstart; -} sjis_regur_t; - -/* When Converting to EUC and JIS, there is no room for - * these SJIS codes whose hi byte is larger than 0xf0. - * - * So we must drop or convert it to harmless code. - * This is not standard way, so it is ad hoc but practical. - * It is also thought of backward and future compatibility. - * - * Miura. - */ - -static sjis_regur_t sjisconv[] = { -{0xfa40, 0xfa49, 0xeeef}, -{0xfa4a, 0xfa53, 0x8754}, -{0xfa54, 0xfa54, 0x81ca}, -{0xfa55, 0xfa57, 0xeefa}, -{0xfa58, 0xfa58, 0x878a}, -{0xfa59, 0xfa59, 0x8782}, -{0xfa5a, 0xfa5a, 0x8784}, -{0xfa5b, 0xfa5b, 0x81e6}, -{0xfa5c, 0xfa7e, 0xed40}, -{0xfa80, 0xfa9b, 0xed63}, -{0xfa9c, 0xfafc, 0xed80}, -{0xfb40, 0xfb5b, 0xede1}, -{0xfb5c, 0xfb7e, 0xee40}, -{0xfb80, 0xfb9b, 0xee63}, -{0xfb9c, 0xfbfc, 0xee80}, -{0xfc40, 0xfc4b, 0xeee1} -}; -#define SJISCONVTBLSIZ (sizeof(sjisconv) / sizeof(sjis_regur_t)) - -static sjis_regur_t sjisrev[] = { -{0x81ca, 0x81ca, 0xfa54}, -{0x81e6, 0x81e6, 0xfa5b}, -{0x8754, 0x875d, 0xfa4a}, -{0x8782, 0x8782, 0xfa59}, -{0x8784, 0x8784, 0xfa5a}, -{0x878a, 0x878a, 0xfa58}, -{0xed40, 0xed62, 0xfa5c}, -{0xed63, 0xed7e, 0xfa80}, -{0xed80, 0xede0, 0xfa9c}, -{0xede1, 0xedfc, 0xfb40}, -{0xee40, 0xee62, 0xfb5c}, -{0xee63, 0xee7e, 0xfb80}, -{0xee80, 0xeee0, 0xfb9c}, -{0xeee1, 0xeeec, 0xfc40}, -{0xeeef, 0xeef8, 0xfa40}, -{0xeefa, 0xeefc, 0xfa55} -}; -#define SJISREVTBLSIZ (sizeof(sjisrev) / sizeof(sjis_regur_t)) - -/* EUC3BYTE DEFINITIONS */ - -typedef struct _sjis_euc_map_t { - int sjis; - int euc; -} sjis_euc_map_t; - -static sjis_euc_map_t euc3conv2[] = { -{0x8754 , 0xf3fd}, -{0x8755 , 0xf3fe}, -{0x8756 , 0xf4a1}, -{0x8757 , 0xf4a2}, -{0x8758 , 0xf4a3}, -{0x8759 , 0xf4a4}, -{0x875a , 0xf4a5}, -{0x875b , 0xf4a6}, -{0x875c , 0xf4a7}, -{0x875d , 0xf4a8}, -{0x8782 , 0xf4ac}, -{0x8784 , 0xf4ad}, -{0x878a , 0xf4ab} -}; -#define EUC3CONV2TBLSIZ (sizeof(euc3conv2) / sizeof(sjis_euc_map_t)) - - -/* IBM Kanji to EUC 3byte */ -static int euc3conv[] = { -/* 0xfa40 */ -0xf3f3, 0xf3f4, 0xf3f5, 0xf3f6, 0xf3f7, 0xf3f8, 0xf3f9, 0xf3fa, 0xf3fb, 0xf3fc, 0xf3fd, 0xf3fe, 0xf4a1, 0xf4a2, 0xf4a3, 0xf4a4, -/* 0xfa50 */ -0xf4a5, 0xf4a6, 0xf4a7, 0xf4a8, 0, 0xa2c3, 0xf4a9, 0xf4aa, 0xf4ab, 0xf4ac, 0xf4ad, 0, 0xd4e3, 0xdcdf, 0xe4e9, 0xe3f8, -/* 0xfa60 */ -0xd9a1, 0xb1bb, 0xf4ae, 0xc2ad, 0xc3fc, 0xe4d0, 0xc2b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_sjis_euc_revmap_t { - int euc; - int sjis; -} sjis_euc_revmap_t; - -static sjis_euc_revmap_t euc3rev[] = { -{0xa2c3, 0xfa55}, -{0xb0a9, 0xfa68}, -{0xb0c8, 0xfa69}, -{0xb0d2, 0xfa6b}, -{0xb0d4, 0xfa6c}, -{0xb0e3, 0xfa6d}, -{0xb0ee, 0xfa6e}, -{0xb1a3, 0xfa70}, -{0xb1a7, 0xfa6f}, -{0xb1a9, 0xfa72}, -{0xb1ac, 0xfa71}, -{0xb1bb, 0xfa61}, -{0xb1be, 0xfa73}, -{0xb1c8, 0xfa76}, -{0xb1d7, 0xfa77}, -{0xb1d8, 0xfa75}, -{0xb1df, 0xfa74}, -{0xb1e1, 0xfa7a}, -{0xb1e3, 0xfa78}, -{0xb1f4, 0xfa79}, -{0xb2a3, 0xfa7b}, -{0xb2bb, 0xfa7d}, -{0xb2e6, 0xfa7e}, -{0xb2ed, 0xfa80}, -{0xb2f5, 0xfa81}, -{0xb2fc, 0xfa82}, -{0xb3b5, 0xfa84}, -{0xb3d8, 0xfa85}, -{0xb3db, 0xfa86}, -{0xb3dd, 0xfb77}, -{0xb3e5, 0xfa87}, -{0xb3ee, 0xfa88}, -{0xb3fb, 0xfa89}, -{0xb4c0, 0xfa8c}, -{0xb4c7, 0xfa8d}, -{0xb4d0, 0xfa8e}, -{0xb4de, 0xfa8f}, -{0xb5aa, 0xfa91}, -{0xb5af, 0xfa93}, -{0xb5c4, 0xfa94}, -{0xb5e8, 0xfa95}, -{0xb7c2, 0xfa97}, -{0xb7e4, 0xfa98}, -{0xb7e7, 0xfa9a}, -{0xb7e8, 0xfa99}, -{0xb8ce, 0xfa9e}, -{0xb8e1, 0xfa9f}, -{0xb8f5, 0xfaa0}, -{0xb8f7, 0xfaa1}, -{0xb8f8, 0xfaa2}, -{0xb8fc, 0xfaa3}, -{0xb9af, 0xfaa4}, -{0xb9b7, 0xfaa5}, -{0xbabe, 0xfaa6}, -{0xbadb, 0xfaa7}, -{0xbae1, 0xfaa9}, -{0xbaeb, 0xfaab}, -{0xbbb3, 0xfaac}, -{0xbbb8, 0xfaad}, -{0xbbca, 0xfaaf}, -{0xbbd0, 0xfab2}, -{0xbbde, 0xfab3}, -{0xbbf4, 0xfab4}, -{0xbbf5, 0xfab5}, -{0xbbf9, 0xfab6}, -{0xbce4, 0xfab7}, -{0xbced, 0xfab8}, -{0xbcf4, 0xfa67}, -{0xbcfe, 0xfab9}, -{0xbdc2, 0xfabb}, -{0xbde7, 0xfabc}, -{0xbdf0, 0xfabe}, -{0xbeac, 0xfac0}, -{0xbeb0, 0xfabf}, -{0xbeb3, 0xfac2}, -{0xbebd, 0xfac3}, -{0xbec9, 0xfac5}, -{0xbecd, 0xfac4}, -{0xbee4, 0xfac6}, -{0xbfa8, 0xfac7}, -{0xbfc9, 0xfac8}, -{0xc0c4, 0xfac9}, -{0xc0e4, 0xfaca}, -{0xc0f4, 0xfacb}, -{0xc1a6, 0xfacc}, -{0xc1f5, 0xface}, -{0xc1f8, 0xfad1}, -{0xc1fc, 0xfacf}, -{0xc2a1, 0xfad3}, -{0xc2a5, 0xfad4}, -{0xc2ab, 0xfad2}, -{0xc2ad, 0xfa63}, -{0xc2b8, 0xfad6}, -{0xc2ba, 0xfad7}, -{0xc2bf, 0xfa66}, -{0xc2c4, 0xfad9}, -{0xc2d2, 0xfada}, -{0xc2d7, 0xfadb}, -{0xc2db, 0xfadc}, -{0xc2de, 0xfadd}, -{0xc2ed, 0xfade}, -{0xc2f0, 0xfadf}, -{0xc3a1, 0xfae1}, -{0xc3b5, 0xfae2}, -{0xc3b9, 0xfae4}, -{0xc3c9, 0xfae3}, -{0xc3d8, 0xfae6}, -{0xc3fc, 0xfa64}, -{0xc3fe, 0xfae7}, -{0xc4cc, 0xfae9}, -{0xc4d9, 0xfaeb}, -{0xc4ea, 0xfaec}, -{0xc4fd, 0xfaed}, -{0xc5a7, 0xfaef}, -{0xc5b5, 0xfaf0}, -{0xc5b6, 0xfaf1}, -{0xc5d5, 0xfaf3}, -{0xc6b8, 0xfaf4}, -{0xc6d7, 0xfaf5}, -{0xc6e0, 0xfaf6}, -{0xc6e3, 0xfaf8}, -{0xc6ea, 0xfaf7}, -{0xc7a1, 0xfaf9}, -{0xc7ab, 0xfafa}, -{0xc7c3, 0xfafc}, -{0xc7c7, 0xfafb}, -{0xc7cb, 0xfb40}, -{0xc7cf, 0xfb41}, -{0xc7d9, 0xfb42}, -{0xc7e6, 0xfb45}, -{0xc7eb, 0xfb48}, -{0xc7ee, 0xfb46}, -{0xc7f0, 0xfb49}, -{0xc7fc, 0xfb47}, -{0xc8b1, 0xfb4a}, -{0xc8e5, 0xfb4b}, -{0xc8f8, 0xfb4c}, -{0xc9a6, 0xfb4d}, -{0xc9ab, 0xfb4e}, -{0xc9ad, 0xfb4f}, -{0xc9ca, 0xfb51}, -{0xc9d3, 0xfb52}, -{0xc9e3, 0xfb54}, -{0xc9e9, 0xfb53}, -{0xc9f4, 0xfb56}, -{0xc9f5, 0xfb57}, -{0xc9fc, 0xfb55}, -{0xcab3, 0xfb59}, -{0xcabd, 0xfb5a}, -{0xcaef, 0xfb5b}, -{0xcaf1, 0xfb5c}, -{0xcbae, 0xfb5d}, -{0xcbca, 0xfb5f}, -{0xcbe6, 0xfb60}, -{0xcbea, 0xfb61}, -{0xcbee, 0xfb64}, -{0xcbf0, 0xfb62}, -{0xcbf4, 0xfb63}, -{0xcbf9, 0xfb66}, -{0xcca5, 0xfb65}, -{0xccab, 0xfb67}, -{0xccad, 0xfb69}, -{0xccae, 0xfb68}, -{0xccb2, 0xfb6a}, -{0xccc2, 0xfb6b}, -{0xccd0, 0xfb6c}, -{0xccd9, 0xfb6d}, -{0xcdaa, 0xfaa8}, -{0xcdbb, 0xfb6f}, -{0xceba, 0xfb73}, -{0xcebb, 0xfb71}, -{0xcec3, 0xfb74}, -{0xcef2, 0xfb76}, -{0xcfd5, 0xfb78}, -{0xcfe2, 0xfb79}, -{0xcfe9, 0xfb7a}, -{0xcfed, 0x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a3, 0xfa4e}, -{0xf4a4, 0xfa4f}, -{0xf4a5, 0xfa50}, -{0xf4a6, 0xfa51}, -{0xf4a7, 0xfa52}, -{0xf4a8, 0xfa53}, -{0xf4a9, 0xfa56}, -{0xf4aa, 0xfa57}, -{0xf4ab, 0xfa58}, -{0xf4ac, 0xfa59}, -{0xf4ad, 0xfa5a}, -{0xf4ae, 0xfa62}, -{0xf4af, 0xfa6a}, -{0xf4b0, 0xfa7c}, -{0xf4b1, 0xfa83}, -{0xf4b2, 0xfa8a}, -{0xf4b3, 0xfa8b}, -{0xf4b4, 0xfa90}, -{0xf4b5, 0xfa92}, -{0xf4b6, 0xfa96}, -{0xf4b7, 0xfa9b}, -{0xf4b8, 0xfa9c}, -{0xf4b9, 0xfa9d}, -{0xf4ba, 0xfaaa}, -{0xf4bb, 0xfaae}, -{0xf4bc, 0xfab0}, -{0xf4bd, 0xfab1}, -{0xf4be, 0xfaba}, -{0xf4bf, 0xfabd}, -{0xf4c0, 0xfac1}, -{0xf4c1, 0xfacd}, -{0xf4c2, 0xfad0}, -{0xf4c3, 0xfad5}, -{0xf4c4, 0xfad8}, -{0xf4c5, 0xfae0}, -{0xf4c6, 0xfae5}, -{0xf4c7, 0xfae8}, -{0xf4c8, 0xfaea}, -{0xf4c9, 0xfaee}, -{0xf4ca, 0xfaf2}, -{0xf4cb, 0xfb43}, -{0xf4cc, 0xfb44}, -{0xf4cd, 0xfb50}, -{0xf4ce, 0xfb58}, -{0xf4cf, 0xfb5e}, -{0xf4d0, 0xfb6e}, -{0xf4d1, 0xfb70}, -{0xf4d2, 0xfb72}, -{0xf4d3, 0xfb75}, -{0xf4d4, 0xfb7c}, -{0xf4d5, 0xfb7d}, -{0xf4d6, 0xfb7e}, -{0xf4d7, 0xfb80}, -{0xf4d8, 0xfb82}, -{0xf4d9, 0xfb85}, -{0xf4da, 0xfb86}, -{0xf4db, 0xfb89}, -{0xf4dc, 0xfb8d}, -{0xf4dd, 0xfb8e}, -{0xf4de, 0xfb92}, -{0xf4df, 0xfb94}, -{0xf4e0, 0xfb9d}, -{0xf4e1, 0xfb9e}, -{0xf4e2, 0xfb9f}, -{0xf4e3, 0xfba0}, -{0xf4e4, 0xfba1}, -{0xf4e5, 0xfba9}, -{0xf4e6, 0xfbac}, -{0xf4e7, 0xfbae}, -{0xf4e8, 0xfbb0}, -{0xf4e9, 0xfbb1}, -{0xf4ea, 0xfbb3}, -{0xf4eb, 0xfbb4}, -{0xf4ec, 0xfbb6}, -{0xf4ed, 0xfbb7}, -{0xf4ee, 0xfbb8}, -{0xf4ef, 0xfbd3}, -{0xf4f0, 0xfbda}, -{0xf4f1, 0xfbe8}, -{0xf4f2, 0xfbe9}, -{0xf4f3, 0xfbea}, -{0xf4f4, 0xfbee}, -{0xf4f5, 0xfbf0}, -{0xf4f6, 0xfbf2}, -{0xf4f7, 0xfbf6}, -{0xf4f8, 0xfbf7}, -{0xf4f9, 0xfbf9}, -{0xf4fa, 0xfbfa}, -{0xf4fb, 0xfbfc}, -{0xf4fc, 0xfc42}, -{0xf4fd, 0xfc49}, -{0xf4fe, 0xfc4b}, -}; - -#define EUC3REVTBLSIZ (sizeof(euc3rev) / sizeof(sjis_euc_revmap_t)) - -#endif /* _KANJI_C_ */ -#endif /* _KANJI_H_ */ diff --git a/source3/include/safe_string.h b/source3/include/safe_string.h index 2c3d2eda01..3e379c48df 100644 --- a/source3/include/safe_string.h +++ b/source3/include/safe_string.h @@ -47,4 +47,11 @@ #define wfstrcpy(d,s) safe_strcpy_w((d),(s),sizeof(wfstring)) #define wfstrcat(d,s) safe_strcat_w((d),(s),sizeof(wfstring)) +/* replace some standard C library string functions with multi-byte + versions */ +#define strchr(s, c) strchr_m(s, c) +#define strrchr(s, c) strrchr_m(s, c) +#define strlower(s) strlower_m(s) +#define strupper(s) strupper_m(s) + #endif diff --git a/source3/include/smb.h b/source3/include/smb.h index 1cceb88983..091ed2ac66 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -53,11 +53,10 @@ typedef int BOOL; /* string manipulation flags - see clistr.c and srvstr.c */ #define STR_TERMINATE 1 -#define STR_CONVERT 2 -#define STR_UPPER 4 -#define STR_ASCII 8 -#define STR_UNICODE 16 -#define STR_NOALIGN 32 +#define STR_UPPER 2 +#define STR_ASCII 4 +#define STR_UNICODE 8 +#define STR_NOALIGN 16 /* how long to wait for secondary SMB packets (milli-seconds) */ #define SMB_SECONDARY_WAIT (60*1000) @@ -289,6 +288,16 @@ typedef uint16 smb_ucs2_t; typedef smb_ucs2_t wpstring[PSTRING_LEN]; typedef smb_ucs2_t wfstring[FSTRING_LEN]; + +#ifdef WORDS_BIGENDIAN +#define UCS2_SHIFT 8 +#else +#define UCS2_SHIFT 0 +#endif + +/* turn a 7 bit character into a ucs2 character */ +#define UCS2_CHAR(c) ((c) << UCS2_SHIFT) + /* pipe string names */ #define PIPE_LANMAN "\\PIPE\\LANMAN" #define PIPE_SRVSVC "\\PIPE\\srvsvc" @@ -790,7 +799,6 @@ struct bitmap { #define FLAG_GLOBAL 0x08 /* local options that should be globally settable in SWAT */ #define FLAG_DEPRECATED 0x10 /* options that should no longer be used */ #define FLAG_HIDE 0x20 /* options that should be hidden in SWAT */ -#define FLAG_DOS_STRING 0x40 /* convert from UNIX to DOS codepage when reading this string. */ #ifndef LOCKING_VERSION #define LOCKING_VERSION 4 @@ -1676,4 +1684,18 @@ typedef struct { TALLOC_CTX *mem_ctx; } CLI_POLICY_HND; + +/* generic iconv conversion structure */ +typedef struct { + size_t (*direct)(char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft); + size_t (*pull)(char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft); + size_t (*push)(char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft); +#ifdef HAVE_NATIVE_ICONV + iconv_t cd; +#endif +} *smb_iconv_t; + #endif /* _SMB_H */ diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index cad6229f1a..b168d68862 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -217,45 +217,45 @@ copy an IP address from one buffer to another #define dos_format(fname) string_replace(fname,'/','\\') /******************************************************************* - vfs stat wrapper that calls dos_to_unix. + vfs stat wrapper that calls internal2unix. ********************************************************************/ -#define vfs_stat(conn, fname, st) ((conn)->vfs_ops.stat((conn), dos_to_unix((fname),False),(st))) +#define vfs_stat(conn, fname, st) ((conn)->vfs_ops.stat((conn), fname,(st))) /******************************************************************* - vfs fstat wrapper that calls dos_to_unix. + vfs fstat wrapper ********************************************************************/ #define vfs_fstat(fsp, fd, st) ((fsp)->conn->vfs_ops.fstat((fsp),(fd),(st))) /******************************************************************* - vfs rmdir wrapper that calls dos_to_unix. + vfs rmdir wrapper that calls internal2unix. ********************************************************************/ -#define vfs_rmdir(conn,fname) ((conn)->vfs_ops.rmdir((conn),dos_to_unix((fname),False))) +#define vfs_rmdir(conn,fname) ((conn)->vfs_ops.rmdir((conn),fname)) /******************************************************************* - vfs Unlink wrapper that calls dos_to_unix. + vfs Unlink wrapper that calls internal2unix. ********************************************************************/ -#define vfs_unlink(conn, fname) ((conn)->vfs_ops.unlink((conn),dos_to_unix((fname),False))) +#define vfs_unlink(conn, fname) ((conn)->vfs_ops.unlink((conn),fname)) /******************************************************************* - vfs chmod wrapper that calls dos_to_unix. + vfs chmod wrapper that calls internal2unix. ********************************************************************/ -#define vfs_chmod(conn,fname,mode) ((conn)->vfs_ops.chmod((conn),dos_to_unix((fname),False),(mode))) +#define vfs_chmod(conn,fname,mode) ((conn)->vfs_ops.chmod((conn),fname,(mode))) /******************************************************************* - vfs chown wrapper that calls dos_to_unix. + vfs chown wrapper that calls internal2unix. ********************************************************************/ -#define vfs_chown(conn,fname,uid,gid) ((conn)->vfs_ops.chown((conn),dos_to_unix((fname),False),(uid),(gid))) +#define vfs_chown(conn,fname,uid,gid) ((conn)->vfs_ops.chown((conn),fname,(uid),(gid))) /******************************************************************* A wrapper for vfs_chdir(). ********************************************************************/ -#define vfs_chdir(conn,fname) ((conn)->vfs_ops.chdir((conn),dos_to_unix((fname),False))) +#define vfs_chdir(conn,fname) ((conn)->vfs_ops.chdir((conn),fname)) #endif /* _SMB_MACROS_H */ diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 93823a5f23..5b1d804e4d 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -39,7 +39,7 @@ * vfs_ops below. JRA. */ -#define SMB_VFS_INTERFACE_VERSION 1 +#define SMB_VFS_INTERFACE_VERSION 2 /* VFS operations structure */ @@ -51,39 +51,39 @@ struct vfs_ops { /* Disk operations */ - int (*connect)(struct connection_struct *conn, char *service, char *user); + int (*connect)(struct connection_struct *conn, const char *service, const char *user); void (*disconnect)(struct connection_struct *conn); - SMB_BIG_UINT (*disk_free)(struct connection_struct *conn, char *path, BOOL small_query, SMB_BIG_UINT *bsize, + SMB_BIG_UINT (*disk_free)(struct connection_struct *conn, const char *path, BOOL small_query, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize); /* Directory operations */ - DIR *(*opendir)(struct connection_struct *conn, char *fname); + DIR *(*opendir)(struct connection_struct *conn, const char *fname); struct dirent *(*readdir)(struct connection_struct *conn, DIR *dirp); - int (*mkdir)(struct connection_struct *conn, char *path, mode_t mode); - int (*rmdir)(struct connection_struct *conn, char *path); + int (*mkdir)(struct connection_struct *conn, const char *path, mode_t mode); + int (*rmdir)(struct connection_struct *conn, const char *path); int (*closedir)(struct connection_struct *conn, DIR *dir); /* File operations */ - int (*open)(struct connection_struct *conn, char *fname, int flags, mode_t mode); + int (*open)(struct connection_struct *conn, const char *fname, int flags, mode_t mode); int (*close)(struct files_struct *fsp, int fd); ssize_t (*read)(struct files_struct *fsp, int fd, char *data, size_t n); - ssize_t (*write)(struct files_struct *fsp, int fd, char *data, size_t n); + ssize_t (*write)(struct files_struct *fsp, int fd, const char *data, size_t n); SMB_OFF_T (*lseek)(struct files_struct *fsp, int filedes, SMB_OFF_T offset, int whence); - int (*rename)(struct connection_struct *conn, char *old, char *new); + int (*rename)(struct connection_struct *conn, const char *old, const char *new); int (*fsync)(struct files_struct *fsp, int fd); - int (*stat)(struct connection_struct *conn, char *fname, SMB_STRUCT_STAT *sbuf); + int (*stat)(struct connection_struct *conn, const char *fname, SMB_STRUCT_STAT *sbuf); int (*fstat)(struct files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf); - int (*lstat)(struct connection_struct *conn, char *path, SMB_STRUCT_STAT *sbuf); - int (*unlink)(struct connection_struct *conn, char *path); - int (*chmod)(struct connection_struct *conn, char *path, mode_t mode); + int (*lstat)(struct connection_struct *conn, const char *path, SMB_STRUCT_STAT *sbuf); + int (*unlink)(struct connection_struct *conn, const char *path); + int (*chmod)(struct connection_struct *conn, const char *path, mode_t mode); int (*fchmod)(struct files_struct *fsp, int fd, mode_t mode); - int (*chown)(struct connection_struct *conn, char *path, uid_t uid, gid_t gid); + int (*chown)(struct connection_struct *conn, const char *path, uid_t uid, gid_t gid); int (*fchown)(struct files_struct *fsp, int fd, uid_t uid, gid_t gid); - int (*chdir)(struct connection_struct *conn, char *path); + int (*chdir)(struct connection_struct *conn, const char *path); char *(*getwd)(struct connection_struct *conn, char *buf); - int (*utime)(struct connection_struct *conn, char *path, struct utimbuf *times); + int (*utime)(struct connection_struct *conn, const char *path, struct utimbuf *times); int (*ftruncate)(struct files_struct *fsp, int fd, SMB_OFF_T offset); BOOL (*lock)(struct files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); int (*symlink)(struct connection_struct *conn, const char *oldpath, const char *newpath); @@ -92,13 +92,13 @@ struct vfs_ops { /* NT ACL operations. */ size_t (*fget_nt_acl)(struct files_struct *fsp, int fd, struct security_descriptor_info **ppdesc); - size_t (*get_nt_acl)(struct files_struct *fsp, char *name, struct security_descriptor_info **ppdesc); + size_t (*get_nt_acl)(struct files_struct *fsp, const char *name, struct security_descriptor_info **ppdesc); BOOL (*fset_nt_acl)(struct files_struct *fsp, int fd, uint32 security_info_sent, struct security_descriptor_info *psd); - BOOL (*set_nt_acl)(struct files_struct *fsp, char *name, uint32 security_info_sent, struct security_descriptor_info *psd); + BOOL (*set_nt_acl)(struct files_struct *fsp, const char *name, uint32 security_info_sent, struct security_descriptor_info *psd); /* POSIX ACL operations. */ - int (*chmod_acl)(struct connection_struct *conn, char *name, mode_t mode); + int (*chmod_acl)(struct connection_struct *conn, const char *name, mode_t mode); int (*fchmod_acl)(struct files_struct *fsp, int fd, mode_t mode); }; |