lib/util/charset/util_unistr: add strlen_m_ext_term() - variant of strlen_m_ext(...
authorMichael Adam <obnox@samba.org>
Sun, 31 Oct 2010 00:02:16 +0000 (02:02 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 3 Nov 2010 22:45:20 +0000 (22:45 +0000)
lib/util/charset/charset.h
lib/util/charset/util_unistr.c

index 8222a0586e0c90bf7275e435138dd39e5f35444f..92ea7304bfad9f2164d747792c2157d52de1a180 100644 (file)
@@ -121,6 +121,8 @@ struct smb_iconv_convenience;
 
 char *strchr_m(const char *s, char c);
 size_t strlen_m_ext(const char *s, charset_t src_charset, charset_t dst_charset);
+size_t strlen_m_ext_term(const char *s, charset_t src_charset,
+                        charset_t dst_charset);
 size_t strlen_m_term(const char *s);
 size_t strlen_m_term_null(const char *s);
 size_t strlen_m(const char *s);
index 93fc24da15fa31f845ca471e22774d8a3c4ec554..74b453bf464d23883c75868662a93be930e8590a 100644 (file)
@@ -315,6 +315,16 @@ _PUBLIC_ size_t strlen_m_ext(const char *s, charset_t src_charset, charset_t dst
        return count;
 }
 
+_PUBLIC_ size_t strlen_m_ext_term(const char *s, const charset_t src_charset,
+                                 const charset_t dst_charset)
+{
+       if (!s) {
+               return 0;
+       }
+       return strlen_m_ext(s, src_charset, dst_charset) + 1;
+}
+
+
 /**
  Count the number of UCS2 characters in a string. Normally this will
  be the same as the number of bytes in a string for single byte strings,