summaryrefslogtreecommitdiffstats
path: root/usr.bin/calendar/io.c
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2008-08-05 08:16:37 +0000
committeredwin <edwin@FreeBSD.org>2008-08-05 08:16:37 +0000
commit12b4602e860e198949384549116ff0ef444e2665 (patch)
treee1b62882dde00b916d883dc08e04552e655edb50 /usr.bin/calendar/io.c
parent8a75d14908eac0b506537bc0476a339cb9b13f7d (diff)
downloadFreeBSD-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/io.c')
-rw-r--r--usr.bin/calendar/io.c23
1 files changed, 20 insertions, 3 deletions
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;
OpenPOWER on IntegriCloud