+/*-
+ * Copyright (c) 1980 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)unctime.c 5.4 (Berkeley) %G%";
+#endif /* not lint */
+
#include <sys/types.h>
-#include <sys/time.h>
+#include <time.h>
#include <stdio.h>
+#ifdef __STDC__
+#include <stdlib.h>
+#include <string.h>
+#endif
+
/*
* Convert a ctime(3) format string into a system format date.
* Return the date thus calculated.
#define E_SECOND 17
#define E_YEAR 20
-time_t unctime(str)
+static int lookup();
+
+time_t
+unctime(str)
char *str;
{
struct tm then;
str[25] = 0;
strcpy(dbuf, str);
dbuf[E_MONTH+3] = 0;
- if ( (then.tm_mon = lookup(&dbuf[E_MONTH])) < 0) {
- return(-1);;
- }
+ if ((then.tm_mon = lookup(&dbuf[E_MONTH])) < 0)
+ return (-1);
then.tm_mday = atoi(&dbuf[E_DAY]);
then.tm_hour = atoi(&dbuf[E_HOUR]);
then.tm_min = atoi(&dbuf[E_MINUTE]);
static char months[] =
"JanFebMarAprMayJunJulAugSepOctNovDec";
-static
+static int
lookup(str)
char *str;
{
*/
struct tm *localtime();
+static int dcmp();
-time_t emitl(dp)
+time_t
+emitl(dp)
struct tm *dp;
{
time_t conv;
if (dp->a < dp2->a) \
return(-1)
-static
+static int
dcmp(dp, dp2)
register struct tm *dp, *dp2;
{
DECIDE(tm_sec);
return(0);
}
-static char *sccsid = "@(#)unctime.c 1.4 (Berkeley) 83/07/03";