# HG changeset patch # User meillo@marmaro.de # Date 1197905500 -3600 # Node ID fc6e40f7bd5afe6808a8f9a421f99e057ade67e9 # Parent 5af6bf2cb2716afee0482bd37e66dcd969eb06b9 minor stuff diff -r 5af6bf2cb271 -r fc6e40f7bd5a bdengine.c --- a/bdengine.c Mon Dec 17 15:09:03 2007 +0100 +++ b/bdengine.c Mon Dec 17 16:31:40 2007 +0100 @@ -118,7 +118,6 @@ const unsigned MLENDAT[]={31,-1,31,30,31,30,31,31,30,31,30,31}; const struct _ftable FTABLE[] = { - {"bir",F_TBIRTHDAY}, {"bd", F_TBIRTHDAY}, {"ann",F_TANNIVERSARY}, {"ev", F_TEVENT}, @@ -258,7 +257,7 @@ /* lists the birthdays in their string format, one by one, and passes the string to a function. */ -void liststrings(struct event *evl, prnfunc outf) { +void liststrings(struct event* evl, prnfunc outf) { int i,j; char *buf, *tmp; int size; @@ -450,6 +449,11 @@ + + + + + struct event* readlist() { int i, j, k, l, d; struct event *evl; diff -r 5af6bf2cb271 -r fc6e40f7bd5a birthday.c --- a/birthday.c Mon Dec 17 15:09:03 2007 +0100 +++ b/birthday.c Mon Dec 17 16:31:40 2007 +0100 @@ -32,12 +32,11 @@ #include "birthday.h" -int main(int argc, char* argv[]) -{ - struct event *evl; /* evl => event list */ +int main(int argc, char* argv[]) { while (--argc > 0 && (*++argv)[0] == '-') { if (strcmp(argv[0], "-W") == 0) { + /* TODO: catch if no value given */ iDWarn = atoi((++argv)[0]); argc--; } else { @@ -46,8 +45,7 @@ } } - evl = readlist(); /* read and format entries */ - liststrings(evl, puts); + liststrings(readlist(), puts); return 0; } diff -r 5af6bf2cb271 -r fc6e40f7bd5a birthday.h --- a/birthday.h Mon Dec 17 15:09:03 2007 +0100 +++ b/birthday.h Mon Dec 17 16:31:40 2007 +0100 @@ -32,8 +32,6 @@ /* standard time to warn in advance, when no explicit w flag is given. */ #define DEF_WARN 14 - - /* ========== Global constants and data types */ @@ -83,7 +81,7 @@ void gettoday(void); unsigned delta(struct date *); unsigned ddiff(struct date *D1, struct date *D2); -void liststrings(struct event *evl, prnfunc outf); +void liststrings(struct event* evl, prnfunc outf); char *tdelta(struct date *d); char *ttime(int yr, int mn, int wk, int dy);