#include "ktime.h"
#include <time.h>
#include <ctype.h>
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
+#ifdef HAVE_STRING_H
#include <string.h>
#else
+#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
+#endif
#include "afsutil.h"
char ps_keychar;
afs_int32 ps_maxValue;
} parseseq[] = {
- KTIMEDATE_YEAR, 'y', MAX_YEAR_VALUE, /* no max. value */
- KTIMEDATE_MONTH, 'm', MAX_MONTH_VALUE, /* months max. 12 */
- KTIMEDATE_DAY, 'd', MAX_DAY_VALUE, /* days max. 31 */
- 0, 0, 0,
+ { KTIMEDATE_YEAR, 'y', MAX_YEAR_VALUE, }, /* no max. value */
+ { KTIMEDATE_MONTH, 'm', MAX_MONTH_VALUE, }, /* months max. 12 */
+ { KTIMEDATE_DAY, 'd', MAX_DAY_VALUE, }, /* days max. 31 */
+ { 0, 0, 0, }
};
/* Encodings to and from relative dates. The caller is responsible for
#ifdef AFS_NT40_ENV
#include <malloc.h>
#endif
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
+#ifdef HAVE_STRING_H
#include <string.h>
#else
+#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
+#endif
+#include <stdlib.h>
#include "afsutil.h"
#include "ktime.h"
};
/* free token list returned by parseLine */
+#ifdef undef
static LocalFreeTokens(alist)
register struct token *alist; {
register struct token *nlist;
}
return 0;
}
+#endif
static space(x)
int x; {
char *aline;
struct token **alist; {
char tbuffer[256];
- register char *tptr;
+ register char *tptr = NULL;
int inToken;
struct token *first, *last;
register struct token *ttok;
char *key;
afs_int32 value;
} ptkeys [] = {
- "sun", 0x10000,
- "mon", 0x10001,
- "tue", 0x10002,
- "wed", 0x10003,
- "thu", 0x10004,
- "fri", 0x10005,
- "sat", 0x10006,
- "sunday", 0x10000,
- "monday", 0x10001,
- "tuesday", 0x10002,
- "wednesday", 0x10003,
- "thursday", 0x10004,
- "thur", 0x10004,
- "friday", 0x10005,
- "saturday", 0x10006,
- "am", 0x20000,
- "pm", 0x20001,
- "a.m.", 0x20000,
- "p.m.", 0x20001,
- 0, 0,
+ { "sun", 0x10000, },
+ { "mon", 0x10001, },
+ { "tue", 0x10002, },
+ { "wed", 0x10003, },
+ { "thu", 0x10004, },
+ { "fri", 0x10005, },
+ { "sat", 0x10006, },
+ { "sunday", 0x10000, },
+ { "monday", 0x10001, },
+ { "tuesday", 0x10002, },
+ { "wednesday", 0x10003, },
+ { "thursday", 0x10004, },
+ { "thur", 0x10004, },
+ { "friday", 0x10005, },
+ { "saturday", 0x10006, },
+ { "am", 0x20000, },
+ { "pm", 0x20001, },
+ { "a.m.", 0x20000, },
+ { "p.m.", 0x20001, },
+ { 0, 0, }
};
/* ktime_DateOf
/* compare date in both formats, and return as in strcmp */
+#ifdef undef
static KTimeCmp(aktime, atm)
register struct ktime *aktime;
register struct tm *atm; {
}
return 0;
}
+#endif
/* compare date in both formats, and return as in strcmp */
static KDateCmp(akdate, atm)