diff options
| author | Theodore Tso <tytso@mit.edu> | 1995-02-01 21:43:42 +0000 |
|---|---|---|
| committer | Theodore Tso <tytso@mit.edu> | 1995-02-01 21:43:42 +0000 |
| commit | 0c5cf54cc8c832e091362306cb5fe9644a17dc0d (patch) | |
| tree | cee62d2d10b033f6a59d9e143a9554b3da0acbea /src/isode/psap/gtime.c | |
| parent | 2c1429f492c4bd0575a2ab0969b7a0f542e7124b (diff) | |
| download | krb5-0c5cf54cc8c832e091362306cb5fe9644a17dc0d.tar.gz krb5-0c5cf54cc8c832e091362306cb5fe9644a17dc0d.tar.xz krb5-0c5cf54cc8c832e091362306cb5fe9644a17dc0d.zip | |
Removing ISODE.... (and there was much rejoicing)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4870 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/isode/psap/gtime.c')
| -rw-r--r-- | src/isode/psap/gtime.c | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/src/isode/psap/gtime.c b/src/isode/psap/gtime.c deleted file mode 100644 index ab91169f62..0000000000 --- a/src/isode/psap/gtime.c +++ /dev/null @@ -1,99 +0,0 @@ -/* gtime.c - inverse gmtime */ - -/* - * isode/psap/gtime.c - */ - -/* - * NOTICE - * - * Acquisition, use, and distribution of this module and related - * materials are subject to the restrictions of a license agreement. - * Consult the Preface in the User's Manual for the full terms of - * this agreement. - * - */ - - -/* LINTLIBRARY */ - -#include <stdio.h> -#include "psap.h" -#ifdef OSX -#include <sys/time.h> -#endif -#ifdef notdef -#include <sys/timeb.h> -#endif - -/* DATA */ - -/* gtime(): the inverse of localtime(). - This routine was supplied by Mike Accetta at CMU many years ago. - */ - -#ifdef masscomp -extern int dmsize[]; -#else -int dmsize[] = { - 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 -}; -#endif - -#define dysize(y) \ - (((y) % 4) ? 365 : (((y) % 100) ? 366 : (((y) % 400) ? 365 : 366))) - -#define YEAR(y) ((y) >= 100 ? (y) : (y) + 1900) - -/* */ - -long gtime (tm) -register struct tm *tm; -{ - register int i, - sec, - mins, - hour, - mday, - mon, - year; - register long result; -#ifdef notdef - long local; - struct timeb tb; -#endif - - if ((sec = tm -> tm_sec) < 0 || sec > 59 - || (mins = tm -> tm_min) < 0 || mins > 59 - || (hour = tm -> tm_hour) < 0 || hour > 24 - || (mday = tm -> tm_mday) < 1 || mday > 31 - || (mon = tm -> tm_mon + 1) < 1 || mon > 12) - return ((long) NOTOK); - if (hour == 24) { - hour = 0; - mday++; - } - year = YEAR (tm -> tm_year); - - result = 0L; - for (i = 1970; i < year; i++) - result += dysize (i); - if (dysize (year) == 366 && mon >= 3) - result++; - while (--mon) - result += dmsize[mon - 1]; - result += mday - 1; - result = 24 * result + hour; - result = 60 * result + mins; - result = 60 * result + sec; - -#ifdef notdef - (void) ftime (&tb); - result += 60 * tb.timezone; - local = result; - if ((tm = localtime (&local)) && tm -> tm_isdst) - result -= 60 * 60; -#endif - - return result; -} |
