1 /* Gateway db utility test
5 * Revision 1.1 1995/03/27 08:25:02 adam
6 * New module gip: Gateway IPc module.
7 * New module gw-db: Gateway hash-db module (user information table).
18 int main (int argc, char **argv)
28 gwdb = gw_db_open ("db.test", 1);
29 for (no = 0; scanf ("%s", word) == 1; no++)
31 r = gw_db_lookup (gwdb, word, strlen(word), & buf, &count);
35 sprintf (info, "%d", no);
36 if (gw_db_insert (gwdb, word, strlen(word), info, strlen (info)))
38 printf ("gw_db_insert of %s failed\n", word);
49 printf ("gw_db_lookup of %s failed\n", word);
54 printf ("Lookup: %d. Insert: %d\n", no, no_insert);