ncal.c (32310) | ncal.c (32525) |
---|---|
1/*- 2 * Copyright (c) 1997 Wolfgang Helbig 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#ifndef lint 28static const char rcsid[] = | 1/*- 2 * Copyright (c) 1997 Wolfgang Helbig 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#ifndef lint 28static const char rcsid[] = |
29 "$Id$"; | 29 "$Id: ncal.c,v 1.5 1998/01/07 07:46:33 charnier Exp $"; |
30#endif /* not lint */ 31 32#include <calendar.h> 33#include <err.h> 34#include <locale.h> 35#include <stdio.h> 36#include <stdlib.h> 37#include <string.h> --- 297 unchanged lines hidden (view full) --- 335 return (0); 336} 337 338static void 339usage(void) 340{ 341 342 fprintf(stderr, "%s\n%s\n%s\n", | 30#endif /* not lint */ 31 32#include <calendar.h> 33#include <err.h> 34#include <locale.h> 35#include <stdio.h> 36#include <stdlib.h> 37#include <string.h> --- 297 unchanged lines hidden (view full) --- 335 return (0); 336} 337 338static void 339usage(void) 340{ 341 342 fprintf(stderr, "%s\n%s\n%s\n", |
343 "usage: cal [-jy] [month[year]]", | 343 "usage: cal [-jy] [[month] year]", |
344 " ncal [-Jjpwy] [-s country_code] [[month] year]", 345 " ncal [-Jeo] [year]"); 346 exit(EX_USAGE); 347} 348 349/* print the assumed switches for all countries */ 350void 351printcc(void) --- 238 unchanged lines hidden (view full) --- 590 */ 591 first = firstday(y, m + 1); 592 if (m == 11) 593 last = firstday(y + 1, 1); 594 else 595 last = firstday(y, m + 2); 596 597 if (jd_flag) | 344 " ncal [-Jjpwy] [-s country_code] [[month] year]", 345 " ncal [-Jeo] [year]"); 346 exit(EX_USAGE); 347} 348 349/* print the assumed switches for all countries */ 350void 351printcc(void) --- 238 unchanged lines hidden (view full) --- 590 */ 591 first = firstday(y, m + 1); 592 if (m == 11) 593 last = firstday(y + 1, 1); 594 else 595 last = firstday(y, m + 2); 596 597 if (jd_flag) |
598 jan1 = firstday(m, 1); | 598 jan1 = firstday(y, 1); |
599 600 /* 601 * Set firstm to the day number of monday of the first week of 602 * this month. (This might be in the last month) 603 */ 604 firstm = first - weekday(first); 605 606 /* Set ds (daystring) and dw (daywidth) according to the jd_flag */ --- 226 unchanged lines hidden --- | 599 600 /* 601 * Set firstm to the day number of monday of the first week of 602 * this month. (This might be in the last month) 603 */ 604 firstm = first - weekday(first); 605 606 /* Set ds (daystring) and dw (daywidth) according to the jd_flag */ --- 226 unchanged lines hidden --- |