*/
static const char * const cvsid =
- "$Id: adnslogres.c,v 1.15 2000/09/16 19:29:22 ian Exp $";
+ "$Id: adnslogres.c,v 1.16 2000/09/16 20:37:56 ian Exp $";
#include <sys/types.h>
#include <sys/time.h>
#define OPT_POLL 2
static const char *progname;
+static const char *config_text;
#define guard_null(str) ((str) ? (str) : "")
adns_state adns;
adns_answer *answer;
logline *head, *tail, *line;
+ adns_initflags initflags;
- errno= adns_init(&adns, (opts & OPT_DEBUG) ? adns_if_debug : 0, 0);
+ initflags= (opts & OPT_DEBUG) ? adns_if_debug : 0;
+ if (config_text) {
+ errno= adns_init_strcfg(&adns, initflags, stderr, config_text);
+ } else {
+ errno= adns_init(&adns, initflags, 0);
+ }
if (errno) aargh("adns_init");
head= tail= readline(inf, adns, opts);
len= 1; eof= 0;
}
static void usage(void) {
- fprintf(stderr, "usage: %s [-d] [-p] [-c concurrency] [logfile]\n", progname);
+ fprintf(stderr, "usage: %s [-d] [-p] [-c concurrency] [-C config] [logfile]\n",
+ progname);
exit(1);
}
maxpending= DEFMAXPENDING;
opts= 0;
- while ((c= getopt(argc, argv, "c:dp")) != -1)
+ while ((c= getopt(argc, argv, "c:C:dp")) != -1)
switch (c) {
case 'c':
maxpending= atoi(optarg);
exit(1);
}
break;
+ case 'C':
+ config_text= optarg;
+ break;
case 'd':
opts|= OPT_DEBUG;
break;