summaryrefslogtreecommitdiff
path: root/source4/lib/charset
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-13 22:46:09 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:49:56 +0100
commitd891c0c74a03d797aed1c5ac0329fd9d1d78da63 (patch)
tree65d0966014ca2bcded71ece2319a7723b03c4d3d /source4/lib/charset
parent8f687a5faeaf779e88c54bea4f886eb8f410d448 (diff)
downloadsamba-d891c0c74a03d797aed1c5ac0329fd9d1d78da63.tar.gz
samba-d891c0c74a03d797aed1c5ac0329fd9d1d78da63.tar.bz2
samba-d891c0c74a03d797aed1c5ac0329fd9d1d78da63.zip
r26429: Avoid use of global_smb_iconv_convenience.
(This used to be commit d37136b7abfbba75ef2e5ab855eb3382b9648b8c)
Diffstat (limited to 'source4/lib/charset')
-rw-r--r--source4/lib/charset/util_unistr.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/source4/lib/charset/util_unistr.c b/source4/lib/charset/util_unistr.c
index 67a790c250..e0e1aed222 100644
--- a/source4/lib/charset/util_unistr.c
+++ b/source4/lib/charset/util_unistr.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "system/locale.h"
#include "dynconfig.h"
+#include "param/param.h"
/**
* @file
@@ -129,8 +130,8 @@ _PUBLIC_ int strcasecmp_m(const char *s1, const char *s2)
if (s2 == NULL) return 1;
while (*s1 && *s2) {
- c1 = next_codepoint(global_smb_iconv_convenience, s1, &size1);
- c2 = next_codepoint(global_smb_iconv_convenience, s2, &size2);
+ c1 = next_codepoint(lp_iconv_convenience(global_loadparm), s1, &size1);
+ c2 = next_codepoint(lp_iconv_convenience(global_loadparm), s2, &size2);
s1 += size1;
s2 += size2;
@@ -215,8 +216,8 @@ _PUBLIC_ int strncasecmp_m(const char *s1, const char *s2, size_t n)
while (*s1 && *s2 && n) {
n--;
- c1 = next_codepoint(global_smb_iconv_convenience, s1, &size1);
- c2 = next_codepoint(global_smb_iconv_convenience, s2, &size2);
+ c1 = next_codepoint(lp_iconv_convenience(global_loadparm), s1, &size1);
+ c2 = next_codepoint(lp_iconv_convenience(global_loadparm), s2, &size2);
s1 += size1;
s2 += size2;
@@ -275,7 +276,7 @@ _PUBLIC_ void string_replace_w(char *s, char oldc, char newc)
{
while (s && *s) {
size_t size;
- codepoint_t c = next_codepoint(global_smb_iconv_convenience, s, &size);
+ codepoint_t c = next_codepoint(lp_iconv_convenience(global_loadparm), s, &size);
if (c == oldc) {
*s = newc;
}
@@ -353,7 +354,7 @@ _PUBLIC_ size_t strlen_m(const char *s)
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint(global_smb_iconv_convenience, s, &c_size);
+ codepoint_t c = next_codepoint(lp_iconv_convenience(global_loadparm), s, &c_size);
if (c < 0x10000) {
count += 1;
} else {
@@ -391,7 +392,7 @@ _PUBLIC_ char *strchr_m(const char *s, char c)
while (*s) {
size_t size;
- codepoint_t c2 = next_codepoint(global_smb_iconv_convenience, s, &size);
+ codepoint_t c2 = next_codepoint(lp_iconv_convenience(global_loadparm), s, &size);
if (c2 == c) {
return discard_const_p(char, s);
}
@@ -416,7 +417,7 @@ _PUBLIC_ char *strrchr_m(const char *s, char c)
while (*s) {
size_t size;
- codepoint_t c2 = next_codepoint(global_smb_iconv_convenience, s, &size);
+ codepoint_t c2 = next_codepoint(lp_iconv_convenience(global_loadparm), s, &size);
if (c2 == c) {
ret = discard_const_p(char, s);
}
@@ -436,7 +437,7 @@ _PUBLIC_ bool strhaslower(const char *string)
codepoint_t s;
codepoint_t t;
- s = next_codepoint(global_smb_iconv_convenience, string, &c_size);
+ s = next_codepoint(lp_iconv_convenience(global_loadparm), string, &c_size);
string += c_size;
t = toupper_w(s);
@@ -459,7 +460,7 @@ _PUBLIC_ bool strhasupper(const char *string)
codepoint_t s;
codepoint_t t;
- s = next_codepoint(global_smb_iconv_convenience, string, &c_size);
+ s = next_codepoint(lp_iconv_convenience(global_loadparm), string, &c_size);
string += c_size;
t = tolower_w(s);
@@ -489,12 +490,12 @@ _PUBLIC_ char *strlower_talloc(TALLOC_CTX *ctx, const char *src)
while (*src) {
size_t c_size;
- codepoint_t c = next_codepoint(global_smb_iconv_convenience, src, &c_size);
+ codepoint_t c = next_codepoint(lp_iconv_convenience(global_loadparm), src, &c_size);
src += c_size;
c = tolower_w(c);
- c_size = push_codepoint(global_smb_iconv_convenience, dest+size, c);
+ c_size = push_codepoint(lp_iconv_convenience(global_loadparm), dest+size, c);
if (c_size == -1) {
talloc_free(dest);
return NULL;
@@ -533,12 +534,12 @@ _PUBLIC_ char *strupper_talloc(TALLOC_CTX *ctx, const char *src)
while (*src) {
size_t c_size;
- codepoint_t c = next_codepoint(global_smb_iconv_convenience, src, &c_size);
+ codepoint_t c = next_codepoint(lp_iconv_convenience(global_loadparm), src, &c_size);
src += c_size;
c = toupper_w(c);
- c_size = push_codepoint(global_smb_iconv_convenience, dest+size, c);
+ c_size = push_codepoint(lp_iconv_convenience(global_loadparm), dest+size, c);
if (c_size == -1) {
talloc_free(dest);
return NULL;
@@ -579,8 +580,8 @@ _PUBLIC_ void strlower_m(char *s)
while (*s) {
size_t c_size, c_size2;
- codepoint_t c = next_codepoint(global_smb_iconv_convenience, s, &c_size);
- c_size2 = push_codepoint(global_smb_iconv_convenience, d, tolower_w(c));
+ codepoint_t c = next_codepoint(lp_iconv_convenience(global_loadparm), s, &c_size);
+ c_size2 = push_codepoint(lp_iconv_convenience(global_loadparm), d, tolower_w(c));
if (c_size2 > c_size) {
DEBUG(0,("FATAL: codepoint 0x%x (0x%x) expanded from %d to %d bytes in strlower_m\n",
c, tolower_w(c), (int)c_size, (int)c_size2));
@@ -615,8 +616,8 @@ _PUBLIC_ void strupper_m(char *s)
while (*s) {
size_t c_size, c_size2;
- codepoint_t c = next_codepoint(global_smb_iconv_convenience, s, &c_size);
- c_size2 = push_codepoint(global_smb_iconv_convenience, d, toupper_w(c));
+ codepoint_t c = next_codepoint(lp_iconv_convenience(global_loadparm), s, &c_size);
+ c_size2 = push_codepoint(lp_iconv_convenience(global_loadparm), d, toupper_w(c));
if (c_size2 > c_size) {
DEBUG(0,("FATAL: codepoint 0x%x (0x%x) expanded from %d to %d bytes in strupper_m\n",
c, toupper_w(c), (int)c_size, (int)c_size2));
@@ -638,7 +639,7 @@ _PUBLIC_ size_t count_chars_w(const char *s, char c)
while (*s) {
size_t size;
- codepoint_t c2 = next_codepoint(global_smb_iconv_convenience, s, &size);
+ codepoint_t c2 = next_codepoint(lp_iconv_convenience(global_loadparm), s, &size);
if (c2 == c) count++;
s += size;
}