calendar.c (13840) | calendar.c (15714) |
---|---|
1/* 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. 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 --- 18 unchanged lines hidden (view full) --- 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint | 1/* 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. 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 --- 18 unchanged lines hidden (view full) --- 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint |
35static char copyright[] = | 35static const char copyright[] = |
36"@(#) Copyright (c) 1989, 1993\n\ 37 The Regents of the University of California. All rights reserved.\n"; 38#endif /* not lint */ 39 40#ifndef lint | 36"@(#) Copyright (c) 1989, 1993\n\ 37 The Regents of the University of California. All rights reserved.\n"; 38#endif /* not lint */ 39 40#ifndef lint |
41static char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94"; | 41static const char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94"; |
42#endif /* not lint */ 43 | 42#endif /* not lint */ 43 |
44#include <err.h> 45#include <errno.h> 46#include <locale.h> |
|
44#include <pwd.h> 45#include <stdio.h> | 47#include <pwd.h> 48#include <stdio.h> |
46#include <unistd.h> 47#include <errno.h> 48#include <err.h> | |
49#include <stdlib.h> 50#include <time.h> | 49#include <stdlib.h> 50#include <time.h> |
51#include <unistd.h> |
|
51 52#include "pathnames.h" 53#include "calendar.h" 54 55struct passwd *pw; 56int doall = 0; 57time_t f_time = 0; 58 59int f_dayAfter = 0; /* days after current date */ 60int f_dayBefore = 0; /* days before current date */ 61 62int 63main(argc, argv) 64 int argc; 65 char *argv[]; 66{ 67 extern int optind; 68 int ch; 69 | 52 53#include "pathnames.h" 54#include "calendar.h" 55 56struct passwd *pw; 57int doall = 0; 58time_t f_time = 0; 59 60int f_dayAfter = 0; /* days after current date */ 61int f_dayBefore = 0; /* days before current date */ 62 63int 64main(argc, argv) 65 int argc; 66 char *argv[]; 67{ 68 extern int optind; 69 int ch; 70 |
71 (void) setlocale(LC_ALL, ""); 72 |
|
70 while ((ch = getopt(argc, argv, "?-af:t:A:B:")) != EOF) 71 switch (ch) { 72 case '-': /* backward contemptible */ 73 case 'a': 74 if (getuid()) { 75 errno = EPERM; 76 err(1, NULL); 77 } --- 59 unchanged lines hidden --- | 73 while ((ch = getopt(argc, argv, "?-af:t:A:B:")) != EOF) 74 switch (ch) { 75 case '-': /* backward contemptible */ 76 case 'a': 77 if (getuid()) { 78 errno = EPERM; 79 err(1, NULL); 80 } --- 59 unchanged lines hidden --- |