Sync smb_iconv_t type, convert_string return type with Samba 3 equivalents.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 1 Mar 2009 11:59:58 +0000 (12:59 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 1 Mar 2009 11:59:58 +0000 (12:59 +0100)
lib/util/charset/charset.h
lib/util/charset/util_unistr.c
source3/include/includes.h
source3/include/proto.h
source3/include/smb.h

index 82484b780503dceaa4ce0c40837b9a85fb37cff7..3acdde30ad87f3e45bc05c441dff1b30a93caf80 100644 (file)
@@ -61,6 +61,7 @@ typedef struct smb_iconv_s {
        size_t (*push)(void *cd, const char **inbuf, size_t *inbytesleft,
                       char **outbuf, size_t *outbytesleft);
        void *cd_direct, *cd_pull, *cd_push;
        size_t (*push)(void *cd, const char **inbuf, size_t *inbytesleft,
                       char **outbuf, size_t *outbytesleft);
        void *cd_direct, *cd_pull, *cd_push;
+       char *from_name, *to_name;
 } *smb_iconv_t;
 
 /* string manipulation flags */
 } *smb_iconv_t;
 
 /* string manipulation flags */
@@ -119,7 +120,7 @@ ssize_t convert_string_talloc(TALLOC_CTX *ctx,
                                       void const *src, size_t srclen, 
                                       void **dest, bool allow_badcharcnv);
 
                                       void const *src, size_t srclen, 
                                       void **dest, bool allow_badcharcnv);
 
-ssize_t convert_string(charset_t from, charset_t to,
+size_t convert_string(charset_t from, charset_t to,
                                void const *src, size_t srclen, 
                                void *dest, size_t destlen, bool allow_badcharcnv);
 
                                void const *src, size_t srclen, 
                                void *dest, size_t destlen, bool allow_badcharcnv);
 
index e6c6c3f466025b82f072ff44cc53b2c11b4b718e..96c987393ff1dc9d1b69613a9e5c2987ddad6872 100644 (file)
@@ -950,7 +950,7 @@ _PUBLIC_ ssize_t pull_string(char *dest, const void *src, size_t dest_len, size_
  * @param destlen maximal length allowed for string
  * @returns the number of bytes occupied in the destination
  **/
  * @param destlen maximal length allowed for string
  * @returns the number of bytes occupied in the destination
  **/
-_PUBLIC_ ssize_t convert_string(charset_t from, charset_t to,
+_PUBLIC_ size_t convert_string(charset_t from, charset_t to,
                                void const *src, size_t srclen, 
                                void *dest, size_t destlen, bool allow_badcharcnv)
 {
                                void const *src, size_t srclen, 
                                void *dest, size_t destlen, bool allow_badcharcnv)
 {
index 523a11e255da3c7b66d3a1d5ccc94c82d491b1f4..7f8c408265823021d14324e621c82ad84a8c91ab 100644 (file)
@@ -594,7 +594,7 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 #include "trans2.h"
 #include "../libcli/util/error.h"
 #include "ntioctl.h"
 #include "trans2.h"
 #include "../libcli/util/error.h"
 #include "ntioctl.h"
-#include "charset.h"
+#include "../lib/util/charset/charset.h"
 #include "dynconfig.h"
 #include "util_getent.h"
 #include "debugparse.h"
 #include "dynconfig.h"
 #include "util_getent.h"
 #include "debugparse.h"
index 5bae973c3d1531a07f2f54a833fb09c7962584b3..eeb6f1928deadccd9f13a073886b8e7e5efbee1e 100644 (file)
@@ -528,15 +528,6 @@ void gencache_iterate(void (*fn)(const char* key, const char *value, time_t time
 int gencache_lock_entry( const char *key );
 void gencache_unlock_entry( const char *key );
 
 int gencache_lock_entry( const char *key );
 void gencache_unlock_entry( const char *key );
 
-/* The following definitions come from lib/iconv.c  */
-
-NTSTATUS smb_register_charset(struct charset_functions *funcs) ;
-size_t smb_iconv(smb_iconv_t cd, 
-                const char **inbuf, size_t *inbytesleft,
-                char **outbuf, size_t *outbytesleft);
-smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode);
-int smb_iconv_close (smb_iconv_t cd);
-
 /* The following definitions come from lib/interface.c  */
 
 bool ismyaddr(const struct sockaddr *ip);
 /* The following definitions come from lib/interface.c  */
 
 bool ismyaddr(const struct sockaddr *ip);
index f02088731d75b08e7352bda9c9a21e87220f8ea8..189e370496d5bfc7ea6a3762f30979ebddab2bec 100644 (file)
@@ -167,10 +167,6 @@ typedef uint16 smb_ucs2_t;
 #define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\
                                ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest))
 
 #define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\
                                ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest))
 
-/* Large data type for manipulating uint32 unicode codepoints */
-typedef uint32 codepoint_t;
-#define INVALID_CODEPOINT ((codepoint_t)-1)
-
 /* pipe string names */
 #define PIPE_LANMAN   "\\PIPE\\LANMAN"
 
 /* pipe string names */
 #define PIPE_LANMAN   "\\PIPE\\LANMAN"
 
@@ -1831,18 +1827,6 @@ struct unix_error_map {
 
 #define SAFE_NETBIOS_CHARS ". -_"
 
 
 #define SAFE_NETBIOS_CHARS ". -_"
 
-/* generic iconv conversion structure */
-typedef struct _smb_iconv_t {
-       size_t (*direct)(void *cd, 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 (*push)(void *cd, const char **inbuf, size_t *inbytesleft,
-                      char **outbuf, size_t *outbytesleft);
-       void *cd_direct, *cd_pull, *cd_push;
-       char *from_name, *to_name;
-} *smb_iconv_t;
-
 /* The maximum length of a trust account password.
    Used when we randomly create it, 15 char passwords
    exceed NT4's max password length */
 /* The maximum length of a trust account password.
    Used when we randomly create it, 15 char passwords
    exceed NT4's max password length */