Annotation of mstools/h/time.h, revision 1.1.1.4

1.1       root        1: /***
                      2: *time.h - definitions/declarations for time routines
                      3: *
1.1.1.4 ! root        4: *      Copyright (c) 1985-1993, Microsoft Corporation. All rights reserved.
1.1       root        5: *
                      6: *Purpose:
                      7: *      This file has declarations of time routines and defines
                      8: *      the structure returned by the localtime and gmtime routines and
                      9: *      used by asctime.
                     10: *      [ANSI/System V]
                     11: *
                     12: ****/
                     13: 
                     14: #ifndef _INC_TIME
                     15: 
                     16: #ifdef __cplusplus
                     17: extern "C" {
                     18: #endif
                     19: 
                     20: 
1.1.1.3   root       21: /*
                     22:  * Conditional macro definition for function calling type and variable type
                     23:  * qualifiers.
                     24:  */
                     25: #if   ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
                     26: 
                     27: /*
                     28:  * Definitions for MS C8-32 (386/486) compiler
                     29:  */
                     30: #define _CRTAPI1 __cdecl
                     31: #define _CRTAPI2 __cdecl
                     32: 
                     33: #else
                     34: 
                     35: /*
                     36:  * Other compilers (e.g., MIPS)
                     37:  */
                     38: #define _CRTAPI1
                     39: #define _CRTAPI2
                     40: 
1.1.1.2   root       41: #endif
1.1       root       42: 
                     43: /* define the implementation defined time type */
                     44: 
                     45: #ifndef _TIME_T_DEFINED
                     46: typedef long time_t;           /* time value */
                     47: #define _TIME_T_DEFINED        /* avoid multiple def's of time_t */
                     48: #endif
                     49: 
                     50: #ifndef _CLOCK_T_DEFINED
                     51: typedef long clock_t;
                     52: #define _CLOCK_T_DEFINED
                     53: #endif
                     54: 
                     55: #ifndef _SIZE_T_DEFINED
                     56: typedef unsigned int size_t;
                     57: #define _SIZE_T_DEFINED
                     58: #endif
                     59: 
                     60: 
                     61: /* define NULL pointer value */
                     62: 
                     63: #ifndef NULL
                     64: #ifdef __cplusplus
                     65: #define NULL   0
                     66: #else
                     67: #define NULL   ((void *)0)
                     68: #endif
                     69: #endif
                     70: 
                     71: 
                     72: #ifndef _TM_DEFINED
                     73: struct tm {
                     74:        int tm_sec;     /* seconds after the minute - [0,59] */
                     75:        int tm_min;     /* minutes after the hour - [0,59] */
                     76:        int tm_hour;    /* hours since midnight - [0,23] */
                     77:        int tm_mday;    /* day of the month - [1,31] */
                     78:        int tm_mon;     /* months since January - [0,11] */
                     79:        int tm_year;    /* years since 1900 */
                     80:        int tm_wday;    /* days since Sunday - [0,6] */
                     81:        int tm_yday;    /* days since January 1 - [0,365] */
                     82:        int tm_isdst;   /* daylight savings time flag */
                     83:        };
                     84: #define _TM_DEFINED
                     85: #endif
                     86: 
                     87: 
                     88: /* clock ticks macro - ANSI version */
                     89: 
                     90: #define CLOCKS_PER_SEC 1000
                     91: 
                     92: 
                     93: /* extern declarations for the global variables used by the ctime family of
                     94:  * routines.
                     95:  */
                     96: 
1.1.1.2   root       97: #ifdef _DLL
                     98: 
                     99: #define _daylight   (*_daylight_dll)
                    100: #define _timezone   (*_timezone_dll)
                    101: 
                    102: /* non-zero if daylight savings time is used */
                    103: extern int * _daylight_dll;
                    104: 
                    105: /* difference in seconds between GMT and local time */
                    106: extern long * _timezone_dll;
                    107: 
                    108: /* standard/daylight savings time zone names */
                    109: extern char ** _tzname;
                    110: 
                    111: #else
                    112: 
                    113: 
                    114: #ifdef _POSIX_
                    115: extern char * _rule;
                    116: #endif
                    117: 
1.1       root      118: /* non-zero if daylight savings time is used */
                    119: extern int _daylight;
                    120: 
                    121: /* difference in seconds between GMT and local time */
                    122: extern long _timezone;
                    123: 
                    124: /* standard/daylight savings time zone names */
1.1.1.2   root      125: #ifdef _POSIX_
1.1.1.4 ! root      126: extern char * tzname[2];
1.1.1.3   root      127: #else
1.1       root      128: extern char * _tzname[2];
1.1.1.3   root      129: #endif
1.1       root      130: 
1.1.1.2   root      131: #endif
1.1       root      132: 
                    133: /* function prototypes */
                    134: 
1.1.1.3   root      135: char * _CRTAPI1 asctime(const struct tm *);
                    136: char * _CRTAPI1 ctime(const time_t *);
                    137: clock_t _CRTAPI1 clock(void);
                    138: double _CRTAPI1 difftime(time_t, time_t);
                    139: struct tm * _CRTAPI1 gmtime(const time_t *);
                    140: struct tm * _CRTAPI1 localtime(const time_t *);
                    141: time_t _CRTAPI1 mktime(struct tm *);
                    142: size_t _CRTAPI1 strftime(char *, size_t, const char *, const struct tm *);
                    143: char * _CRTAPI1 _strdate(char *);
                    144: char * _CRTAPI1 _strtime(char *);
                    145: time_t _CRTAPI1 time(time_t *);
1.1.1.2   root      146: #ifdef _POSIX_
1.1.1.3   root      147: void _CRTAPI1 tzset(void);
1.1.1.2   root      148: #else
1.1.1.3   root      149: void _CRTAPI1 _tzset(void);
1.1.1.2   root      150: #endif
1.1.1.3   root      151: unsigned _CRTAPI1 _getsystime(struct tm *);
                    152: unsigned _CRTAPI1 _setsystime(struct tm *, unsigned);
1.1       root      153: 
1.1.1.4 ! root      154: #if  !__STDC__
        !           155: #ifndef _SIZE_T_DEFINED
        !           156: typedef unsigned int size_t;
        !           157: #define _SIZE_T_DEFINED
        !           158: #endif
        !           159: 
        !           160: #ifndef _WCHAR_T_DEFINED
        !           161: typedef unsigned short wchar_t;
        !           162: #define _WCHAR_T_DEFINED
        !           163: #endif
        !           164: 
        !           165: #ifndef _WTIME_DEFINED
        !           166: size_t _CRTAPI1 wcsftime(wchar_t *, size_t, const char *, const struct tm *);
        !           167: #define _WTIME_DEFINED
        !           168: #endif
        !           169: #endif /* __STDC__ */
1.1       root      170: 
1.1.1.2   root      171: #if  !__STDC__ || defined(_POSIX_)
1.1       root      172: /* Non-ANSI names for compatibility */
                    173: 
                    174: #define CLK_TCK  CLOCKS_PER_SEC
                    175: 
                    176: #define daylight _daylight
1.1.1.4 ! root      177: /* timezone cannot be #defined to _timezone because of <sys/timeb.h> */
        !           178: 
        !           179: #ifndef _POSIX_
1.1       root      180: #define tzname  _tzname
                    181: 
                    182: #define tzset   _tzset
1.1.1.4 ! root      183: #endif /* _POSIX_ */
1.1       root      184: 
                    185: #endif /* __STDC__ */
                    186: 
                    187: #ifdef __cplusplus
                    188: }
                    189: #endif
                    190: 
                    191: #define _INC_TIME
                    192: #endif /* _INC_TIME */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.