s3:charcnv Remove unused ucs2_to_unistr2()
authorAndrew Bartlett <abartlet@samba.org>
Thu, 19 Mar 2009 08:11:15 +0000 (19:11 +1100)
committerGünther Deschner <gd@samba.org>
Tue, 7 Apr 2009 18:51:55 +0000 (20:51 +0200)
Signed-off-by: Günther Deschner <gd@samba.org>
source3/include/proto.h
source3/lib/util_unistr.c

index b677c3d9224df37665cc86c40ce8310060455df0..788f33ff71e80b5bc9289b1479b089ce4a352f0e 100644 (file)
@@ -1602,7 +1602,6 @@ smb_ucs2_t *strpbrk_wa(const smb_ucs2_t *s, const char *p);
 smb_ucs2_t *strstr_wa(const smb_ucs2_t *s, const char *ins);
 int unistrlen(uint16 *s);
 int unistrcpy(uint16 *dst, uint16 *src);
-UNISTR2* ucs2_to_unistr2(TALLOC_CTX *ctx, UNISTR2* dst, smb_ucs2_t* src);
 int toupper_ascii(int c);
 int tolower_ascii(int c);
 int isupper_ascii(int c);
index 840e8e06da7670f7e12868bc34f4bc64470f6984..178bbc7e94ed954d1522113e43ec800aa4b118ce 100644 (file)
@@ -1003,52 +1003,6 @@ int unistrcpy(uint16 *dst, uint16 *src)
        return num_wchars;
 }
 
-/**
- * Samba ucs2 type to UNISTR2 conversion
- *
- * @param ctx Talloc context to create the dst strcture (if null) and the 
- *            contents of the unicode string.
- * @param dst UNISTR2 destination. If equals null, then it's allocated.
- * @param src smb_ucs2_t source.
- * @param max_len maximum number of unicode characters to copy. If equals
- *        null, then null-termination of src is taken
- *
- * @return copied UNISTR2 destination
- **/
-
-UNISTR2* ucs2_to_unistr2(TALLOC_CTX *ctx, UNISTR2* dst, smb_ucs2_t* src)
-{
-       size_t len;
-
-       if (!src) {
-               return NULL;
-       }
-
-       len = strlen_w(src);
-       
-       /* allocate UNISTR2 destination if not given */
-       if (!dst) {
-               dst = TALLOC_P(ctx, UNISTR2);
-               if (!dst)
-                       return NULL;
-       }
-       if (!dst->buffer) {
-               dst->buffer = TALLOC_ARRAY(ctx, uint16, len + 1);
-               if (!dst->buffer)
-                       return NULL;
-       }
-       
-       /* set UNISTR2 parameters */
-       dst->uni_max_len = len + 1;
-       dst->offset = 0;
-       dst->uni_str_len = len;
-       
-       /* copy the actual unicode string */
-       strncpy_w(dst->buffer, src, dst->uni_max_len);
-       
-       return dst;
-}
-
 /*************************************************************
  ascii only toupper - saves the need for smbd to be in C locale.
 *************************************************************/