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 diff
     1.1 --- a/bdengine.c	Mon Dec 17 15:09:03 2007 +0100
     1.2 +++ b/bdengine.c	Mon Dec 17 16:31:40 2007 +0100
     1.3 @@ -118,7 +118,6 @@
     1.4  const unsigned MLENDAT[]={31,-1,31,30,31,30,31,31,30,31,30,31};
     1.5  
     1.6  const struct _ftable FTABLE[] = {
     1.7 -	{"bir",F_TBIRTHDAY},
     1.8  	{"bd", F_TBIRTHDAY},
     1.9  	{"ann",F_TANNIVERSARY},
    1.10  	{"ev", F_TEVENT},
    1.11 @@ -258,7 +257,7 @@
    1.12  
    1.13  
    1.14  /* lists the birthdays in their string format, one by one, and passes the string to a function. */
    1.15 -void liststrings(struct event *evl, prnfunc outf) {
    1.16 +void liststrings(struct event* evl, prnfunc outf) {
    1.17  	int i,j;
    1.18  	char *buf, *tmp;
    1.19  	int size;
    1.20 @@ -450,6 +449,11 @@
    1.21  
    1.22  
    1.23  
    1.24 +
    1.25 +
    1.26 +
    1.27 +
    1.28 +
    1.29  struct event* readlist() {
    1.30  	int i, j, k, l, d;
    1.31  	struct event *evl;
     2.1 --- a/birthday.c	Mon Dec 17 15:09:03 2007 +0100
     2.2 +++ b/birthday.c	Mon Dec 17 16:31:40 2007 +0100
     2.3 @@ -32,12 +32,11 @@
     2.4  #include "birthday.h"
     2.5  
     2.6  
     2.7 -int main(int argc, char* argv[])
     2.8 -{
     2.9 -  struct event *evl; /* evl => event list */
    2.10 +int main(int argc, char* argv[]) {
    2.11  
    2.12    while (--argc > 0 && (*++argv)[0] == '-') {
    2.13  		if (strcmp(argv[0], "-W") == 0) {
    2.14 +			/* TODO: catch if no value given */
    2.15  			iDWarn = atoi((++argv)[0]);
    2.16  			argc--;
    2.17  		} else {
    2.18 @@ -46,8 +45,7 @@
    2.19  		}
    2.20  	}
    2.21  
    2.22 -  evl = readlist(); /* read and format entries */
    2.23 -	liststrings(evl, puts);
    2.24 +	liststrings(readlist(), puts);
    2.25  
    2.26    return 0;
    2.27  }
     3.1 --- a/birthday.h	Mon Dec 17 15:09:03 2007 +0100
     3.2 +++ b/birthday.h	Mon Dec 17 16:31:40 2007 +0100
     3.3 @@ -32,8 +32,6 @@
     3.4  /* standard time to warn in advance, when no explicit w flag is given. */
     3.5  #define DEF_WARN 14
     3.6  
     3.7 -
     3.8 -
     3.9  /* ========== Global constants and data types */
    3.10  
    3.11  
    3.12 @@ -83,7 +81,7 @@
    3.13  void gettoday(void);
    3.14  unsigned delta(struct date *);
    3.15  unsigned ddiff(struct date *D1, struct date *D2);
    3.16 -void liststrings(struct event *evl, prnfunc outf);
    3.17 +void liststrings(struct event* evl, prnfunc outf);
    3.18  char *tdelta(struct date *d);
    3.19  char *ttime(int yr, int mn, int wk, int dy);
    3.20