diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-07-12 14:55:24 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-07-14 15:06:45 +1000 |
commit | 07f14aa3a7431ee1bd2994db84e32afddcaaf8dd (patch) | |
tree | 7c36404be3f30a51544e4bfd9159d77b310af8b4 /source4 | |
parent | 3fc182dba51e50c8f7fb9b233a1c951e2b5ac712 (diff) | |
download | samba-07f14aa3a7431ee1bd2994db84e32afddcaaf8dd.tar.gz samba-07f14aa3a7431ee1bd2994db84e32afddcaaf8dd.tar.bz2 samba-07f14aa3a7431ee1bd2994db84e32afddcaaf8dd.zip |
s4-param cope with parameters of type char
Diffstat (limited to 'source4')
-rw-r--r-- | source4/param/loadparm.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index df8b054d30..18e2df1c70 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -2504,6 +2504,10 @@ static bool set_variable(TALLOC_CTX *mem_ctx, int parmnum, void *parm_ptr, *(int *)parm_ptr = atoi(pszParmValue); break; + case P_CHAR: + *(char *)parm_ptr = *pszParmValue; + break; + case P_OCTAL: *(int *)parm_ptr = strtol(pszParmValue, NULL, 8); break; @@ -2819,6 +2823,10 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) fprintf(f, "%d", *(int *)ptr); break; + case P_CHAR: + fprintf(f, "%c", *(char *)ptr); + break; + case P_OCTAL: fprintf(f, "0%o", *(int *)ptr); break; @@ -2866,6 +2874,9 @@ static bool equal_parameter(parm_type type, void *ptr1, void *ptr2) case P_ENUM: return (*((int *)ptr1) == *((int *)ptr2)); + case P_CHAR: + return (*((char *)ptr1) == *((char *)ptr2)); + case P_CMDLIST: case P_LIST: return str_list_equal((const char **)(*(char ***)ptr1), @@ -2957,6 +2968,7 @@ static bool is_default(struct loadparm_service *sDefault, int i) return parm_table[i].def.bvalue == *(int *)def_ptr; case P_INTEGER: + case P_CHAR: case P_OCTAL: case P_BYTES: case P_ENUM: |