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

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