From 651daa4b4256455b26b0affcdc45fe328b128c99 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 30 Aug 2004 21:35:43 +0000 Subject: r2114: Shameless theft of iconv commit from Samba4 to keep the two libs more in sync :-). try to cope with a wider range of UTF-16 characters when we are using an external libiconv library. Jeremy. (This used to be commit 5d04cd6804f6fc3b556e7c3b53fa0d7af39797c1) --- source3/include/charset.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source3/include/charset.h') diff --git a/source3/include/charset.h b/source3/include/charset.h index 7a9b12ef55..c5d03a62e8 100644 --- a/source3/include/charset.h +++ b/source3/include/charset.h @@ -31,9 +31,9 @@ typedef enum {CH_UCS2=0, CH_UNIX=1, CH_DISPLAY=2, CH_DOS=3, CH_UTF8=4} charset_t struct charset_functions { const char *name; - size_t (*pull)(void *, char **inbuf, size_t *inbytesleft, + size_t (*pull)(void *, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); - size_t (*push)(void *, char **inbuf, size_t *inbytesleft, + size_t (*push)(void *, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); struct charset_functions *prev, *next; }; @@ -57,7 +57,7 @@ struct charset_gap_table { * * */ #define SMB_GENERATE_CHARSET_MODULE_8_BIT_GAP(CHARSETNAME) \ -static size_t CHARSETNAME ## _push(void *cd, char **inbuf, size_t *inbytesleft, \ +static size_t CHARSETNAME ## _push(void *cd, const char **inbuf, size_t *inbytesleft, \ char **outbuf, size_t *outbytesleft) \ { \ while (*inbytesleft >= 2 && *outbytesleft >= 1) { \ @@ -97,7 +97,7 @@ static size_t CHARSETNAME ## _push(void *cd, char **inbuf, size_t *inbytesleft, return 0; \ } \ \ -static size_t CHARSETNAME ## _pull(void *cd, char **inbuf, size_t *inbytesleft, \ +static size_t CHARSETNAME ## _pull(void *cd, const char **inbuf, size_t *inbytesleft, \ char **outbuf, size_t *outbytesleft) \ { \ while (*inbytesleft >= 1 && *outbytesleft >= 2) { \ @@ -124,4 +124,3 @@ NTSTATUS charset_ ## CHARSETNAME ## _init(void) \ return smb_register_charset(& CHARSETNAME ## _functions); \ } \ - -- cgit