# 2.11BSD#431 - /usr/src/lib/libc/gen/ctime.c

##### Functions

    asctime           X
    ctime             X
    gmtime            X
    localtime         X
    offtime           X
    tzset             X

##### Variables

    daylight          X
    timezone          X
    tzname            X

##### Macros

    FALSE             X
    TRUE              X

##### struct's

    state             X
    ttinfo            X

       1: /*
       2:  * Copyright (c) 1987 Regents of the University of California.
       3:  * This file may be freely redistributed provided that this
       4:  * notice remains attached.
       5:  */
       6:
       7: #if defined(LIBC_SCCS) && !defined(lint)
       8: static char sccsid[] = "@(#)ctime.c	1.1 (Berkeley) 3/25/87";
       9: #endif LIBC_SCCS and not lint
      10:
      11: #include "sys/param.h"
      12: #include "sys/time.h"
      13: #include "tzfile.h"
      14:
      15: char *
      16: ctime(t)
      17: time_t *t;
      18: {
      19:     struct tm   *localtime();
      20:     char    *asctime();
      21:
      22:     return(asctime(localtime(t)));
      23: }
      24:
      25: /*
      26: ** A la X3J11
      27: */
      28:
      29: char *
      30: asctime(timeptr)
      31: register struct tm *    timeptr;
      32: {
      33:     static char wday_name[DAYS_PER_WEEK][3] = {
      34:         "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
      35:     };
      36:     static char mon_name[MONS_PER_YEAR][3] = {
      37:         "Jan", "Feb", "Mar", "Apr", "May", "Jun",
      38:         "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
      39:     };
      40:     static char result[26];
      41:
      42:     (void) sprintf(result, "%.3s %.3s%3d %02d:%02d:%02d %d\n",
      43:         wday_name[timeptr->tm_wday],
      44:         mon_name[timeptr->tm_mon],
      45:         timeptr->tm_mday, timeptr->tm_hour,
      46:         timeptr->tm_min, timeptr->tm_sec,
      47:         TM_YEAR_BASE + timeptr->tm_year);
      48:     return result;
      49: }
      50:
      51: #ifndef TRUE
      52: #define TRUE        1
      53: #define FALSE       0
      54: #endif /* !TRUE */
      55:
      56: extern char *       getenv();
      57: extern char *       strcpy();
      58: extern char *       strcat();
      59: struct tm *     offtime();
      60:
      61: struct ttinfo {             /* time type information */
      62:     long        tt_gmtoff;  /* GMT offset in seconds */
      63:     int     tt_isdst;   /* used to set tm_isdst */
      64:     int     tt_abbrind; /* abbreviation list index */
      65: };
      66:
      67: struct state {
      68:     int     timecnt;
      69:     int     typecnt;
      70:     int     charcnt;
      71:     time_t      ats[TZ_MAX_TIMES];
      72:     unsigned char   types[TZ_MAX_TIMES];
      73:     struct ttinfo   ttis[TZ_MAX_TYPES];
      74:     char        chars[TZ_MAX_CHARS + 1];
      75: };
      76:
      77: static struct state s;
      78:
      79: static int      tz_is_set;
      80:
      81: char *          tzname[2] = {
      82:     "GMT",
      83:     "GMT"
      84: };
      85:
      86: #ifdef USG_COMPAT
      87: time_t          timezone = 0;
      88: int         daylight = 0;
      89: #endif /* USG_COMPAT */
      90:
      91: static long
      92: detzcode(codep)
      93: char *  codep;
      94: {
      95:     register long   result;
      96:     register int    i;
      97:
      98:     result = 0;
      99:     for (i = 0; i < 4; ++i)
     100:         result = (result << 8) | (codep[i] & 0xff);
     101:     return result;
     102: }
     103:
     104: static
     105: tzload(name)
     106: register char * name;
     107: {
     108:     register int    i;
     109:     register int    fid;
     110:
     111:     if (name == 0 && (name = TZDEFAULT) == 0)
     112:         return -1;
     113:     {
     114:         register char * p;
     115:         register int    doaccess;
     116:         char        fullname[MAXPATHLEN];
     117:
     118:         doaccess = name[0] == '/';
     119:         if (!doaccess) {
     120:             if ((p = TZDIR) == 0)
     121:                 return -1;
     122:             if ((strlen(p) + strlen(name) + 1) >= sizeof fullname)
     123:                 return -1;
     124:             (void) strcpy(fullname, p);
     125:             (void) strcat(fullname, "/");
     126:             (void) strcat(fullname, name);
     127:             /*
     128: 			** Set doaccess if '.' (as in "../") shows up in name.
     129: 			*/
     130:             while (*name != '\0')
     131:                 if (*name++ == '.')
     132:                     doaccess = TRUE;
     133:             name = fullname;
     134:         }
     135:         if (doaccess && access(name, 4) != 0)
     136:             return -1;
     137:         if ((fid = open(name, 0)) == -1)
     138:             return -1;
     139:     }
     140:     {
     141:         register char *         p;
     142:         register struct tzhead *    tzhp;
     143:         char                buf[sizeof s];
     144:
     145:         i = read(fid, buf, sizeof buf);
     146:         if (close(fid) != 0 || i < sizeof *tzhp)
     147:             return -1;
     148:         tzhp = (struct tzhead *) buf;
     149:         s.timecnt = (int) detzcode(tzhp->tzh_timecnt);
     150:         s.typecnt = (int) detzcode(tzhp->tzh_typecnt);
     151:         s.charcnt = (int) detzcode(tzhp->tzh_charcnt);
     152:         if (s.timecnt > TZ_MAX_TIMES ||
     153:             s.typecnt == 0 ||
     154:             s.typecnt > TZ_MAX_TYPES ||
     155:             s.charcnt > TZ_MAX_CHARS)
     156:                 return -1;
     157:         if (i < sizeof *tzhp +
     158:             s.timecnt * (4 + sizeof (char)) +
     159:             s.typecnt * (4 + 2 * sizeof (char)) +
     160:             s.charcnt * sizeof (char))
     161:                 return -1;
     162:         p = buf + sizeof *tzhp;
     163:         for (i = 0; i < s.timecnt; ++i) {
     164:             s.ats[i] = detzcode(p);
     165:             p += 4;
     166:         }
     167:         for (i = 0; i < s.timecnt; ++i)
     168:             s.types[i] = (unsigned char) *p++;
     169:         for (i = 0; i < s.typecnt; ++i) {
     170:             register struct ttinfo *    ttisp;
     171:
     172:             ttisp = &s.ttis[i];
     173:             ttisp->tt_gmtoff = detzcode(p);
     174:             p += 4;
     175:             ttisp->tt_isdst = (unsigned char) *p++;
     176:             ttisp->tt_abbrind = (unsigned char) *p++;
     177:         }
     178:         for (i = 0; i < s.charcnt; ++i)
     179:             s.chars[i] = *p++;
     180:         s.chars[i] = '\0';  /* ensure '\0' at end */
     181:     }
     182:     /*
     183: 	** Check that all the local time type indices are valid.
     184: 	*/
     185:     for (i = 0; i < s.timecnt; ++i)
     186:         if (s.types[i] >= s.typecnt)
     187:             return -1;
     188:     /*
     189: 	** Check that all abbreviation indices are valid.
     190: 	*/
     191:     for (i = 0; i < s.typecnt; ++i)
     192:         if (s.ttis[i].tt_abbrind >= s.charcnt)
     193:             return -1;
     194:     /*
     195: 	** Set tzname elements to initial values.
     196: 	*/
     197:     tzname[0] = tzname[1] = &s.chars[0];
     198: #ifdef USG_COMPAT
     199:     timezone = s.ttis[0].tt_gmtoff;
     200:     daylight = 0;
     201: #endif /* USG_COMPAT */
     202:     for (i = 1; i < s.typecnt; ++i) {
     203:         register struct ttinfo *    ttisp;
     204:
     205:         ttisp = &s.ttis[i];
     206:         if (ttisp->tt_isdst) {
     207:             tzname[1] = &s.chars[ttisp->tt_abbrind];
     208: #ifdef USG_COMPAT
     209:             daylight = 1;
     210: #endif /* USG_COMPAT */
     211:         } else {
     212:             tzname[0] = &s.chars[ttisp->tt_abbrind];
     213: #ifdef USG_COMPAT
     214:             timezone = ttisp->tt_gmtoff;
     215: #endif /* USG_COMPAT */
     216:         }
     217:     }
     218:     return 0;
     219: }
     220:
     221: static
     222: tzsetkernel()
     223: {
     224:     struct timeval  tv;
     225:     struct timezone tz;
     226:     char    *tztab();
     227:
     228:     if (gettimeofday(&tv, &tz))
     229:         return -1;
     230:     s.timecnt = 0;      /* UNIX counts *west* of Greenwich */
     231:     s.ttis[0].tt_gmtoff = tz.tz_minuteswest * -SECS_PER_MIN;
     232:     s.ttis[0].tt_abbrind = 0;
     233:     (void)strcpy(s.chars, tztab(tz.tz_minuteswest, 0));
     234:     tzname[0] = tzname[1] = s.chars;
     235: #ifdef USG_COMPAT
     236:     timezone = tz.tz_minuteswest * 60;
     237:     daylight = tz.tz_dsttime;
     238: #endif /* USG_COMPAT */
     239:     return 0;
     240: }
     241:
     242: static
     243: tzsetgmt()
     244: {
     245:     s.timecnt = 0;
     246:     s.ttis[0].tt_gmtoff = 0;
     247:     s.ttis[0].tt_abbrind = 0;
     248:     (void) strcpy(s.chars, "GMT");
     249:     tzname[0] = tzname[1] = s.chars;
     250: #ifdef USG_COMPAT
     251:     timezone = 0;
     252:     daylight = 0;
     253: #endif /* USG_COMPAT */
     254: }
     255:
     256: void
     257: tzset()
     258: {
     259:     register char * name;
     260:
     261:     tz_is_set = TRUE;
     262:     name = getenv("TZ");
     263:     if (!name || *name) {           /* did not request GMT */
     264:         if (name && !tzload(name))  /* requested name worked */
     265:             return;
     266:         if (!tzload((char *)0))     /* default name worked */
     267:             return;
     268:         if (!tzsetkernel())     /* kernel guess worked */
     269:             return;
     270:     }
     271:     tzsetgmt();             /* GMT is default */
     272: }
     273:
     274: struct tm *
     275: localtime(timep)
     276: time_t *    timep;
     277: {
     278:     register struct ttinfo *    ttisp;
     279:     register struct tm *        tmp;
     280:     register int            i;
     281:     time_t              t;
     282:
     283:     if (!tz_is_set)
     284:         (void) tzset();
     285:     t = *timep;
     286:     if (s.timecnt == 0 || t < s.ats[0]) {
     287:         i = 0;
     288:         while (s.ttis[i].tt_isdst)
     289:             if (++i >= s.timecnt) {
     290:                 i = 0;
     291:                 break;
     292:             }
     293:     } else {
     294:         for (i = 1; i < s.timecnt; ++i)
     295:             if (t < s.ats[i])
     296:                 break;
     297:         i = s.types[i - 1];
     298:     }
     299:     ttisp = &s.ttis[i];
     300:     /*
     301: 	** To get (wrong) behavior that's compatible with System V Release 2.0
     302: 	** you'd replace the statement below with
     303: 	**	tmp = offtime((time_t) (t + ttisp->tt_gmtoff), 0L);
     304: 	*/
     305:     tmp = offtime(&t, ttisp->tt_gmtoff);
     306:     tmp->tm_isdst = ttisp->tt_isdst;
     307:     tzname[tmp->tm_isdst] = &s.chars[ttisp->tt_abbrind];
     308:     tmp->tm_zone = &s.chars[ttisp->tt_abbrind];
     309:     return tmp;
     310: }
     311:
     312: struct tm *
     313: gmtime(clock)
     314: time_t *    clock;
     315: {
     316:     register struct tm *    tmp;
     317:
     318:     tmp = offtime(clock, 0L);
     319:     tzname[0] = "GMT";
     320:     tmp->tm_zone = "GMT";       /* UCT ? */
     321:     return tmp;
     322: }
     323:
     324: static int  mon_lengths[2][MONS_PER_YEAR] = {
     325:     31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
     326:     31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
     327: };
     328:
     329: static int  year_lengths[2] = {
     330:     DAYS_PER_NYEAR, DAYS_PER_LYEAR
     331: };
     332:
     333: struct tm *
     334: offtime(clock, offset)
     335: time_t *    clock;
     336: long        offset;
     337: {
     338:     register struct tm *    tmp;
     339:     register long       days;
     340:     register long       rem;
     341:     register int        y;
     342:     register int        yleap;
     343:     register int *      ip;
     344:     static struct tm    tm;
     345:
     346:     tmp = &tm;
     347:     days = *clock / SECS_PER_DAY;
     348:     rem = *clock % SECS_PER_DAY;
     349:     rem += offset;
     350:     while (rem < 0) {
     351:         rem += SECS_PER_DAY;
     352:         --days;
     353:     }
     354:     while (rem >= SECS_PER_DAY) {
     355:         rem -= SECS_PER_DAY;
     356:         ++days;
     357:     }
     358:     tmp->tm_hour = (int) (rem / SECS_PER_HOUR);
     359:     rem = rem % SECS_PER_HOUR;
     360:     tmp->tm_min = (int) (rem / SECS_PER_MIN);
     361:     tmp->tm_sec = (int) (rem % SECS_PER_MIN);
     362:     tmp->tm_wday = (int) ((EPOCH_WDAY + days) % DAYS_PER_WEEK);
     363:     if (tmp->tm_wday < 0)
     364:         tmp->tm_wday += DAYS_PER_WEEK;
     365:     y = EPOCH_YEAR;
     366:     if (days >= 0)
     367:         for ( ; ; ) {
     368:             yleap = isleap(y);
     369:             if (days < (long) year_lengths[yleap])
     370:                 break;
     371:             ++y;
     372:             days = days - (long) year_lengths[yleap];
     373:         }
     374:     else do {
     375:         --y;
     376:         yleap = isleap(y);
     377:         days = days + (long) year_lengths[yleap];
     378:     } while (days < 0);
     379:     tmp->tm_year = y - TM_YEAR_BASE;
     380:     tmp->tm_yday = (int) days;
     381:     ip = mon_lengths[yleap];
     382:     for (tmp->tm_mon = 0; days >= (long) ip[tmp->tm_mon]; ++(tmp->tm_mon))
     383:         days = days - (long) ip[tmp->tm_mon];
     384:     tmp->tm_mday = (int) (days + 1);
     385:     tmp->tm_isdst = 0;
     386:     tmp->tm_zone = "";
     387:     tmp->tm_gmtoff = offset;
     388:     return tmp;
     389: }

