summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorTim Prouty <tim.prouty@isilon.com>2008-04-29 14:36:24 -0700
committerVolker Lendecke <vl@samba.org>2008-05-20 22:40:13 +0200
commitfb37f156009611af0dd454a0fb0829a09cd638ac (patch)
treee97403a13dd39b7ef485d36c6c7856045e6e4bf3 /source3/include
parent6ed27edbcd3ba1893636a8072c8d7a621437daf7 (diff)
downloadsamba-fb37f156009611af0dd454a0fb0829a09cd638ac.tar.gz
samba-fb37f156009611af0dd454a0fb0829a09cd638ac.tar.bz2
samba-fb37f156009611af0dd454a0fb0829a09cd638ac.zip
Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup functions in charcnv.c returning size_t == -1 to indicate failure. (This used to be commit 6b189dabc562d86dcaa685419d0cb6ea276f100d)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/proto.h33
1 files changed, 20 insertions, 13 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index bf6328d5fd..a0354a3920 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -366,9 +366,9 @@ size_t convert_string(charset_t from, charset_t to,
bool convert_string_allocate(TALLOC_CTX *ctx, charset_t from, charset_t to,
void const *src, size_t srclen, void *dst,
size_t *converted_size, bool allow_bad_conv);
-size_t convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to,
- void const *src, size_t srclen, void *dst,
- bool allow_bad_conv);
+bool convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to,
+ void const *src, size_t srclen, void *dst,
+ size_t *converted_size, bool allow_bad_conv);
size_t unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen);
char *strdup_upper(const char *s);
char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *s);
@@ -379,16 +379,17 @@ size_t ucs2_align(const void *base_ptr, const void *p, int flags);
size_t push_ascii(void *dest, const char *src, size_t dest_len, int flags);
size_t push_ascii_fstring(void *dest, const char *src);
size_t push_ascii_nstring(void *dest, const char *src);
-size_t push_ascii_allocate(char **dest, const char *src);
+bool push_ascii_allocate(char **dest, const char *src, size_t *converted_size);
size_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len, int flags);
size_t pull_ascii_fstring(char *dest, const void *src);
size_t pull_ascii_nstring(char *dest, size_t dest_len, const void *src);
size_t push_ucs2(const void *base_ptr, void *dest, const char *src, size_t dest_len, int flags);
-size_t push_ucs2_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src);
-size_t push_ucs2_allocate(smb_ucs2_t **dest, const char *src);
+bool push_ucs2_allocate(smb_ucs2_t **dest, const char *src,
+ size_t *converted_size);
size_t push_utf8_fstring(void *dest, const char *src);
-size_t push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src);
-size_t push_utf8_allocate(char **dest, const char *src);
+bool push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
+ size_t *converted_size);
+bool push_utf8_allocate(char **dest, const char *src, size_t *converted_size);
size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_len, size_t src_len, int flags);
size_t pull_ucs2_base_talloc(TALLOC_CTX *ctx,
const void *base_ptr,
@@ -397,11 +398,17 @@ size_t pull_ucs2_base_talloc(TALLOC_CTX *ctx,
size_t src_len,
int flags);
size_t pull_ucs2_fstring(char *dest, const void *src);
-size_t pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const smb_ucs2_t *src);
-size_t pull_ucs2_allocate(char **dest, const smb_ucs2_t *src);
-size_t pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src);
-size_t pull_utf8_allocate(char **dest, const char *src);
-size_t pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src);
+bool push_ucs2_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src,
+ size_t *converted_size);
+bool pull_ucs2_allocate(char **dest, const smb_ucs2_t *src,
+ size_t *converted_size);
+bool pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
+ size_t *converted_size);
+bool pull_utf8_allocate(char **dest, const char *src, size_t *converted_size);
+bool pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const smb_ucs2_t *src,
+ size_t *converted_size);
+bool pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
+ size_t *converted_size);
size_t push_string_fn(const char *function, unsigned int line,
const void *base_ptr, uint16 flags2,
void *dest, const char *src,