ANSIfy function definitions.
Move some extern declarations to a header file. Remove an unneeded extern declaration for optarg.
This commit is contained in:
parent
bc7e443092
commit
e4cedda807
@ -67,9 +67,7 @@ int f_dayBefore = 0; /* days before current date */
|
||||
int Friday = 5; /* day before weekend */
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int ch;
|
||||
|
||||
@ -143,7 +141,7 @@ main(argc, argv)
|
||||
|
||||
|
||||
void
|
||||
usage()
|
||||
usage(void)
|
||||
{
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: calendar [-a] [-A days] [-B days] [-F friday] "
|
||||
|
@ -41,7 +41,8 @@ extern int doall;
|
||||
extern struct iovec header[];
|
||||
extern struct tm *tp;
|
||||
extern const char *calendarFile;
|
||||
extern char *optarg;
|
||||
extern int *cumdays;
|
||||
extern struct fixs neaster, npaskha;
|
||||
|
||||
void cal(void);
|
||||
void closecal(FILE *);
|
||||
|
@ -75,7 +75,8 @@ static struct fixs fnmonths[13]; /* full national months names */
|
||||
static struct fixs nmonths[13]; /* short national month names */
|
||||
|
||||
|
||||
void setnnames(void)
|
||||
void
|
||||
setnnames(void)
|
||||
{
|
||||
char buf[80];
|
||||
int i, l;
|
||||
@ -137,8 +138,7 @@ void setnnames(void)
|
||||
}
|
||||
|
||||
void
|
||||
settime(now)
|
||||
time_t now;
|
||||
settime(time_t now)
|
||||
{
|
||||
char *oldl, *lbufp;
|
||||
|
||||
@ -170,8 +170,8 @@ settime(now)
|
||||
/* convert Day[/Month][/Year] into unix time (since 1970)
|
||||
* Day: two digits, Month: two digits, Year: digits
|
||||
*/
|
||||
time_t Mktime (dp)
|
||||
char *dp;
|
||||
time_t
|
||||
Mktime (char *dp)
|
||||
{
|
||||
time_t t;
|
||||
int d, m, y;
|
||||
@ -216,11 +216,7 @@ time_t Mktime (dp)
|
||||
* along with the matched line.
|
||||
*/
|
||||
int
|
||||
isnow(endp, monthp, dayp, varp)
|
||||
char *endp;
|
||||
int *monthp;
|
||||
int *dayp;
|
||||
int *varp;
|
||||
isnow(char *endp, int *monthp, int *dayp, int *varp)
|
||||
{
|
||||
int day, flags, month = 0, v1, v2;
|
||||
|
||||
@ -397,8 +393,7 @@ isnow(endp, monthp, dayp, varp)
|
||||
|
||||
|
||||
int
|
||||
getmonth(s)
|
||||
char *s;
|
||||
getmonth(char *s)
|
||||
{
|
||||
const char **p;
|
||||
struct fixs *n;
|
||||
@ -417,8 +412,7 @@ getmonth(s)
|
||||
|
||||
|
||||
int
|
||||
getday(s)
|
||||
char *s;
|
||||
getday(char *s)
|
||||
{
|
||||
const char **p;
|
||||
struct fixs *n;
|
||||
@ -441,8 +435,7 @@ getday(s)
|
||||
* ... etc ...
|
||||
*/
|
||||
int
|
||||
getdayvar(s)
|
||||
char *s;
|
||||
getdayvar(char *s)
|
||||
{
|
||||
int offs;
|
||||
|
||||
|
@ -85,7 +85,7 @@ struct iovec header[] = {
|
||||
|
||||
|
||||
void
|
||||
cal()
|
||||
cal(void)
|
||||
{
|
||||
int printing;
|
||||
char *p;
|
||||
@ -166,9 +166,7 @@ cal()
|
||||
}
|
||||
|
||||
int
|
||||
getfield(p, endp, flags)
|
||||
char *p, **endp;
|
||||
int *flags;
|
||||
getfield(char *p, char **endp, int *flags)
|
||||
{
|
||||
int val, var;
|
||||
char *start, savech;
|
||||
@ -233,7 +231,7 @@ getfield(p, endp, flags)
|
||||
char path[MAXPATHLEN];
|
||||
|
||||
FILE *
|
||||
opencal()
|
||||
opencal(void)
|
||||
{
|
||||
uid_t uid;
|
||||
size_t i;
|
||||
@ -312,8 +310,7 @@ opencal()
|
||||
}
|
||||
|
||||
void
|
||||
closecal(fp)
|
||||
FILE *fp;
|
||||
closecal(FILE *fp)
|
||||
{
|
||||
uid_t uid;
|
||||
struct stat sbuf;
|
||||
|
@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$");
|
||||
* Astronomical Almanac".
|
||||
*/
|
||||
|
||||
int easter (year)
|
||||
int year; /* 0 ... abcd, NOT since 1900 */
|
||||
int
|
||||
easter(int year) /* 0 ... abcd, NOT since 1900 */
|
||||
{
|
||||
int G, /* Golden number - 1 */
|
||||
C, /* Century */
|
||||
@ -73,12 +73,9 @@ int easter (year)
|
||||
*/
|
||||
|
||||
int
|
||||
geteaster(s, year)
|
||||
char *s;
|
||||
int year;
|
||||
geteaster(char *s, int year)
|
||||
{
|
||||
int offset = 0;
|
||||
extern struct fixs neaster;
|
||||
|
||||
#define EASTER "easter"
|
||||
#define EASTERNAMELEN (sizeof(EASTER) - 1)
|
||||
|
@ -43,13 +43,11 @@ static int paskha (int);
|
||||
/* (old style result) */
|
||||
|
||||
static int
|
||||
paskha (R)
|
||||
int R; /*year*/
|
||||
paskha(int R) /*year*/
|
||||
{
|
||||
int a, b, c, d, e;
|
||||
static int x = 15;
|
||||
static int y = 6;
|
||||
extern int *cumdays;
|
||||
|
||||
a = R % 19;
|
||||
b = R % 4;
|
||||
@ -62,12 +60,9 @@ int R; /*year*/
|
||||
/* return year day for Orthodox Easter depending days */
|
||||
|
||||
int
|
||||
getpaskha(s, year)
|
||||
char *s;
|
||||
int year;
|
||||
getpaskha(char *s, int year)
|
||||
{
|
||||
int offset;
|
||||
extern struct fixs npaskha;
|
||||
|
||||
if (strncasecmp(s, PASKHA, PASKHALEN) == 0)
|
||||
s += PASKHALEN;
|
||||
|
Loading…
x
Reference in New Issue
Block a user