Un-__P and ANSIfy.
This commit is contained in:
parent
ad8aa5a492
commit
9ff98d4d50
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: at.c,v 1.16 2000/10/04 19:14:53 mjl Exp $ */
|
||||
/* $NetBSD: at.c,v 1.17 2000/10/04 19:24:59 mjl Exp $ */
|
||||
|
||||
/*
|
||||
* at.c : Put file into atrun queue
|
||||
@ -70,7 +70,7 @@ enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */
|
||||
#if 0
|
||||
static char rcsid[] = "$OpenBSD: at.c,v 1.15 1998/06/03 16:20:26 deraadt Exp $";
|
||||
#else
|
||||
__RCSID("$NetBSD: at.c,v 1.16 2000/10/04 19:14:53 mjl Exp $");
|
||||
__RCSID("$NetBSD: at.c,v 1.17 2000/10/04 19:24:59 mjl Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -93,22 +93,19 @@ char atverify = 0; /* verify time instead of queuing job */
|
||||
|
||||
/* Function declarations */
|
||||
|
||||
static void sigc __P((int));
|
||||
static void alarmc __P((int));
|
||||
static char *cwdname __P((void));
|
||||
static int nextjob __P((void));
|
||||
static void writefile __P((time_t, char));
|
||||
static void list_jobs __P((void));
|
||||
static void process_jobs __P((int, char **, int));
|
||||
|
||||
int main __P((int, char **));
|
||||
static void sigc (int);
|
||||
static void alarmc (int);
|
||||
static char *cwdname (void);
|
||||
static int nextjob (void);
|
||||
static void writefile (time_t, char);
|
||||
static void list_jobs (void);
|
||||
static void process_jobs (int, char **, int);
|
||||
|
||||
/* Signal catching functions */
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
sigc(signo)
|
||||
int signo;
|
||||
sigc(int signo)
|
||||
{
|
||||
/* If the user presses ^C, remove the spool file and exit. */
|
||||
if (fcreated) {
|
||||
@ -122,8 +119,7 @@ sigc(signo)
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
alarmc(signo)
|
||||
int signo;
|
||||
alarmc(int signo)
|
||||
{
|
||||
/* Time out after some seconds. */
|
||||
panic("File locking timed out");
|
||||
@ -132,7 +128,7 @@ alarmc(signo)
|
||||
/* Local functions */
|
||||
|
||||
static char *
|
||||
cwdname()
|
||||
cwdname(void)
|
||||
{
|
||||
/*
|
||||
* Read in the current directory; the name will be overwritten on
|
||||
@ -144,7 +140,7 @@ cwdname()
|
||||
}
|
||||
|
||||
static int
|
||||
nextjob()
|
||||
nextjob(void)
|
||||
{
|
||||
int jobno;
|
||||
FILE *fid;
|
||||
@ -167,9 +163,7 @@ nextjob()
|
||||
}
|
||||
|
||||
static void
|
||||
writefile(runtimer, queue)
|
||||
time_t runtimer;
|
||||
char queue;
|
||||
writefile(time_t runtimer, char queue)
|
||||
{
|
||||
/*
|
||||
* This does most of the work if at or batch are invoked for
|
||||
@ -414,7 +408,7 @@ writefile(runtimer, queue)
|
||||
}
|
||||
|
||||
static void
|
||||
list_jobs()
|
||||
list_jobs(void)
|
||||
{
|
||||
/*
|
||||
* List all a user's jobs in the queue, by looping through
|
||||
@ -484,10 +478,7 @@ list_jobs()
|
||||
}
|
||||
|
||||
static void
|
||||
process_jobs(argc, argv, what)
|
||||
int argc;
|
||||
char **argv;
|
||||
int what;
|
||||
process_jobs(int argc, char **argv, int what)
|
||||
{
|
||||
/* Delete every argument (job - ID) given */
|
||||
int i;
|
||||
@ -567,9 +558,7 @@ process_jobs(argc, argv, what)
|
||||
/* Global functions */
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
char queue = DEFAULT_AT_QUEUE;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: panic.c,v 1.7 2000/10/04 19:14:53 mjl Exp $ */
|
||||
/* $NetBSD: panic.c,v 1.8 2000/10/04 19:24:59 mjl Exp $ */
|
||||
|
||||
/*
|
||||
* panic.c - terminate fast in case of error
|
||||
@ -45,7 +45,7 @@
|
||||
#if 0
|
||||
static char rcsid[] = "$OpenBSD: panic.c,v 1.4 1997/03/01 23:40:09 millert Exp $";
|
||||
#else
|
||||
__RCSID("$NetBSD: panic.c,v 1.7 2000/10/04 19:14:53 mjl Exp $");
|
||||
__RCSID("$NetBSD: panic.c,v 1.8 2000/10/04 19:24:59 mjl Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -54,8 +54,7 @@ __RCSID("$NetBSD: panic.c,v 1.7 2000/10/04 19:14:53 mjl Exp $");
|
||||
/* Global functions */
|
||||
|
||||
void
|
||||
panic(a)
|
||||
char *a;
|
||||
panic(char *a)
|
||||
{
|
||||
|
||||
/*
|
||||
@ -71,8 +70,7 @@ panic(a)
|
||||
}
|
||||
|
||||
void
|
||||
perr(a)
|
||||
char *a;
|
||||
perr(char *a)
|
||||
{
|
||||
|
||||
/*
|
||||
@ -89,8 +87,7 @@ perr(a)
|
||||
}
|
||||
|
||||
void
|
||||
perr2(a, b)
|
||||
char *a, *b;
|
||||
perr2(char *a, char *b)
|
||||
{
|
||||
|
||||
(void)fputs(a, stderr);
|
||||
@ -98,7 +95,7 @@ perr2(a, b)
|
||||
}
|
||||
|
||||
void
|
||||
usage()
|
||||
usage(void)
|
||||
{
|
||||
|
||||
/* Print usage and exit. */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: panic.h,v 1.3 1998/06/27 21:15:08 christos Exp $ */
|
||||
/* $NetBSD: panic.h,v 1.4 2000/10/04 19:24:59 mjl Exp $ */
|
||||
|
||||
/*
|
||||
* panic.h - header for at(1)
|
||||
@ -27,7 +27,7 @@
|
||||
* From: $OpenBSD: panic.h,v 1.3 1997/03/01 23:40:10 millert Exp $
|
||||
*/
|
||||
|
||||
void panic __P((char *));
|
||||
void perr __P((char *));
|
||||
void perr2 __P((char *, char *));
|
||||
void usage __P((void));
|
||||
void panic (char *);
|
||||
void perr (char *);
|
||||
void perr2 (char *, char *);
|
||||
void usage (void);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: parsetime.c,v 1.10 2000/10/04 19:14:53 mjl Exp $ */
|
||||
/* $NetBSD: parsetime.c,v 1.11 2000/10/04 19:24:59 mjl Exp $ */
|
||||
|
||||
/*
|
||||
* parsetime.c - parse time for at(1)
|
||||
@ -141,28 +141,27 @@ static int sc_tokplur; /* scanner - is token plural? */
|
||||
#if 0
|
||||
static char rcsid[] = "$OpenBSD: parsetime.c,v 1.4 1997/03/01 23:40:10 millert Exp $";
|
||||
#else
|
||||
__RCSID("$NetBSD: parsetime.c,v 1.10 2000/10/04 19:14:53 mjl Exp $");
|
||||
__RCSID("$NetBSD: parsetime.c,v 1.11 2000/10/04 19:24:59 mjl Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Local functions */
|
||||
static void assign_date __P((struct tm *, long, long, long));
|
||||
static void dateadd __P((int, struct tm *));
|
||||
static void expect __P((int));
|
||||
static void init_scanner __P((int, char **));
|
||||
static void month __P((struct tm *));
|
||||
static int parse_token __P((char *));
|
||||
static void plonk __P((int));
|
||||
static void plus __P((struct tm *));
|
||||
static void tod __P((struct tm *));
|
||||
static int token __P((void));
|
||||
static void assign_date (struct tm *, long, long, long);
|
||||
static void dateadd (int, struct tm *);
|
||||
static void expect (int);
|
||||
static void init_scanner (int, char **);
|
||||
static void month (struct tm *);
|
||||
static int parse_token (char *);
|
||||
static void plonk (int);
|
||||
static void plus (struct tm *);
|
||||
static void tod (struct tm *);
|
||||
static int token (void);
|
||||
|
||||
/*
|
||||
* parse a token, checking if it's something special to us
|
||||
*/
|
||||
static int
|
||||
parse_token(arg)
|
||||
char *arg;
|
||||
parse_token(char *arg)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -182,9 +181,7 @@ parse_token(arg)
|
||||
* init_scanner() sets up the scanner to eat arguments
|
||||
*/
|
||||
static void
|
||||
init_scanner(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
init_scanner(int argc, char **argv)
|
||||
{
|
||||
scp = argv;
|
||||
scc = argc;
|
||||
@ -201,7 +198,7 @@ init_scanner(argc, argv)
|
||||
* token() fetches a token from the input stream
|
||||
*/
|
||||
static int
|
||||
token()
|
||||
token(void)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@ -271,8 +268,7 @@ token()
|
||||
* plonk() gives an appropriate error message if a token is incorrect
|
||||
*/
|
||||
static void
|
||||
plonk(tok)
|
||||
int tok;
|
||||
plonk(int tok)
|
||||
{
|
||||
panic((tok == EOF) ? "incomplete time" : "garbled time");
|
||||
} /* plonk */
|
||||
@ -282,8 +278,7 @@ plonk(tok)
|
||||
* expect() gets a token and dies most horribly if it's not the token we want
|
||||
*/
|
||||
static void
|
||||
expect(desired)
|
||||
int desired;
|
||||
expect(int desired)
|
||||
{
|
||||
if (token() != desired)
|
||||
plonk(sc_tokid); /* and we die here... */
|
||||
@ -296,9 +291,7 @@ expect(desired)
|
||||
* work properly
|
||||
*/
|
||||
static void
|
||||
dateadd(minutes, tm)
|
||||
int minutes;
|
||||
struct tm *tm;
|
||||
dateadd(int minutes, struct tm *tm)
|
||||
{
|
||||
/* increment days */
|
||||
|
||||
@ -339,8 +332,7 @@ dateadd(minutes, tm)
|
||||
*
|
||||
*/
|
||||
static void
|
||||
plus(tm)
|
||||
struct tm *tm;
|
||||
plus(struct tm *tm)
|
||||
{
|
||||
int delay;
|
||||
int expectplur;
|
||||
@ -373,8 +365,7 @@ plus(tm)
|
||||
* [NUMBER [DOT NUMBER] [AM|PM]]
|
||||
*/
|
||||
static void
|
||||
tod(tm)
|
||||
struct tm *tm;
|
||||
tod(struct tm *tm)
|
||||
{
|
||||
int hour, minute = 0;
|
||||
size_t tlen;
|
||||
@ -435,9 +426,7 @@ tod(tm)
|
||||
* assign_date() assigns a date, wrapping to next year if needed
|
||||
*/
|
||||
static void
|
||||
assign_date(tm, mday, mon, year)
|
||||
struct tm *tm;
|
||||
long mday, mon, year;
|
||||
assign_date(struct tm *tm, long mday, long mon, long year)
|
||||
{
|
||||
if (year > 99) {
|
||||
if (year >= TM_YEAR_BASE)
|
||||
@ -473,8 +462,7 @@ assign_date(tm, mday, mon, year)
|
||||
* \PLUS NUMBER MINUTES|HOURS|DAYS|WEEKS/
|
||||
*/
|
||||
static void
|
||||
month(tm)
|
||||
struct tm *tm;
|
||||
month(struct tm *tm)
|
||||
{
|
||||
int year = (-1);
|
||||
int mday, wday, mon;
|
||||
@ -583,9 +571,7 @@ month(tm)
|
||||
/* Global functions */
|
||||
|
||||
time_t
|
||||
parsetime(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
parsetime(int argc, char **argv)
|
||||
{
|
||||
/*
|
||||
* Do the argument parsing, die if necessary, and return the
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: parsetime.h,v 1.3 1998/06/27 21:15:08 christos Exp $ */
|
||||
/* $NetBSD: parsetime.h,v 1.4 2000/10/04 19:24:59 mjl Exp $ */
|
||||
|
||||
/*
|
||||
* parsetime.h - header for at(1)
|
||||
@ -27,4 +27,4 @@
|
||||
* From: $OpenBSD: parsetime.h,v 1.3 1997/03/01 23:40:11 millert Exp $
|
||||
*/
|
||||
|
||||
time_t parsetime __P((int, char **));
|
||||
time_t parsetime (int, char **);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: perm.c,v 1.1 1998/06/27 21:15:08 christos Exp $ */
|
||||
/* $NetBSD: perm.c,v 1.2 2000/10/04 19:24:59 mjl Exp $ */
|
||||
|
||||
/*
|
||||
* perm.c - check user permission for at(1)
|
||||
@ -50,20 +50,18 @@
|
||||
#if 0
|
||||
static char rcsid[] = "$OpenBSD: perm.c,v 1.1 1997/03/01 23:40:12 millert Exp $";
|
||||
#else
|
||||
__RCSID("$NetBSD: perm.c,v 1.1 1998/06/27 21:15:08 christos Exp $");
|
||||
__RCSID("$NetBSD: perm.c,v 1.2 2000/10/04 19:24:59 mjl Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Function declarations */
|
||||
|
||||
static int check_for_user __P((FILE *, const char *));
|
||||
static int check_for_user (FILE *, const char *);
|
||||
|
||||
/* Local functions */
|
||||
|
||||
static int
|
||||
check_for_user(fp, name)
|
||||
FILE *fp;
|
||||
const char *name;
|
||||
check_for_user(FILE *fp, const char *name)
|
||||
{
|
||||
char *buffer;
|
||||
size_t len;
|
||||
@ -88,7 +86,7 @@ check_for_user(fp, name)
|
||||
/* Global functions */
|
||||
|
||||
int
|
||||
check_permission()
|
||||
check_permission(void)
|
||||
{
|
||||
FILE *fp;
|
||||
uid_t uid = geteuid();
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: perm.h,v 1.1 1998/06/27 21:15:08 christos Exp $ */
|
||||
/* $NetBSD: perm.h,v 1.2 2000/10/04 19:24:59 mjl Exp $ */
|
||||
|
||||
/*
|
||||
* perm.h - header for at(1)
|
||||
@ -25,4 +25,4 @@
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
int check_permission __P((void));
|
||||
int check_permission (void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user