diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-05-23 18:15:36 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-05-23 18:15:36 +0000 |
commit | f5bb91dc606f920f143538c5de4635aa9cbb190a (patch) | |
tree | 8b740edb010b43c910d25231ff080c37c8b1b10e | |
parent | 5d909520548ad3b175fa568554affcca96f294e1 (diff) | |
download | fetchmail-f5bb91dc606f920f143538c5de4635aa9cbb190a.tar.gz fetchmail-f5bb91dc606f920f143538c5de4635aa9cbb190a.tar.bz2 fetchmail-f5bb91dc606f920f143538c5de4635aa9cbb190a.zip |
Added configuration dumper.
svn path=/trunk/; revision=1809
-rw-r--r-- | Makefile.in | 4 | ||||
-rw-r--r-- | fetchmail.c | 10 | ||||
-rw-r--r-- | fetchmail.h | 3 | ||||
-rw-r--r-- | options.c | 8 |
4 files changed, 14 insertions, 11 deletions
diff --git a/Makefile.in b/Makefile.in index 47080d98..ab286531 100644 --- a/Makefile.in +++ b/Makefile.in @@ -83,7 +83,7 @@ CTAGS = ctags protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \ etrn.o fetchmail.o env.o options.o daemon.o driver.o rfc822.o smtp.o \ xmalloc.o uid.o mxget.o md5c.o md5ify.o rpa.o interface.o netrc.o \ - base64.o error.o unmime.o + base64.o error.o unmime.o conf.o objs = $(protobjs) $(extras) $(EXTRAOBJ) @@ -95,7 +95,7 @@ srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \ $(srcdir)/xmalloc.c $(srcdir)/uid.c $(srcdir)/mxget.c \ $(srcdir)/md5c.c $(srcdir)/md5ify.c $(srcdir)/rpa.c \ $(srcdir)/interface.c $(srcdir)/netrc.c $(srcdir)/base64.c \ - $(srcdir)/error.c $(srcdir)/unmime.c + $(srcdir)/error.c $(srcdir)/unmime.c $(srcdir)/conf.c .SUFFIXES: .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi diff --git a/fetchmail.c b/fetchmail.c index 9b5aa112..368a02b2 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -67,7 +67,7 @@ char *user; /* the name of the invoking user */ char *home; /* invoking user's home directory */ char *fetchmailhost; /* the name of the host running fetchmail */ char *program_name; /* the name to prefix error messages with */ -flag pythondump; /* dump control blocks as Python dictionary */ +flag configdump; /* dump control blocks for configurator */ #if NET_SECURITY void *request = NULL; @@ -217,9 +217,9 @@ int main (int argc, char **argv) } /* dump options as a Python dictionary, for configurator use */ - if (pythondump) + if (configdump) { - /* this feature is not yet implemented */ + dump_config(&run, querylist); exit(0); } @@ -730,7 +730,9 @@ static int load_params(int argc, char **argv, int optind) ctl->active = TRUE; } - /* if there's a defaults record, merge it and lose it */ + /* + * If there's a defaults record, merge it and lose it. + */ if (querylist && strcmp(querylist->server.pollname, "defaults") == 0) { for (ctl = querylist->next; ctl; ctl = ctl->next) diff --git a/fetchmail.h b/fetchmail.h index 0c74fec7..e4792fb1 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -275,7 +275,7 @@ extern char *user; /* name of invoking user */ extern char *home; /* home directory of invoking user */ extern char *fetchmailhost; /* the name of the host running fetchmail */ extern int pass; /* number of re-polling pass */ -extern flag pythondump; /* dump control blocks as Python dictionary */ +extern flag configdump; /* dump control blocks as Python dictionary */ /* prototypes for globally callable functions */ @@ -378,6 +378,7 @@ char *getpassword(char *); void escapes(const char *, char *); char *visbuf(const char *); char *showproto(int); +void dump_config(struct runctl *runp, struct query *querylist); void yyerror(const char *); int yylex(void); @@ -54,7 +54,7 @@ #define LA_NETSEC 36 #define LA_INTERFACE 37 #define LA_MONITOR 38 -#define LA_PYTHONDUMP 39 +#define LA_CONFIGDUMP 39 #define LA_YYDEBUG 40 /* options still left: CgGhHjJoORUwWxXYz */ @@ -115,7 +115,7 @@ static const struct option longoptions[] = { {"monitor", required_argument, (int *) 0, LA_MONITOR }, #endif /* defined(linux) && !INET6 */ - {"pythondump",no_argument, (int *) 0, LA_PYTHONDUMP }, + {"configdump",no_argument, (int *) 0, LA_CONFIGDUMP }, {"yydebug", no_argument, (int *) 0, LA_YYDEBUG }, @@ -385,8 +385,8 @@ struct query *ctl; /* option record to be initialized */ yydebug = TRUE; break; - case LA_PYTHONDUMP: - pythondump = TRUE; + case LA_CONFIGDUMP: + configdump = TRUE; break; case LA_SYSLOG: |