version 1.9, 2003/06/03 02:56:06 |
version 1.10, 2003/06/10 22:20:45 |
|
|
void yearly(int); |
void yearly(int); |
|
|
int |
int |
main(argc, argv) |
main(int argc, char *argv[]) |
int argc; |
|
char **argv; |
|
{ |
{ |
struct tm *local_time; |
struct tm *local_time; |
time_t now; |
time_t now; |
|
|
#define J_HEAD_SEP 2 |
#define J_HEAD_SEP 2 |
|
|
void |
void |
monthly(month, year) |
monthly(int month, int year) |
int month, year; |
|
{ |
{ |
int col, row, len, days[MAXDAYS]; |
int col, row, len, days[MAXDAYS]; |
char *p, lineout[30]; |
char *p, lineout[30]; |
|
|
} |
} |
|
|
void |
void |
j_yearly(year) |
j_yearly(int year) |
int year; |
|
{ |
{ |
int col, *dp, i, month, row, which_cal; |
int col, *dp, i, month, row, which_cal; |
int days[12][MAXDAYS]; |
int days[12][MAXDAYS]; |
|
|
} |
} |
|
|
void |
void |
yearly(year) |
yearly(int year) |
int year; |
|
{ |
{ |
int col, *dp, i, month, row, which_cal; |
int col, *dp, i, month, row, which_cal; |
int days[12][MAXDAYS]; |
int days[12][MAXDAYS]; |
|
|
* builds that array for any month from Jan. 1 through Dec. 9999. |
* builds that array for any month from Jan. 1 through Dec. 9999. |
*/ |
*/ |
void |
void |
day_array(month, year, days) |
day_array(int month, int year, int *days) |
int month, year; |
|
int *days; |
|
{ |
{ |
int day, dw, dm; |
int day, dw, dm; |
|
|
|
|
* return the 1 based day number within the year |
* return the 1 based day number within the year |
*/ |
*/ |
int |
int |
day_in_year(day, month, year) |
day_in_year(int day, int month, int year) |
int day, month, year; |
|
{ |
{ |
int i, leap; |
int i, leap; |
|
|
|
|
* missing days. |
* missing days. |
*/ |
*/ |
int |
int |
day_in_week(day, month, year) |
day_in_week(int day, int month, int year) |
int day, month, year; |
|
{ |
{ |
long temp; |
long temp; |
|
|
|
|
} |
} |
|
|
void |
void |
ascii_day(p, day) |
ascii_day(char *p, int day) |
char *p; |
|
int day; |
|
{ |
{ |
int display, val; |
int display, val; |
static char *aday[] = { |
static char *aday[] = { |
|
|
} |
} |
|
|
void |
void |
trim_trailing_spaces(s) |
trim_trailing_spaces(char *s) |
char *s; |
|
{ |
{ |
char *p; |
char *p; |
|
|
|
|
} |
} |
|
|
void |
void |
center(str, len, separate) |
center(char *str, int len, int separate) |
char *str; |
|
int len; |
|
int separate; |
|
{ |
{ |
|
|
len -= strlen(str); |
len -= strlen(str); |
|
|
} |
} |
|
|
void |
void |
usage() |
usage(void) |
{ |
{ |
|
|
(void)fprintf(stderr, "usage: cal [-jy] [[month] year]\n"); |
(void)fprintf(stderr, "usage: cal [-jy] [[month] year]\n"); |