From c76699a9001901942a2e4a742406ba8696b58779 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 7 Sep 2006 16:23:35 +0000 Subject: cleanup --- Makefile | 4 +++- dddup.c | 2 ++ parse.c | 5 +++++ parse.h | 30 ------------------------------ request.c | 9 +++++---- 5 files changed, 15 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index 3729174..68d52ff 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ PROG= dddup SRCS= dddup.c parse.c ifaddr.c base64.c request.c connect.c NOMAN= -CFLAGS+= -W -Wall -pedantic # -ggdb +WARNINGS= yes +CDIAGFLAGS+= -W -Wall -Wpointer-arith \ + -Wstrict-prototypes -Wmissing-prototypes .include diff --git a/dddup.c b/dddup.c index 0d79c0b..b8ae453 100644 --- a/dddup.c +++ b/dddup.c @@ -25,6 +25,8 @@ int debug; int verbose; +__dead void usage(void); + __dead void usage(void) { diff --git a/parse.c b/parse.c index c9d997a..8378544 100644 --- a/parse.c +++ b/parse.c @@ -24,6 +24,11 @@ #include "base64.h" #include "ifaddr.h" +#define SYS_DYN 0x1 +#define SYS_STAT 0x2 +#define SYS_CUST 0x4 +#define SYS_ALL SYS_DYN|SYS_STAT|SYS_CUST + extern int debug; #if DEBUG diff --git a/parse.h b/parse.h index f8b55b7..6a6212a 100644 --- a/parse.h +++ b/parse.h @@ -20,36 +20,6 @@ #define _PATH_DDDUP "dddup.conf" -#define SYS_DYN 0x1 -#define SYS_STAT 0x2 -#define SYS_CUST 0x4 -#define SYS_ALL SYS_DYN|SYS_STAT|SYS_CUST - -#if 0 -static struct dd_conf { - const char *name; - char *value; - const int system; - const int range; - const int optional; -} conf[] = { - { "username", NULL, SYS_ALL, VAL_STR, OPT_NO }, - { "password", NULL, SYS_ALL, VAL_STR, OPT_NO }, -/* { "system", NULL, SYS_ALL, VAL_STR, OPT_YES }, */ - { "dyndns", NULL, SYS_DYN, VAL_NONE, OPT_YES }, - { "statdns", NULL, SYS_STAT, VAL_NONE, OPT_YES }, - { "custdns", NULL, SYS_CUST, VAL_NONE, OPT_YES }, - { "hostname", NULL, SYS_ALL, VAL_STR, OPT_NO }, - { "myip", NULL, SYS_ALL, VAL_STR, OPT_YES }, - { "intarface", NULL, SYS_ALL, VAL_STR, OPT_YES }, - { "wildcard", NULL, SYS_DYN|SYS_STAT, VAL_WC, OPT_YES }, - { "mx", NULL, SYS_DYN|SYS_STAT, VAL_STR, OPT_YES }, - { "backmx", NULL, SYS_DYN|SYS_STAT, VAL_YN, OPT_YES }, - { "offline", NULL, SYS_DYN|SYS_CUST, VAL_YN, OPT_YES }, - { NULL, NULL, 0, 0, 0 } -}; -#endif - __BEGIN_DECLS int parse_config(char *, struct dd_request **); int free_config(int, struct dd_request **); diff --git a/request.c b/request.c index 76ca763..64fa83b 100644 --- a/request.c +++ b/request.c @@ -44,12 +44,13 @@ build_request(struct dd_request *req, char *buf) if (req->wildcard != NULL) snprintf(buf + strlen(buf), BUFLEN - strlen(buf), "&wildcard=%s", req->wildcard); - if (req->mx != NULL) + if (req->mx != NULL) { snprintf(buf + strlen(buf), BUFLEN - strlen(buf), "&mx=%s", req->mx); - if (req->mx != NULL && req->backmx != NULL) - snprintf(buf + strlen(buf), BUFLEN - strlen(buf), - "&backmx=%s", req->backmx); + if (req->backmx != NULL) + snprintf(buf + strlen(buf), BUFLEN - strlen(buf), + "&backmx=%s", req->backmx); + } if (req->offline != NULL) snprintf(buf + strlen(buf), BUFLEN - strlen(buf), "&offline=%s", req->offline); -- cgit v1.2.3