include-afsconfig-before-param-h-20010712
[openafs.git] / src / util / test / ktest.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #include <afsconfig.h>
11 #include <afs/param.h>
12
13 RCSID("$Header$");
14
15 #include "ktime.h"
16
17 main(argc, argv)
18 int argc;
19 char **argv; {
20     struct ktime ttime;
21     long ntime, code;
22
23     if (argc <= 1) {
24         printf("ktest: usage is 'ktest <periodic date to evaluate>'\n");
25         exit(1);
26     }
27
28     code = ktime_ParsePeriodic(argv[1], &ttime);
29     if (code) {
30         printf("got error code %d from ParsePeriodic.\n", code);
31         exit(1);
32     }
33
34     ntime = ktime_next(&ttime, 0);
35     printf("time is %d, %s", ntime, ctime(&ntime));
36     exit(0);
37 }