home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / detk45he.zip / libc / time.h < prev    next >
Text File  |  1999-03-15  |  4KB  |  137 lines

  1. #if __IBMC__ || __IBMCPP__
  2. #pragma info( none )
  3. #ifndef __CHKHDR__
  4.    #pragma info( none )
  5. #endif
  6. #pragma info( restore )
  7. #endif
  8.  
  9. #ifndef __time_h
  10.    #define __time_h
  11.  
  12.    #ifdef __cplusplus
  13.       extern "C" {
  14.    #endif
  15.  
  16.    #ifndef  _LNK_CONV
  17.       #if __IBMC__ || __IBMCPP__ || defined(_OPTLINK_SUPPORTED)
  18.          #define _LNK_CONV   _Optlink
  19.       #else
  20.          #define _LNK_CONV
  21.       #endif
  22.    #endif
  23.  
  24.    #ifndef _IMPORT
  25.       #ifdef __IMPORTLIB__
  26.          #define _IMPORT _Import
  27.       #else
  28.          #define _IMPORT
  29.       #endif
  30.    #endif
  31.  
  32.    /********************************************************************/
  33.    /*  <time.h> header file                                            */
  34.    /*                                                                  */
  35.    /*  (C) Copyright IBM Corp. 1991, 1995.                             */
  36.    /*  - Licensed Material - Program-Property of IBM                   */
  37.    /*  - All rights reserved                                           */
  38.    /*                                                                  */
  39.    /********************************************************************/
  40.  
  41.    #ifndef NULL
  42.       #if (defined(__EXTENDED__)  || defined( __cplusplus ))
  43.          #define NULL 0
  44.       #else
  45.          #define NULL ((void *)0)
  46.       #endif
  47.    #endif
  48.  
  49.    #define CLOCKS_PER_SEC 1000
  50.  
  51.    #ifndef __size_t
  52.       #define __size_t
  53.       typedef unsigned int size_t;
  54.    #endif
  55.  
  56.    typedef unsigned long clock_t;
  57.  
  58.    #ifndef __time_t
  59.       #define __time_t
  60.       typedef long time_t;
  61.    #endif
  62.  
  63.    #ifndef __tm_t
  64.       #define __tm_t
  65.       struct tm
  66.          {
  67.          int tm_sec;      /* seconds after the minute [0-61]        */
  68.          int tm_min;      /* minutes after the hour [0-59]          */
  69.          int tm_hour;     /* hours since midnight [0-23]            */
  70.          int tm_mday;     /* day of the month [1-31]                */
  71.          int tm_mon;      /* months since January [0-11]            */
  72.          int tm_year;     /* years since 1900                       */
  73.          int tm_wday;     /* days since Sunday [0-6]                */
  74.          int tm_yday;     /* days since January 1 [0-365]           */
  75.          int tm_isdst;    /* Daylight Saving Time flag              */
  76.       };
  77.    #endif
  78.  
  79.    extern clock_t     _IMPORT _LNK_CONV clock( void );
  80.    extern double      _IMPORT _LNK_CONV difftime( time_t, time_t );
  81.    extern time_t      _IMPORT _LNK_CONV mktime( struct tm * );
  82.    extern time_t      _IMPORT _LNK_CONV time( time_t * );
  83.    extern char *      _IMPORT _LNK_CONV asctime( const struct tm * );
  84.    extern char *      _IMPORT _LNK_CONV ctime( const time_t * );
  85.    extern struct tm * _IMPORT _LNK_CONV gmtime( const time_t * );
  86.    extern struct tm * _IMPORT _LNK_CONV localtime( const time_t * );
  87.    extern size_t      _IMPORT _LNK_CONV strftime( char *, size_t, const char *, const struct tm * );
  88.    extern void        _IMPORT _LNK_CONV _tzset( void );
  89.    extern char *      _IMPORT _LNK_CONV _strdate( char * );
  90.    extern char *      _IMPORT _LNK_CONV _strtime( char * );
  91.  
  92.    #ifdef __EXTENDED__
  93.       extern char *    _IMPORT _LNK_CONV strptime(const char *, const char *, struct tm *);
  94.    #endif
  95.  
  96.    #ifndef _WIN32S
  97.       extern int  _IMPORT _daylight; /* non-zero if daylight savings time is used */
  98.       extern long _IMPORT _timezone; /* difference in seconds between UCT and local time */
  99.       extern char * _IMPORT _tzname[2]; /* std/daylight savings time zone names  */
  100.    #endif
  101.  
  102.    #define difftime( t1, t0 ) ((double)((t1) - (t0)))
  103.    #define ctime( t ) (asctime(localtime(t)))
  104.  
  105.    #ifndef __ANSI__
  106.  
  107.       #define CLK_TCK  CLOCKS_PER_SEC
  108.  
  109.       #ifndef __SAA_L2__
  110.  
  111.          #if defined(__EXTENDED__)
  112.  
  113.             #define daylight _daylight
  114.             #define tzname   _tzname
  115.             #define tzset( ) _tzset( )
  116.  
  117.          #endif
  118.  
  119.       #endif
  120.  
  121.    #endif
  122.  
  123.    #ifdef __cplusplus
  124.       }
  125.    #endif
  126.  
  127. #endif
  128.  
  129. #if __IBMC__ || __IBMCPP__
  130. #pragma info( none )
  131. #ifndef __CHKHDR__
  132.    #pragma info( restore )
  133. #endif
  134. #pragma info( restore )
  135. #endif
  136.  
  137.