Mercurial > bday
changeset 6:fc6e40f7bd5a
minor stuff
author | meillo@marmaro.de |
---|---|
date | Mon, 17 Dec 2007 16:31:40 +0100 |
parents | 5af6bf2cb271 |
children | b6f4c7fba64a |
files | bdengine.c birthday.c birthday.h |
diffstat | 3 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- 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;
--- 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; }
--- 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);