diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-03-19 12:20:11 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-04-14 12:53:56 +1000 |
commit | 3b3e21bd9ba701a97e752205263a7903619541c7 (patch) | |
tree | 3f0cdf8e4d5a550a323e73d229083d6329b3f236 /source3/web | |
parent | 4786a493f70070dce6de4cbe488c9de1bdbb75ad (diff) | |
download | samba-3b3e21bd9ba701a97e752205263a7903619541c7.tar.gz samba-3b3e21bd9ba701a97e752205263a7903619541c7.tar.bz2 samba-3b3e21bd9ba701a97e752205263a7903619541c7.zip |
Convert Samba3 to use the common lib/util/charset API
This removes calls to push_*_allocate() and pull_*_allocate(), as well
as convert_string_allocate, as they are not in the common API
To allow transition to a common charcnv in future, provide Samba4-like
strupper functions in source3/lib/charcnv.c
(the actual implementation remains distinct, but the API is now shared)
Andrew Bartlett
Diffstat (limited to 'source3/web')
-rw-r--r-- | source3/web/cgi.c | 4 | ||||
-rw-r--r-- | source3/web/statuspage.c | 4 | ||||
-rw-r--r-- | source3/web/swat.c | 20 |
3 files changed, 14 insertions, 14 deletions
diff --git a/source3/web/cgi.c b/source3/web/cgi.c index 40f9ee6966..261d4366bf 100644 --- a/source3/web/cgi.c +++ b/source3/web/cgi.c @@ -205,14 +205,14 @@ void cgi_load_variables(void) char *dest = NULL; size_t dest_len; - convert_string_allocate(frame, CH_UTF8, CH_UNIX, + convert_string_talloc(frame, CH_UTF8, CH_UNIX, variables[i].name, strlen(variables[i].name), &dest, &dest_len, True); SAFE_FREE(variables[i].name); variables[i].name = SMB_STRDUP(dest ? dest : ""); dest = NULL; - convert_string_allocate(frame, CH_UTF8, CH_UNIX, + convert_string_talloc(frame, CH_UTF8, CH_UNIX, variables[i].value, strlen(variables[i].value), &dest, &dest_len, True); SAFE_FREE(variables[i].value); diff --git a/source3/web/statuspage.c b/source3/web/statuspage.c index 7dd1cf55cc..590be1dde2 100644 --- a/source3/web/statuspage.c +++ b/source3/web/statuspage.c @@ -171,10 +171,10 @@ static void print_share_mode(const struct share_mode_entry *e, printf("NONE "); printf("</td>"); - push_utf8_allocate(&utf8_fname, fname, &converted_size); + push_utf8_talloc(talloc_tos(), &utf8_fname, fname, &converted_size); printf("<td>%s</td><td>%s</td></tr>\n", utf8_fname,tstring(talloc_tos(),e->time.tv_sec)); - SAFE_FREE(utf8_fname); + TALLOC_FREE(utf8_fname); } diff --git a/source3/web/swat.c b/source3/web/swat.c index 4bfb731814..1d843a0f65 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -255,16 +255,16 @@ static void show_parameter(int snum, struct parm_struct *parm) for (;*list;list++) { /* enclose in HTML encoded quotes if the string contains a space */ if ( strchr_m(*list, ' ') ) { - push_utf8_allocate(&utf8_s1, *list, &converted_size); - push_utf8_allocate(&utf8_s2, ((*(list+1))?", ":""), &converted_size); + push_utf8_talloc(talloc_tos(), &utf8_s1, *list, &converted_size); + push_utf8_talloc(talloc_tos(), &utf8_s2, ((*(list+1))?", ":""), &converted_size); printf(""%s"%s", utf8_s1, utf8_s2); } else { - push_utf8_allocate(&utf8_s1, *list, &converted_size); - push_utf8_allocate(&utf8_s2, ((*(list+1))?", ":""), &converted_size); + push_utf8_talloc(talloc_tos(), &utf8_s1, *list, &converted_size); + push_utf8_talloc(talloc_tos(), &utf8_s2, ((*(list+1))?", ":""), &converted_size); printf("%s%s", utf8_s1, utf8_s2); } - SAFE_FREE(utf8_s1); - SAFE_FREE(utf8_s2); + TALLOC_FREE(utf8_s1); + TALLOC_FREE(utf8_s2); } } printf("\">"); @@ -285,10 +285,10 @@ static void show_parameter(int snum, struct parm_struct *parm) case P_STRING: case P_USTRING: - push_utf8_allocate(&utf8_s1, *(char **)ptr, &converted_size); + push_utf8_talloc(talloc_tos(), &utf8_s1, *(char **)ptr, &converted_size); printf("<input type=text size=40 name=\"parm_%s\" value=\"%s\">", make_parm_name(parm->label), fix_quotes(ctx, utf8_s1)); - SAFE_FREE(utf8_s1); + TALLOC_FREE(utf8_s1); printf("<input type=button value=\"%s\" onClick=\"swatform.parm_%s.value=\'%s\'\">", _("Set Default"), make_parm_name(parm->label),fix_backslash((char *)(parm->def.svalue))); break; @@ -959,11 +959,11 @@ static void shares_page(void) for (i=0;i<lp_numservices();i++) { s = lp_servicename(i); if (s && (*s) && strcmp(s,"IPC$") && !lp_print_ok(i)) { - push_utf8_allocate(&utf8_s, s, &converted_size); + push_utf8_talloc(talloc_tos(), &utf8_s, s, &converted_size); printf("<option %s value=\"%s\">%s\n", (share && strcmp(share,s)==0)?"SELECTED":"", utf8_s, utf8_s); - SAFE_FREE(utf8_s); + TALLOC_FREE(utf8_s); } } printf("</select></td>\n"); |