annotate birthday.c @ 5:5af6bf2cb271

reads only stdin now, no files anymore; removed -f option aswell; code beatifing
author meillo@marmaro.de
date Mon, 17 Dec 2007 15:09:03 +0100
parents dc2f94280b01
children fc6e40f7bd5a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
1 /*
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
2 birthday
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
3
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
4 Birthday/Anniversary display on login
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
5
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
6 (c) 1996 AS Mortimer
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
7
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
8 This program is free software; you can redistribute it and/or
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
9 modify it under the terms of the GNU General Public License as
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
10 published by the Free Software Foundation; either version 2 of the
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
11 License, or (at your option) any later version. You may also
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
12 distribute it under the Artistic License, as comes with Perl.
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
13
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
14 This program is distributed in the hope that it will be useful,
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
17
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
19 along with this program; if not, write to the Free Software
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
21
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
22 You should also have recieved a copy of the Artistic license with
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
23 this program.
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
24
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
25 $Id: birthday.c,v 1.5 1999/04/25 14:01:29 andy Exp $
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
26 */
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
27
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
28 #include <string.h>
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
29 #include <stdio.h>
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
30 #include <stdlib.h>
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
31
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
32 #include "birthday.h"
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
33
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
34
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
35 int main(int argc, char* argv[])
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
36 {
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
37 struct event *evl; /* evl => event list */
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
38
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
39 while (--argc > 0 && (*++argv)[0] == '-') {
5
5af6bf2cb271 reads only stdin now, no files anymore; removed -f option aswell; code beatifing
meillo@marmaro.de
parents: 3
diff changeset
40 if (strcmp(argv[0], "-W") == 0) {
0
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
41 iDWarn = atoi((++argv)[0]);
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
42 argc--;
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
43 } else {
3
dc2f94280b01 new Makefile; removed MinWarn and MaxWarn; adjusted manpage
meillo@marmaro.de
parents: 0
diff changeset
44 fprintf(stderr, "unknown option %s\n", argv[0]);
0
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
45 exit(1);
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
46 }
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
47 }
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
48
5
5af6bf2cb271 reads only stdin now, no files anymore; removed -f option aswell; code beatifing
meillo@marmaro.de
parents: 3
diff changeset
49 evl = readlist(); /* read and format entries */
0
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
50 liststrings(evl, puts);
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
51
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
52 return 0;
22b6e71de68e initial commit; codebase from birthday; just the needed stuff; substituted getopt by own code
meillo@marmaro.de
parents:
diff changeset
53 }