X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=dict%2Fdicttest.c;h=0a2ad73b66f4602da52c735380be6c431ea29608;hb=f69ee5ec6b2a86b7ac049992c19b9b0410705404;hp=86a733d36fdc0af0050dffd17030df16487c374d;hpb=3c5ad6ec79e41c91b818e9953b08c6217795693d;p=idzebra-moved-to-github.git diff --git a/dict/dicttest.c b/dict/dicttest.c index 86a733d..0a2ad73 100644 --- a/dict/dicttest.c +++ b/dict/dicttest.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: dicttest.c,v $ - * Revision 1.1 1994-08-16 16:26:47 adam + * Revision 1.2 1994-08-18 12:40:54 adam + * Some development of dictionary. Not finished at all! + * + * Revision 1.1 1994/08/16 16:26:47 adam * Added dict. * */ @@ -14,7 +17,6 @@ #include #include -#include char *prog; Dict dict; @@ -26,10 +28,10 @@ int main (int argc, char **argv) int rw = 0; int cache = 10; int ret; - int verbose = 0; char *arg; prog = argv[0]; + log_init (LOG_DEFAULT_LEVEL, prog, NULL); if (argc < 2) { fprintf (stderr, "usage:\n" @@ -42,7 +44,7 @@ int main (int argc, char **argv) { if (name) { - fprintf (stderr, "%s: too many files specified\n", prog); + log (LOG_FATAL, "too many files specified\n"); exit (1); } name = arg; @@ -61,22 +63,24 @@ int main (int argc, char **argv) rw = 1; } else if (ret == 'v') - verbose = atoi(arg); + { + log_init (atoi(arg), prog, NULL); + } else { - fprintf (stderr, "%s: unknown option\n", prog); + log (LOG_FATAL, "unknown option"); exit (1); } } if (!name) { - fprintf (stderr, "%s: no dictionary file given\n", prog); + log (LOG_FATAL, "no dictionary file given"); exit (1); } dict = dict_open (name, cache, rw); if (!dict) { - fprintf (stderr, "%s: dict_open fail\n", prog); + log (LOG_FATAL, "dict_open fail"); exit (1); } if (inputfile) @@ -88,7 +92,7 @@ int main (int argc, char **argv) if (!(ipf = fopen(inputfile, "r"))) { - fprintf (stderr, "%s: cannot open %s\n", prog, inputfile); + log (LOG_FATAL|LOG_ERRNO, "cannot open %s", inputfile); exit (1); }