1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

r831: These functions duplicate the push/pull charcnv interfaces that we use

everywhere else in the Samba code, so remove them for clarity.

(ok, so  also just never liked the names  ;-)

Andrew Bartlett
(This used to be commit 5f5786ad5ff6cc133a143476e8968b00ed057a62)
This commit is contained in:
Andrew Bartlett 2004-05-23 12:44:53 +00:00 committed by Gerald (Jerry) Carter
parent a64be8dbdd
commit 5b5e793d16

View File

@ -841,86 +841,3 @@ ssize_t pull_string_talloc(TALLOC_CTX *ctx, char **dest, const void *src, size_t
return src_len;
}
/**
Convert from ucs2 to unix charset and return the
allocated and converted string or NULL if an error occurred.
You must provide a zero terminated string.
The returning string will be zero terminated.
**/
char *acnv_u2ux(const smb_ucs2_t *src)
{
size_t slen;
size_t dlen;
void *dest;
slen = (strlen_w(src) + 1) * sizeof(smb_ucs2_t);
dlen = convert_string_allocate(CH_UCS2, CH_UNIX, src, slen, &dest);
if (dlen == (size_t)-1)
return NULL;
else
return dest;
}
/**
Convert from unix to ucs2 charset and return the
allocated and converted string or NULL if an error occurred.
You must provide a zero terminated string.
The returning string will be zero terminated.
**/
smb_ucs2_t *acnv_uxu2(const char *src)
{
size_t slen;
size_t dlen;
void *dest;
slen = strlen(src) + 1;
dlen = convert_string_allocate(CH_UNIX, CH_UCS2, src, slen, &dest);
if (dlen == (size_t)-1)
return NULL;
else
return dest;
}
/**
Convert from ucs2 to dos charset and return the
allocated and converted string or NULL if an error occurred.
You must provide a zero terminated string.
The returning string will be zero terminated.
**/
char *acnv_u2dos(const smb_ucs2_t *src)
{
size_t slen;
size_t dlen;
void *dest;
slen = (strlen_w(src) + 1) * sizeof(smb_ucs2_t);
dlen = convert_string_allocate(CH_UCS2, CH_DOS, src, slen, &dest);
if (dlen == (size_t)-1)
return NULL;
else
return dest;
}
/**
Convert from dos to ucs2 charset and return the
allocated and converted string or NULL if an error occurred.
You must provide a zero terminated string.
The returning string will be zero terminated.
**/
smb_ucs2_t *acnv_dosu2(const char *src)
{
size_t slen;
size_t dlen;
void *dest;
slen = strlen(src) + 1;
dlen = convert_string_allocate(CH_DOS, CH_UCS2, src, slen, &dest);
if (dlen == (size_t)-1)
return NULL;
else
return dest;
}