diff options
author | edwin <edwin@FreeBSD.org> | 2008-08-05 08:16:37 +0000 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2008-08-05 08:16:37 +0000 |
commit | 12b4602e860e198949384549116ff0ef444e2665 (patch) | |
tree | e1b62882dde00b916d883dc08e04552e655edb50 /usr.bin/calendar | |
parent | 8a75d14908eac0b506537bc0476a339cb9b13f7d (diff) | |
download | FreeBSD-src-12b4602e860e198949384549116ff0ef444e2665.zip FreeBSD-src-12b4602e860e198949384549116ff0ef444e2665.tar.gz |
Move functions which are only locally used into their C files and
make them static.
usage() in calendar.c
event_*() in io.c
PR: bin/118644
Approved by: bde@ (mentor)
Diffstat (limited to 'usr.bin/calendar')
-rw-r--r-- | usr.bin/calendar/calendar.c | 4 | ||||
-rw-r--r-- | usr.bin/calendar/calendar.h | 19 | ||||
-rw-r--r-- | usr.bin/calendar/io.c | 23 |
3 files changed, 23 insertions, 23 deletions
diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c index afd543c..d1bb745 100644 --- a/usr.bin/calendar/calendar.c +++ b/usr.bin/calendar/calendar.c @@ -66,6 +66,8 @@ int f_dayAfter = 0; /* days after current date */ int f_dayBefore = 0; /* days before current date */ int Friday = 5; /* day before weekend */ +static void usage(void) __dead2; + int main(int argc, char *argv[]) { @@ -140,7 +142,7 @@ main(int argc, char *argv[]) } -void +static void __dead2 usage(void) { diff --git a/usr.bin/calendar/calendar.h b/usr.bin/calendar/calendar.h index c9c37ce..ff67ca6 100644 --- a/usr.bin/calendar/calendar.h +++ b/usr.bin/calendar/calendar.h @@ -58,7 +58,6 @@ int isnow(char *, int *, int *, int *); FILE *opencal(void); void settime(time_t); time_t Mktime(char *); -void usage(void); void setnnames(void); #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) @@ -73,24 +72,6 @@ extern int f_dayAfter; /* days after current date */ extern int f_dayBefore; /* days before current date */ extern int Friday; /* day before weekend */ -/* - * Event sorting related functions: - * - Use event_add() to create a new event - * - Use event_continue() to add more text to the last added event - * - Use event_print_all() to display them in time chronological order - */ -struct event *event_add(struct event *, int, int, char *, int, char *); -void event_continue(struct event *events, char *txt); -void event_print_all(FILE *fp, struct event *events); -struct event { - int month; - int day; - int var; - char *date; - char *text; - struct event *next; -}; - struct fixs { char *name; int len; diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index d83be77..92df7be 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -66,6 +66,23 @@ __FBSDID("$FreeBSD$"); #include "pathnames.h" #include "calendar.h" +/* + * Event sorting related functions: + * - Use event_add() to create a new event + * - Use event_continue() to add more text to the last added event + * - Use event_print_all() to display them in time chronological order + */ +static struct event *event_add(struct event *, int, int, char *, int, char *); +static void event_continue(struct event *events, char *txt); +static void event_print_all(FILE *fp, struct event *events); +struct event { + int month; + int day; + int var; + char *date; + char *text; + struct event *next; +}; const char *calendarFile = "calendar"; /* default calendar file */ const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ @@ -170,7 +187,7 @@ cal(void) closecal(fp); } -struct event * +static struct event * event_add(struct event *events, int month, int day, char *date, int var, char *txt) { @@ -200,7 +217,7 @@ event_add(struct event *events, int month, int day, return e; } -void +static void event_continue(struct event *e, char *txt) { char *text; @@ -228,7 +245,7 @@ event_continue(struct event *e, char *txt) return; } -void +static void event_print_all(FILE *fp, struct event *events) { struct event *e, *e_next; |