#include "iconv.h"
#include "charset.h"
#include "smb.h"
Go to the source code of this file.
|
typedef unsigned int | bool |
|
◆ bool
typedef unsigned int bool |
◆ smb_iconv_close_ntlmssp()
◆ smb_iconv_ntlmssp()
size_t smb_iconv_ntlmssp |
( |
smb_iconv_t |
cd, |
|
|
const char ** |
inbuf, |
|
|
size_t * |
inbytesleft, |
|
|
char ** |
outbuf, |
|
|
size_t * |
outbytesleft |
|
) |
| |
This is a simple portable iconv() implementaion.
It only knows about a very small number of character sets - just enough that Samba works on systems that don't have iconv.
Definition at line 59 of file iconv.c.
References _smb_iconv_t::cd_direct, _smb_iconv_t::cd_pull, _smb_iconv_t::cd_push, _smb_iconv_t::direct, _smb_iconv_t::pull, and _smb_iconv_t::push.
70 inbuf, inbytesleft, outbuf, outbytesleft);
75 while (*inbytesleft > 0) {
77 bufsize =
sizeof(cvtbuf);
80 inbuf, inbytesleft, &bufp, &bufsize) == -1
81 && errno != E2BIG)
return -1;
84 bufsize =
sizeof(cvtbuf) - bufsize;
87 (
const char **)&bufp, &bufsize,
88 outbuf, outbytesleft) == -1)
return -1;
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_open_ntlmssp()
smb_iconv_t smb_iconv_open_ntlmssp |
( |
const char * |
tocode, |
|
|
const char * |
fromcode |
|
) |
| |
Definition at line 105 of file iconv.c.
References _smb_iconv_t::direct, _smb_iconv_t::from_name, SMB_MALLOC_P, SMB_STRDUP, and _smb_iconv_t::to_name.
121 if (strcasecmp(fromcode, tocode) == 0) {
122 ret->
direct = iconv_copy_ntlmssp;
127 from = find_charset_functions_ntlmssp(fromcode);
130 to = find_charset_functions_ntlmssp(tocode);
134 #ifdef HAVE_NATIVE_ICONV 136 ret->
cd_pull = iconv_open(
"UTF-16LE", fromcode);
137 if (ret->
cd_pull == (iconv_t)-1)
138 ret->
cd_pull = iconv_open(
"UCS-2LE", fromcode);
139 if (ret->
cd_pull != (iconv_t)-1)
140 ret->
pull = sys_iconv;
144 ret->
cd_push = iconv_open(tocode,
"UTF-16LE");
145 if (ret->
cd_push == (iconv_t)-1)
146 ret->
cd_push = iconv_open(tocode,
"UCS-2LE");
147 if (ret->
cd_push != (iconv_t)-1)
148 ret->
push = sys_iconv;
161 if (is_utf16_ntlmssp(fromcode) && to) {
167 if (is_utf16_ntlmssp(tocode) && from) {
174 #ifdef HAVE_NATIVE_ICONV 175 if (is_utf16(fromcode)) {
181 if (is_utf16(tocode)) {
size_t(* push)(void *, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
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)
size_t(* pull)(void *, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
#define SMB_MALLOC_P(type)