67 char **outbuf,
size_t *outbytesleft)
81 while (*inbytesleft > 0)
84 bufsize =
sizeof (cvtbuf);
86 if (cd->
pull (cd->
cd_pull, inbuf, inbytesleft, &bufp, &bufsize)
92 bufsize =
sizeof (cvtbuf) - bufsize;
94 if (cd->
push (cd->
cd_push, (
const char **) &bufp, &bufsize, outbuf,
106 return strcasecmp (
name,
"UCS-2LE") == 0
107 || strcasecmp (
name,
"UTF-16LE") == 0;
131 if (strcasecmp (fromcode, tocode) == 0)
147 #ifdef HAVE_NATIVE_ICONV 150 ret->
cd_pull = iconv_open (
"UTF-16LE", fromcode);
151 if (ret->
cd_pull == (iconv_t) -1)
152 ret->
cd_pull = iconv_open (
"UCS-2LE", fromcode);
153 if (ret->
cd_pull != (iconv_t) -1)
154 ret->
pull = sys_iconv;
159 ret->
cd_push = iconv_open (tocode,
"UTF-16LE");
160 if (ret->
cd_push == (iconv_t) -1)
161 ret->
cd_push = iconv_open (tocode,
"UCS-2LE");
162 if (ret->
cd_push != (iconv_t) -1)
163 ret->
push = sys_iconv;
192 #ifdef HAVE_NATIVE_ICONV 193 if (is_utf16 (fromcode))
200 if (is_utf16 (tocode))
218 #ifdef HAVE_NATIVE_ICONV 222 iconv_close ((iconv_t) cd->
cd_pull);
224 iconv_close ((iconv_t) cd->
cd_push);
230 memset (cd, 0,
sizeof (*cd));
237 char **outbuf,
size_t *outbytesleft)
241 n = MIN (*inbytesleft, *outbytesleft);
244 memmove (*outbuf, *inbuf, n);
247 (*outbytesleft) -= n;
251 if (*inbytesleft > 0)
struct charset_functions_ntlmssp * next
size_t(* push)(void *, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
static size_t iconv_copy_ntlmssp(void *, const char **, size_t *, char **, size_t *)
Unix SMB/CIFS implementation. charset defines.
size_t(* pull)(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
size_t(* direct)(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
size_t(* push)(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
smb_iconv_t smb_iconv_open_ntlmssp(const char *tocode, const char *fromcode)
size_t(* pull)(void *, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
size_t smb_iconv_ntlmssp(smb_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
Unix SMB/CIFS implementation.
#define SMB_MALLOC_P(type)
static struct charset_functions_ntlmssp * charsets
static bool is_utf16_ntlmssp(const char *name)
int smb_iconv_close_ntlmssp(smb_iconv_t cd)
Unix SMB/CIFS implementation. iconv memory system include wrappers.
static struct charset_functions_ntlmssp * find_charset_functions_ntlmssp(const char *name)