diff options
author | Jeremy Allison <jra@samba.org> | 1998-03-03 20:19:14 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-03-03 20:19:14 +0000 |
commit | b7fb6c6b38784d25c9c85e9b27b08e30111dbd0c (patch) | |
tree | ff98efd1c5b4f92782b9687791a321037e2f9e6d /source3/client | |
parent | f0e121d100ef207b683fbb8d3079403e22929d0a (diff) | |
download | samba-b7fb6c6b38784d25c9c85e9b27b08e30111dbd0c.tar.gz samba-b7fb6c6b38784d25c9c85e9b27b08e30111dbd0c.tar.bz2 samba-b7fb6c6b38784d25c9c85e9b27b08e30111dbd0c.zip |
Change the multibyte character set support so that
Kanji support is one case of multibyte character
support, rather than being a specific case in
single byte character support.
This allows us to add Big5 Chinese support (code page 950)
and Korean Hangul support (code page 949) at very little
cost. Also allows us to easily add future multibyte
code pages.
Makefile: Added codepages 949, 950 as we now support more multibyte
codepages.
asyncdns.c: Fixed problem with child being re-spawned when parent killed.
charcnv.c
charset.c
client.c
clitar.c
kanji.c
kanji.h
smb.h
util.c
loadparm.c: Generic multibyte codepage support (adding Big5 Chinese
and Korean Hangul).
nmbd.c: Fixed problem with child being re-spawned when parent killed.
mangle.c: Modified str_checksum so that first 15 characters have more
effect on outcome. This helps with short name mangling as
most 'long' names are still shorter than 15 chars (bug was
foobar_mng and foobar_sum would hash to the same value, with
the modified code they hash differently.
Jeremy.
(This used to be commit 299016338cfb47f0c585875ef9b468121fcee97d)
Diffstat (limited to 'source3/client')
-rw-r--r-- | source3/client/client.c | 19 | ||||
-rw-r--r-- | source3/client/clitar.c | 63 | ||||
-rw-r--r-- | source3/client/smbmount.c | 19 |
3 files changed, 29 insertions, 72 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index 798dfe577e..988b6685a8 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -130,13 +130,8 @@ extern int Client; #define USENMB -static BOOL setup_term_code(char *code) -{ - interpret_coding_system(code); - return True; -} -#define CNV_LANG(s) dos2unix_format(s,False) -#define CNV_INPUT(s) unix2dos_format(s,True) +#define CNV_LANG(s) dos_to_unix(s,False) +#define CNV_INPUT(s) unix_to_dos(s,True) /**************************************************************************** send an SMBclose on an SMB file handle @@ -3756,15 +3751,7 @@ static void usage(char *pname) codepage_initialise(lp_client_code_page()); - if(lp_client_code_page() == KANJI_CODEPAGE) - { - if (!setup_term_code (term_code)) - { - DEBUG(0, ("%s: unknown terminal code name\n", optarg)); - usage (pname); - exit (1); - } - } + interpret_coding_system(term_code); if (*workgroup == 0) strcpy(workgroup,lp_workgroup()); diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 6a811f41c7..ccaab486d0 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -322,33 +322,25 @@ static void fixtarname(char *tptr, char *fp, int l) * to lovely unix /'s :-} */ *tptr++='.'; - if(lp_client_code_page() == KANJI_CODEPAGE) - { - while (l > 0) { - if (is_shift_jis (*fp)) { + + while (l > 0) { + int skip; + if((skip = skip_multibyte_char( *fp)) != 0) { + if (skip == 2) { *tptr++ = *fp++; *tptr++ = *fp++; l -= 2; - } else if (is_kana (*fp)) { - *tptr++ = *fp++; - l--; - } else if (*fp == '\\') { - *tptr++ = '/'; - fp++; - l--; - } else { + } else if (skip == 1) { *tptr++ = *fp++; l--; } - } - } - else - { - while (l--) - { - *tptr=(*fp == '\\') ? '/' : *fp; - tptr++; + } else if (*fp == '\\') { + *tptr++ = '/'; fp++; + l--; + } else { + *tptr++ = *fp++; + l--; } } } @@ -1227,33 +1219,24 @@ static void unfixtarname(char *tptr, char *fp, int l) if (*fp == '.') fp++; if (*fp == '\\' || *fp == '/') fp++; - if(lp_client_code_page() == KANJI_CODEPAGE) - { - while (l > 0) { - if (is_shift_jis (*fp)) { + while (l > 0) { + int skip; + if(( skip = skip_multibyte_char( *fp )) != 0) { + if (skip == 2) { *tptr++ = *fp++; *tptr++ = *fp++; l -= 2; - } else if (is_kana (*fp)) { - *tptr++ = *fp++; - l--; - } else if (*fp == '/') { - *tptr++ = '\\'; - fp++; - l--; - } else { + } else if (skip == 1) { *tptr++ = *fp++; l--; } - } - } - else - { - while (l--) - { - *tptr=(*fp == '/') ? '\\' : *fp; - tptr++; + } else if (*fp == '/') { + *tptr++ = '\\'; fp++; + l--; + } else { + *tptr++ = *fp++; + l--; } } } diff --git a/source3/client/smbmount.c b/source3/client/smbmount.c index 847c4b1f3d..e5902ff0d9 100644 --- a/source3/client/smbmount.c +++ b/source3/client/smbmount.c @@ -136,13 +136,8 @@ extern int Client; #define USENMB -static BOOL setup_term_code(char *code) -{ - interpret_coding_system(code); - return True; -} -#define CNV_LANG(s) dos2unix_format(s,False) -#define CNV_INPUT(s) unix2dos_format(s,True) +#define CNV_LANG(s) dos_to_unix(s,False) +#define CNV_INPUT(s) unix_to_dos(s,True) /**************************************************************************** check for existance of a dir @@ -879,15 +874,7 @@ static void usage(char *pname) codepage_initialise(lp_client_code_page()); - if(lp_client_code_page() == KANJI_CODEPAGE) - { - if (!setup_term_code (term_code)) - { - DEBUG(0, ("%s: unknown terminal code name\n", optarg)); - usage (pname); - exit (1); - } - } + interpret_coding_system(term_code); if (*workgroup == 0) strcpy(workgroup,lp_workgroup()); |