From 12b4602e860e198949384549116ff0ef444e2665 Mon Sep 17 00:00:00 2001 From: edwin Date: Tue, 5 Aug 2008 08:16:37 +0000 Subject: [PATCH] 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) --- usr.bin/calendar/calendar.c | 4 +++- usr.bin/calendar/calendar.h | 19 ------------------- 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 afd543ce2d9c..d1bb74516d98 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 c9c37cef0bd8..ff67ca6289f5 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 d83be770405a..92df7be2582d 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;