summaryrefslogtreecommitdiffstats
path: root/usr.bin/calendar/calendar.c
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2008-08-05 08:11:54 +0000
committeredwin <edwin@FreeBSD.org>2008-08-05 08:11:54 +0000
commit8a75d14908eac0b506537bc0476a339cb9b13f7d (patch)
tree207ef0ba038d902b3008c892f508249448bae268 /usr.bin/calendar/calendar.c
parent484fc19a89996c8f1e57aa48768f139ab220c5b6 (diff)
downloadFreeBSD-src-8a75d14908eac0b506537bc0476a339cb9b13f7d.zip
FreeBSD-src-8a75d14908eac0b506537bc0476a339cb9b13f7d.tar.gz
style(9)ify usr.bin/calendar
PR: bin/118644 Approved by: bde@ (mentor) MFC after: 1 week
Diffstat (limited to 'usr.bin/calendar/calendar.c')
-rw-r--r--usr.bin/calendar/calendar.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c
index 5a0eefc..afd543c 100644
--- a/usr.bin/calendar/calendar.c
+++ b/usr.bin/calendar/calendar.c
@@ -58,22 +58,22 @@ __FBSDID("$FreeBSD$");
#include "pathnames.h"
#include "calendar.h"
-struct passwd *pw;
-int doall = 0;
-time_t f_time = 0;
+struct passwd *pw;
+int doall = 0;
+time_t f_time = 0;
-int f_dayAfter = 0; /* days after current date */
-int f_dayBefore = 0; /* days before current date */
-int Friday = 5; /* day before weekend */
+int f_dayAfter = 0; /* days after current date */
+int f_dayBefore = 0; /* days before current date */
+int Friday = 5; /* day before weekend */
int
main(int argc, char *argv[])
{
int ch;
- (void) setlocale(LC_ALL, "");
+ (void)setlocale(LC_ALL, "");
- while ((ch = getopt(argc, argv, "-af:t:A:B:F:W:")) != -1)
+ while ((ch = getopt(argc, argv, "-A:aB:F:f:t:W:")) != -1)
switch (ch) {
case '-': /* backward contemptible */
case 'a':
@@ -84,25 +84,24 @@ main(int argc, char *argv[])
doall = 1;
break;
-
case 'f': /* other calendar file */
- calendarFile = optarg;
+ calendarFile = optarg;
break;
case 't': /* other date, undocumented, for tests */
- f_time = Mktime (optarg);
+ f_time = Mktime(optarg);
break;
case 'W': /* we don't need no steenking Fridays */
Friday = -1;
- /* FALLTHROUGH */
+ /* FALLTHROUGH */
case 'A': /* days after current date */
f_dayAfter = atoi(optarg);
break;
case 'B': /* days before current date */
- f_dayBefore = atoi(optarg);
+ f_dayBefore = atoi(optarg);
break;
case 'F':
@@ -113,6 +112,7 @@ main(int argc, char *argv[])
default:
usage();
}
+
argc -= optind;
argv += optind;
@@ -120,11 +120,11 @@ main(int argc, char *argv[])
usage();
/* use current time */
- if (f_time <= 0)
- (void)time(&f_time);
+ if (f_time <= 0)
+ (void)time(&f_time);
settime(f_time);
-
+
if (doall)
while ((pw = getpwent()) != NULL) {
(void)setegid(pw->pw_gid);
@@ -143,11 +143,10 @@ main(int argc, char *argv[])
void
usage(void)
{
- (void)fprintf(stderr, "%s\n%s\n",
+
+ fprintf(stderr, "%s\n%s\n",
"usage: calendar [-a] [-A days] [-B days] [-F friday] "
"[-f calendarfile]",
" [-t dd[.mm[.year]]] [-W days]");
exit(1);
}
-
-
OpenPOWER on IntegriCloud