aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/at
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>1995-06-24 17:15:56 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>1995-06-24 17:15:56 +0000
commit29eaad36e55c3aa4003b7220bc621ee2c3334e8c (patch)
tree8241ba413f0171b1ee976cb752fd2494e2924f2e /usr.bin/at
parent00a44db927cb79811596b9b187d3833ca562bdd9 (diff)
downloadsrc-29eaad36e55c3aa4003b7220bc621ee2c3334e8c.tar.gz
src-29eaad36e55c3aa4003b7220bc621ee2c3334e8c.zip
Notes
Diffstat (limited to 'usr.bin/at')
-rw-r--r--usr.bin/at/at.man4
-rw-r--r--usr.bin/at/parsetime.c20
2 files changed, 13 insertions, 11 deletions
diff --git a/usr.bin/at/at.man b/usr.bin/at/at.man
index 21e789c01041..d279ff86d084 100644
--- a/usr.bin/at/at.man
+++ b/usr.bin/at/at.man
@@ -1,4 +1,4 @@
-.\" $Id: at.man,v 1.3 1994/06/16 16:49:46 kernel Exp $
+.\" $Id: at.man,v 1.1 1995/04/12 02:42:31 ache Exp $
.Dd April 12, 1995
.Dt "AT" 1
.Os "FreeBSD 2.1"
@@ -81,6 +81,8 @@ or
.Ar MM/DD/YY
or
.Ar DD.MM.YY .
+The specification of a date must follow the specification of
+the time of day.
You can also give times like
.Op Nm now
.Nm + Ar count \%time-units ,
diff --git a/usr.bin/at/parsetime.c b/usr.bin/at/parsetime.c
index 867893cf1346..88cc5edf2206 100644
--- a/usr.bin/at/parsetime.c
+++ b/usr.bin/at/parsetime.c
@@ -56,7 +56,7 @@
/* Structures and unions */
-enum { /* symbols */
+enum tok { /* symbols */
MIDNIGHT, NOON, TEATIME,
PM, AM, TOMORROW, TODAY, NOW,
MINUTES, HOURS, DAYS, WEEKS,
@@ -69,8 +69,8 @@ enum { /* symbols */
/* parse translation table - table driven parsers can be your FRIEND!
*/
struct {
- char *name; /* token name */
- int value; /* token id */
+ const char *name; /* token name */
+ enum tok value; /* token id */
int plural; /* is this plural? */
} Specials[] = {
{ "midnight", MIDNIGHT,0 }, /* 00:00:00 of today or tomorrow */
@@ -127,18 +127,18 @@ static int need; /* scanner - need to advance to next argument */
static char *sc_token; /* scanner - token buffer */
static size_t sc_len; /* scanner - lenght of token buffer */
-static int sc_tokid; /* scanner - token id */
+static enum tok sc_tokid; /* scanner - token id */
static int sc_tokplur; /* scanner - is token plural? */
-static char rcsid[] = "$Id: parsetime.c,v 1.3 1995/04/12 02:42:35 ache Exp $";
+static char rcsid[] = "$Id: parsetime.c,v 1.4 1995/05/30 06:29:25 rgrimes Exp $";
/* Local functions */
/*
* parse a token, checking if it's something special to us
*/
-static int
-parse_token(char *arg)
+static enum tok
+parse_token(const char *arg)
{
int i;
@@ -172,7 +172,7 @@ init_scanner(int argc, char **argv)
/*
* token() fetches a token from the input stream
*/
-static int
+static enum tok
token()
{
int idx;
@@ -250,7 +250,7 @@ plonk(int tok)
* expect() gets a token and dies most horribly if it's not the token we want
*/
static void
-expect(int desired)
+expect(enum tok desired)
{
if (token() != desired)
plonk(sc_tokid); /* and we die here... */
@@ -489,7 +489,7 @@ month(struct tm *tm)
token();
if (sc_tokid == SLASH || sc_tokid == DOT) {
- int sep;
+ enum tok sep;
sep = sc_tokid;
expect(NUMBER);