* 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.
*
*/
#include <stdio.h>
#include <dict.h>
-#include <options.h>
char *prog;
Dict dict;
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"
{
if (name)
{
- fprintf (stderr, "%s: too many files specified\n", prog);
+ log (LOG_FATAL, "too many files specified\n");
exit (1);
}
name = arg;
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)
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);
}