#### Defined functions

asctime defined in line 29; used 13 times

- in line 20-22(2)
- in /usr/include/time.h line 29
- in /usr/src/bin/date.c line 143, 150
- in /usr/src/include/time.h line 27
- in /usr/src/libexec/ctimed/ctimed.c line 106
- in /usr/src/share/zoneinfo/zdump.c line 16, 186-188(2)
- in /usr/src/ucb/last.c line 160-164(2)
- in /usr/src/ucb/lock/lock.c line 109

ctime defined in line 15; used 201 times

- in /usr/include/time.h line 29
- in /usr/ingres/source/dbu/help.c line 276
- in /usr/ingres/source/dbu/save.c line 117
- in /usr/ingres/source/monitor/main.c line 121
- in /usr/ingres/source/monitor/monitor.c line 155
- in /usr/ingres/source/monitor/quit.c line 129
- in /usr/ingres/source/monitor/trapquery.c line 59, 76
- in /usr/src/bin/adb/output.c line 180-182(2)
- in /usr/src/bin/diff/diffreg.c line 708-710(2)
- in /usr/src/bin/login/login.c line 101, 527, 535
- in /usr/src/bin/ls/ls.c line 600
- in /usr/src/bin/mail.c line 478
- in /usr/src/bin/make/files.c line 387, 399
- in /usr/src/bin/pr.c line 48, 219
- in /usr/src/bin/sysctl/sysctl.c line 378
- in /usr/src/bin/tar.c line 814-819(2)
- in /usr/src/bin/tcsh/tc.sched.c line 77, 84
- in /usr/src/bin/who.c line 81
- in /usr/src/games/battlestar/com6.c line 78
- in /usr/src/games/boggle/boggle.c line 524
- in /usr/src/games/mille/save.c line 20, 86, 121
- in /usr/src/games/monop/execute.c line 151, 218
- in /usr/src/games/phantasia/func1.c line 275
- in /usr/src/games/phantasia/phant.h line 149
- in /usr/src/games/snake/snake.c line 911
- in /usr/src/games/warp/score.c line 544
- in /usr/src/games/warp/warp.h line 456
- in /usr/src/include/time.h line 27
- in /usr/src/libexec/ctimed/ctimed.c line 101
- in /usr/src/libexec/ftpd/ftpcmd.y line 831, 840
- in /usr/src/libexec/ftpd/ftpd.c line 1127, 1142
- in /usr/src/libexec/identd/src/crypto.c line 216
- in /usr/src/new/crash/crash.c line 892-893(2)
- in /usr/src/new/jove/recover.c line 566
- in /usr/src/new/jove/util.c line 712, 718
- in /usr/src/new/l11/link.c line 2, 727
- in /usr/src/new/nntp/server/fakesyslog.c line 24, 53
- in /usr/src/new/nntp/server/serve.c line 80, 170-174(2)
- in /usr/src/new/nntp/xmit/nntpxmit.c line 287, 325
- in /usr/src/old/512dumpdir.c line 145, 165-166(2)
- in /usr/src/old/512restor.c line 286, 315-316(2)
- in /usr/src/old/dump/dump.h line 66
- in /usr/src/old/dump/dumpdir.c line 57, 77-78(2)
- in /usr/src/old/dump/dumpitime.c line 11, 134
- in /usr/src/old/dump/dumpoptr.c line 300
- in /usr/src/sbin/dmesg/dmesg.c line 135, 142
- in /usr/src/sbin/dump/dump.h line 62
- in /usr/src/sbin/dump/dumpdir.c line 65, 85-86(2)
- in /usr/src/sbin/dump/dumpitime.c line 14, 134
- in /usr/src/sbin/dump/dumpoptr.c line 288
- in /usr/src/sbin/fsck/inode.c line 192, 207
- in /usr/src/sbin/restor/restor.c line 174, 203-204(2)
- in /usr/src/sbin/routed/trace.c line 215
- in /usr/src/sbin/savecore/savecore.c line 56, 227, 233, 240
- in /usr/src/sbin/shutdown/shutdown.c line 165, 355, 385
- in /usr/src/ucb/Mail/names.c line 218, 226
- in /usr/src/ucb/Mail/send.c line 536, 543
- in /usr/src/ucb/PORT/pascal/src/subr.c line 62-66(2)
- in /usr/src/ucb/PORT/systat/vmstat.c line 226
- in /usr/src/ucb/ex/expreserve.c line 325-330(2)
- in /usr/src/ucb/ex/exrecover.c line 63, 103, 297
- in /usr/src/ucb/finger/lprint.c line 67, 131, 161
- in /usr/src/ucb/finger/sprint.c line 42, 84
- in /usr/src/ucb/last.c line 45, 123, 156, 180, 192
- in /usr/src/ucb/lastcomm.c line 94
- in /usr/src/ucb/leave.c line 136
- in /usr/src/ucb/msgs/msgs.c line 104, 320, 326
- in /usr/src/ucb/pascal/pi/subr.c line 70
- in /usr/src/ucb/pascal/pi/version.c line 13, 21
- in /usr/src/ucb/pascal/px/gather.c line 98
- in /usr/src/ucb/pascal/px/pdattim.c line 15
- in /usr/src/ucb/pascal/pxp/subr.c line 69
- in /usr/src/ucb/rdist/docmd.c line 513
- in /usr/src/ucb/rwho.c line 41, 125
- in /usr/src/ucb/script.c line 31, 138, 193
- in /usr/src/ucb/vgrind/vfontedpr.c line 44, 268
- in /usr/src/ucb/vmstat.c line 156
- in /usr/src/usr.bin/find/find.c line 1070, 1178
- in /usr/src/usr.bin/iostat.c line 78
- in /usr/src/usr.bin/learn/copy.c line 13, 218
- in /usr/src/usr.bin/refer/what1.c line 96
- in /usr/src/usr.bin/shar/shar.c line 125, 148
- in /usr/src/usr.bin/tip/log.c line 39
- in /usr/src/usr.bin/tip/tip.h line 235
- in /usr/src/usr.bin/uucp/uuq.c line 155
- in /usr/src/usr.bin/uucp/uusend.c line 44, 96
- in /usr/src/usr.lib/libF77/mkindx.c line 20, 34
- in /usr/src/usr.lib/libF77/mkvers.c line 24, 46
- in /usr/src/usr.lib/libI77/mkindx.c line 20, 34
- in /usr/src/usr.lib/libI77/mkvers.c line 24, 46
- in /usr/src/usr.lib/libU77/ctime_.c line 20-25(2)
- in /usr/src/usr.lib/libU77/fdate_.c line 24-28(2)
- in /usr/src/usr.lib/libU77/mkindx.c line 20, 34
- in /usr/src/usr.lib/libU77/mkvers.c line 24, 46
- in /usr/src/usr.sbin/ac/ac.c line 271-276(2)
- in /usr/src/usr.sbin/cron/crontab.c line 490
- in /usr/src/usr.sbin/inetd/inetd.c line 1149, 1169
- in /usr/src/usr.sbin/lpr/printjob.c line 803, 817
- in /usr/src/usr.sbin/named/named/db_dump.c line 77, 230
- in /usr/src/usr.sbin/named/named/ns_stats.c line 114
- in /usr/src/usr.sbin/named/tools/nslookup/debug.c line 45
- in /usr/src/usr.sbin/ntp/ntp.c line 283, 289, 295, 301, 312, 321
- in /usr/src/usr.sbin/rwhod/rwhod.c line 448
- in /usr/src/usr.sbin/sendmail.MX/aux/mailstats.c line 38, 65
- in /usr/src/usr.sbin/sendmail.MX/src/arpadate.c line 88
- in /usr/src/usr.sbin/sendmail.MX/src/envelope.c line 319
- in /usr/src/usr.sbin/sendmail.MX/src/queue.c line 859-863(2)
- in /usr/src/usr.sbin/sendmail/aux/mailstats.c line 39, 54
- in /usr/src/usr.sbin/sendmail/src/arpadate.c line 88
- in /usr/src/usr.sbin/sendmail/src/envelope.c line 313
- in /usr/src/usr.sbin/sendmail/src/queue.c line 846-850(2)
- in /usr/src/usr.sbin/syslogd/syslogd.c line 424, 500, 658
- in /usr/src/usr.sbin/timed/timed.c line 587-591(2)

