bday

view birthday.c @ 4:5326c222cd4e

removed MESSAGE; code beautifing workaround for MESSAGE: use an event with warn 0 (message=yyyy-mm-dd w 0)
author meillo@marmaro.de
date Mon, 17 Dec 2007 12:14:41 +0100
parents 22b6e71de68e
children 5af6bf2cb271
line source
1 /*
2 birthday
4 Birthday/Anniversary display on login
6 (c) 1996 AS Mortimer
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version. You may also
12 distribute it under the Artistic License, as comes with Perl.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 You should also have recieved a copy of the Artistic license with
23 this program.
25 $Id: birthday.c,v 1.5 1999/04/25 14:01:29 andy Exp $
26 */
28 #include <string.h>
29 #include <stdio.h>
30 #include <stdlib.h>
32 #include "birthday.h"
35 int main(int argc, char* argv[])
36 {
37 char* fname = NULL;
38 struct event *evl; /* evl => event list */
40 while (--argc > 0 && (*++argv)[0] == '-') {
41 if (strcmp(argv[0], "-f") == 0) {
42 fname = strdup((++argv)[0]);
43 argc--;
44 } else if (strcmp(argv[0], "-W") == 0) {
45 iDWarn = atoi((++argv)[0]);
46 argc--;
47 } else {
48 fprintf(stderr, "unknown option %s\n", argv[0]);
49 exit(1);
50 }
51 }
53 evl = readlist(fname); /* read and format entries */
55 liststrings(evl, puts);
57 return 0;
58 }