From e4235f6b8403197077ab5ad536e080d09bb980ff Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 1 Mar 2002 01:11:02 +0000 Subject: Fix up the pull_utf8_fstring/pstring functions, and add their push eqivilants. patch by Hasch@t-online.de (Juergen Hasch) Andrew Bartlett (This used to be commit ba2570f518e07c95b952fb824a2d0b040b912bcc) --- source3/lib/charcnv.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index df98c5a20b..d64033b498 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -400,7 +400,7 @@ flags can have: dest_len is the maximum length allowed in the destination. If dest_len is -1 then no maxiumum is used ****************************************************************************/ -int push_utf8(const void *base_ptr, void *dest, const char *src, int dest_len, int flags) +int push_utf8(void *dest, const char *src, int dest_len, int flags) { int src_len = strlen(src); pstring tmpbuf; @@ -423,6 +423,16 @@ int push_utf8(const void *base_ptr, void *dest, const char *src, int dest_len, i return convert_string(CH_UNIX, CH_UTF8, src, src_len, dest, dest_len); } +int push_utf8_fstring(void *dest, const char *src) +{ + return push_utf8(dest, src, sizeof(fstring), STR_TERMINATE); +} + +int push_utf8_pstring(void *dest, const char *src) +{ + return push_utf8(dest, src, sizeof(pstring), STR_TERMINATE); +} + /**************************************************************************** copy a string from a ucs2 source to a unix char* destination flags can have: @@ -476,7 +486,7 @@ src_len is the length of the source area in bytes return the number of bytes occupied by the string in src the resulting string in "dest" is always null terminated ****************************************************************************/ -int pull_utf8(const void *base_ptr, char *dest, const void *src, int dest_len, int src_len, int flags) +int pull_utf8(char *dest, const void *src, int dest_len, int src_len, int flags) { int ret; @@ -494,12 +504,12 @@ int pull_utf8(const void *base_ptr, char *dest, const void *src, int dest_len, i int pull_utf8_pstring(char *dest, const void *src) { - return pull_utf8(NULL, dest, src, sizeof(pstring), -1, STR_TERMINATE); + return pull_utf8(dest, src, sizeof(pstring), -1, STR_TERMINATE); } int pull_utf8_fstring(char *dest, const void *src) { - return pull_utf8(NULL, dest, src, sizeof(fstring), -1, STR_TERMINATE); + return pull_utf8(dest, src, sizeof(fstring), -1, STR_TERMINATE); } /**************************************************************************** -- cgit