]> mj.ucw.cz Git - libucw.git/commitdiff
shell/config: remove duplicate type_size()
authorRobert Spalek <robert@ucw.cz>
Wed, 17 May 2006 09:15:30 +0000 (11:15 +0200)
committerRobert Spalek <robert@ucw.cz>
Wed, 17 May 2006 09:15:30 +0000 (11:15 +0200)
lib/shell/config.c

index 2395458408e5e36d466ba8f7f7dccd5324c50dc7..4a0910d1e725c9d4a95db55ba3ea66fdd80a701e 100644 (file)
@@ -20,6 +20,7 @@
 #include "lib/lib.h"
 #include "lib/conf.h"
 #include "lib/getopt.h"
+#include "lib/conf-internal.h"
 #include "lib/clists.h"
 #include "lib/mempool.h"
 #include "lib/chartype.h"
@@ -330,19 +331,6 @@ generate_section(struct section *section)
 
 static bb_t path;
 
-static uns
-type_size(enum cf_type type)
-{
-  switch (type)
-    {
-      case CT_INT: return sizeof(int);
-      case CT_U64: return sizeof(u64);
-      case CT_DOUBLE: return sizeof(double);
-      case CT_STRING: return sizeof(byte *);
-      default: ASSERT(0);
-    }
-}
-
 static void
 dump_value(uns array, struct item *item, void *v)
 {
@@ -406,7 +394,7 @@ dump_item(struct item *item, void *ptr, uns path_len)
         {
          val = *(void **)val;
          uns len = DARY_LEN(val);
-         uns size = type_size(item->cf.type);
+         uns size = cf_type_size(item->cf.type, NULL);
          for (uns i = 0; i < len; i++, val += size)
            dump_value(1, item, val);
        }