X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Fdb-tool.c;h=bbb419abf3e26ee70e00d66b6a9b6832b20a5fb1;hb=ba9c448bb5446d0100173e7a594bcb1d849b4e39;hp=99e2d014ff0e55623f8b14693f07bf453e7ef119;hpb=2b33f6e0c6b72a15d6810501b1fb456749dcc806;p=libucw.git diff --git a/lib/db-tool.c b/lib/db-tool.c index 99e2d014..bbb419ab 100644 --- a/lib/db-tool.c +++ b/lib/db-tool.c @@ -2,12 +2,16 @@ * SDBM Database Utility * * (c) 2000--2001 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ #include "lib/lib.h" #include "lib/db.h" #include "lib/db_internal.h" #include "lib/fastbuf.h" +#include "lib/ff-binary.h" #include #include @@ -15,7 +19,6 @@ #include #include #include -#include static int verbose=0; static int cache=1024; @@ -158,7 +161,7 @@ rebuild(char *sdb, char *ddb) die("unlink: %m"); op.cache_size = cache; op.flags = SDBM_CREAT | SDBM_WRITE | SDBM_FAST; - op.page_order = (force_page >= 0) ? force_page : src->root->page_order; + op.page_order = (force_page >= 0) ? (u32) force_page : src->root->page_order; op.key_size = (force_key >= -1) ? force_key : src->root->key_size; op.val_size = (force_val >= -1) ? force_val : src->root->val_size; dest = sdbm_open(&op); @@ -225,7 +228,7 @@ Options:\n\ -k\t\tSet key size to (-1=variable) [restore,rebuild]\n\ -p\t\tSet page order to [restore,rebuild]\n\ \n\ -Commands: +Commands:\n\ b \tRebuild database\n\ d \tDump database\n\ r \tRestore database from dump\n\