detzcode defined in line 91; used 5 times

- in line 149-151(3), 164, 173

gmtime defined in line 312; used 31 times

- in /usr/include/time.h line 28
- in /usr/src/bin/date.c line 143
- in /usr/src/include/time.h line 26
- in /usr/src/libexec/ctimed/ctimed.c line 124
- in /usr/src/libexec/ftpd/ftpcmd.y line 458-459(2)
- in /usr/src/new/PORT/perl.1.0.0/arg.c line 1907
- in /usr/src/new/PORT/perl.1.0.0/perl.h line 184
- in /usr/src/new/PORT/perl.1.0.10/arg.c line 1935
- in /usr/src/new/PORT/perl.1.0.10/perl.h line 213
- in /usr/src/new/PORT/perl.1.0.16/arg.c line 1954
- in /usr/src/new/nntp/server/time.c line 140
- in /usr/src/new/nntp/xfer/nntpxfer.c line 132
- in /usr/src/share/zoneinfo/zdump.c line 18, 186
- in /usr/src/share/zoneinfo/zic.c line 466-467(2)
- in /usr/src/ucb/finger/lprint.c line 137
- in /usr/src/ucb/finger/sprint.c line 131
- in /usr/src/ucb/ftp/cmds.c line 591
- in /usr/src/ucb/last.c line 160-164(2)
- in /usr/src/usr.lib/libU77/gmtime_.c line 21, 29
- in /usr/src/usr.sbin/ntp/read_psti.c line 289
- in /usr/src/usr.sbin/sendmail.MX/src/arpadate.c line 134
- in /usr/src/usr.sbin/sendmail.MX/src/envelope.c line 311-315(2)
- in /usr/src/usr.sbin/sendmail/src/arpadate.c line 134
- in /usr/src/usr.sbin/sendmail/src/envelope.c line 305-309(2)

