]> mj.ucw.cz Git - libucw.git/commitdiff
conf2: lookup tables are byte** instead of char**
authorRobert Spalek <robert@ucw.cz>
Wed, 26 Apr 2006 09:09:17 +0000 (11:09 +0200)
committerRobert Spalek <robert@ucw.cz>
Wed, 26 Apr 2006 09:09:17 +0000 (11:09 +0200)
lib/conf2.c
lib/conf2.h
lib/ipaccess.c

index 8eb433d11871499400554925905d906a3162ca6d..0d6d4eb53fb1248e664ce39528b3cca9c4ff0d12 100644 (file)
@@ -591,9 +591,9 @@ cf_parse_string(byte *str, byte **ptr)
 }
 
 static byte *
-cf_parse_lookup(byte *str, int *ptr, char **t)
+cf_parse_lookup(byte *str, int *ptr, byte **t)
 {
-  char **n = t;
+  byte **n = t;
   uns total_len = 0;
   while (*n && strcasecmp(*n, str)) {
     total_len += strlen(*n) + 2;
@@ -1423,7 +1423,7 @@ dump_basic(struct fastbuf *fb, void *ptr, enum cf_type type, union cf_union *u)
     case CT_DOUBLE:    bprintf(fb, "%lg ", *(double*)ptr); break;
     case CT_IP:                bprintf(fb, "%08x ", *(uns*)ptr); break;
     case CT_STRING:    bprintf(fb, "'%s' ", *(byte**)ptr); break;
-    case CT_LOOKUP:    bprintf(fb, "%s ", *(int*)ptr >= 0 ? u->lookup[ *(int*)ptr ] : "???"); break;
+    case CT_LOOKUP:    bprintf(fb, "%s ", *(int*)ptr >= 0 ? u->lookup[ *(int*)ptr ] : (byte*) "???"); break;
     case CT_USER:
       if (u->utype->dumper)
        u->utype->dumper(fb, ptr);
index 737c285d41c5a532129016c8a1177c21cb317cd2..0021f3f26e07e743f04a5ba38124e281b02b0ccd 100644 (file)
@@ -65,7 +65,7 @@ struct cf_item {
   union cf_union {
     struct cf_section *sec;            // declaration of a section or a list
     cf_parser *par;                    // parser function
-    char **lookup;                     // NULL-terminated sequence of allowed strings for lookups
+    byte **lookup;                     // NULL-terminated sequence of allowed strings for lookups
     struct cf_user_type *utype;                // specification of the user-defined type
   } u;
   enum cf_class cls:16;                        // attribute class
index 910715e782245b534be90daf9e7e885cb1948013..3323d0a775ce61dfbe6b2b02c37ac93642616d46 100644 (file)
@@ -61,7 +61,7 @@ static struct cf_user_type addrmask_type = {
 struct cf_section ipaccess_cf = {
   CF_TYPE(struct ipaccess_entry),
   CF_ITEMS {
-    CF_LOOKUP("Mode", PTR_TO(struct ipaccess_entry, allow), ((char*[]) { "deny", "allow", NULL })),
+    CF_LOOKUP("Mode", PTR_TO(struct ipaccess_entry, allow), ((byte*[]) { "deny", "allow", NULL })),
     CF_USER("IP", PTR_TO(struct ipaccess_entry, addr), &addrmask_type),
     CF_END
   }