Import Upstream version 1.8.5
[hcoop/debian/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
14 #include "ktime.h"
15
16 main(argc, argv)
17 int argc;
18 char **argv;
19 {
20 struct ktime ttime;
21 long ntime, code;
22 time_t t;
23
24 if (argc <= 1) {
25 printf("ktest: usage is 'ktest <periodic date to evaluate>'\n");
26 exit(1);
27 }
28
29 code = ktime_ParsePeriodic(argv[1], &ttime);
30 if (code) {
31 printf("got error code %d from ParsePeriodic.\n", code);
32 exit(1);
33 }
34
35 ntime = ktime_next(&ttime, 0);
36 t = ntime;
37 printf("time is %d, %s", ntime, ctime(&t));
38 exit(0);
39 }