localtime defined in line 274; used 145 times

- in line 19-22(2)
- in /usr/include/time.h line 28
- in /usr/ingres/source/qrymod/protect.c line 822, 852
- in /usr/src/bin/ar/contents.c line 79
- in /usr/src/bin/chpass/util.c line 45, 70
- in /usr/src/bin/date.c line 113, 149, 182
- in /usr/src/bin/login/login.c line 342, 352
- in /usr/src/bin/tcsh/sh.hist.c line 205
- in /usr/src/bin/tcsh/tc.prompt.c line 69
- in /usr/src/bin/tcsh/tc.sched.c line 148
- in /usr/src/bin/tcsh/tc.who.c line 442
- in /usr/src/bin/tp/tp3.c line 200, 219
- in /usr/src/bin/wall.c line 42, 61
- in /usr/src/bin/write.c line 47
- in /usr/src/games/adventure/okplay.c line 24
- in /usr/src/games/adventure/wizard.c line 11-13(2)
- in /usr/src/games/hack/hack.unix.c line 39-42(2)
- in /usr/src/games/pdp/zork/z.c line 130
- in /usr/src/games/phantasia/func1.c line 576
- in /usr/src/games/phantasia/func2.c line 813
- in /usr/src/games/phantasia/main.c line 240, 569
- in /usr/src/games/rogue/machdep.c line 277-281(2), 317
- in /usr/src/include/time.h line 26
- in /usr/src/lib/libc/gen/syslog.c line 124
- in /usr/src/libexec/ctimed/ctimed.c line 115, 135
- in /usr/src/libexec/getty/get_date.c line 35
- in /usr/src/libexec/talkd/announce.c line 112, 123
- in /usr/src/local/afio/afio.c line 298, 2564
- in /usr/src/local/mtools/dir_write.c line 149-153(2)
- in /usr/src/local/mtools/mread.c line 249, 284
- in /usr/src/local/welcome/welcome.c line 54
- in /usr/src/new/OLD/apl/src/a9.c line 87, 122, 161
- in /usr/src/new/OLD/apl/src/aj.c line 285-288(2)
- in /usr/src/new/PORT/apl/src/a9.c line 87, 122, 161
- in /usr/src/new/PORT/apl/src/aj.c line 285-288(2)
- in /usr/src/new/PORT/dungeon/rtim.c line 23, 33, 49-54(2)
- in /usr/src/new/PORT/perl.1.0.0/arg.c line 1902
- in /usr/src/new/PORT/perl.1.0.0/perl.h line 184
- in /usr/src/new/PORT/perl.1.0.10/arg.c line 1930
- in /usr/src/new/PORT/perl.1.0.10/perl.h line 213
- in /usr/src/new/PORT/perl.1.0.16/arg.c line 1949
- in /usr/src/new/ansi/ansitape.c line 55
- in /usr/src/new/nntp/server/time.c line 182, 215
- in /usr/src/new/notes/src/getdate.y line 125, 145, 157, 184, 196-197(2), 480
- in /usr/src/new/notes/src/gtime.c line 40-41(2)
- in /usr/src/new/notes/src/newsdump.c line 542, 550, 562
- in /usr/src/new/rcs/src/ci.c line 129, 296, 776
- in /usr/src/new/rcs/src/co.c line 117, 208
- in /usr/src/new/rcs/src/maketime.c line 64, 75, 195
- in /usr/src/new/rcs/src/rcsutil.c line 325, 345
- in /usr/src/new/rcs/src/rlog.c line 101, 883
- in /usr/src/old/dump/dumpoptr.c line 110, 140
- in /usr/src/old/dump/unctime.c line 65, 80
- in /usr/src/sbin/dump/dumpoptr.c line 114, 144
- in /usr/src/sbin/dump/unctime.c line 65, 80
- in /usr/src/sbin/savecore/savecore.c line 349-351(2)
- in /usr/src/sbin/shutdown/shutdown.c line 325
- in /usr/src/share/zoneinfo/zdump.c line 182-187(2)
- in /usr/src/ucb/PORT/pascal/pxp/version.c line 26, 32
- in /usr/src/ucb/leave.c line 76
- in /usr/src/ucb/lock/lock.c line 108
- in /usr/src/ucb/w.c line 132, 269
- in /usr/src/usr.bin/at/at.c line 792
- in /usr/src/usr.bin/at/atq.c line 359
- in /usr/src/usr.bin/at/atrun.c line 124
- in /usr/src/usr.bin/calendar/calendar.c line 29, 35, 48
- in /usr/src/usr.bin/roff/common_source/n1.c line 403
- in /usr/src/usr.bin/uucp/assert.c line 20, 38
- in /usr/src/usr.bin/uucp/conn.c line 916, 926
- in /usr/src/usr.bin/uucp/gnxseq.c line 27, 68
- in /usr/src/usr.bin/uucp/logent.c line 83, 97, 149, 194
- in /usr/src/usr.lib/libU77/idate_.c line 25-29(2)
- in /usr/src/usr.lib/libU77/itime_.c line 25-29(2)
- in /usr/src/usr.lib/libU77/ltime_.c line 21, 29
- in /usr/src/usr.sbin/ac/ac.c line 255, 261
- in /usr/src/usr.sbin/cron/cron.c line 141, 197
- in /usr/src/usr.sbin/cron/misc.c line 455, 623
- in /usr/src/usr.sbin/sendmail.MX/src/arpadate.c line 135
- in /usr/src/usr.sbin/sendmail/src/arpadate.c line 135

