From 07f14aa3a7431ee1bd2994db84e32afddcaaf8dd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 12 Jul 2011 14:55:24 +1000 Subject: s4-param cope with parameters of type char --- source4/param/loadparm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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: -- cgit