offtime defined in line 333; used 5 times

- in line 59, 305, 318
- in /usr/src/libexec/ctimed/ctimed.c line 38, 137

tzload defined in line 104; used 2 times

- in line 264-266(2)

tzset defined in line 256; used 9 times

- in line 284
- in /usr/src/libexec/ctimed/ctimed.c line 110
- in /usr/src/local/mtools/mread.c line 247, 278
- in /usr/src/new/nntp/server/time.c line 171, 204
- in /usr/src/new/rcs/src/maketime.c line 225
- in /usr/src/share/zoneinfo/zdump.c line 25, 104

tzsetgmt defined in line 242; used 1 times

- in line 271

tzsetkernel defined in line 221; used 1 times

- in line 268

#### Defined variables

daylight defined in line 88; used 5 times

- in line 200, 209, 237, 252
- in /usr/src/new/notes/src/ftime.c line 43

mon_lengths defined in line 324; used 1 times

- in line 381

s defined in line 77; used 52 times

- in line 143, 149-172(16), 178-212(15), 230-234(5), 245-249(5), 286-299(8), 307-308(2)

sccsid defined in line 8; never used
timezone defined in line 87; used 4 times

- in line 199, 214, 236, 251

tz_is_set defined in line 79; used 2 times

- in line 261, 283

tzname defined in line 81; used 12 times

- in line 197(2), 207-212(2), 234(2), 249(2), 307, 319
- in /usr/src/share/zoneinfo/zdump.c line 189-190(2)

year_lengths defined in line 329; used 3 times

- in line 369-377(3)

#### Defined struct's

state defined in line 67; used 2 times

- in line 77(2)

ttinfo defined in line 61; used 8 times

- in line 73(2), 170(2), 203(2), 278(2)

#### Defined macros

FALSE defined in line 53; never used
TRUE defined in line 52; used 3 times

- in line 51, 132, 261

Last modified: 1987-04-01 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1459 |