home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / time.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-20  |  4.5 KB  |  146 lines

  1. #if (defined(__IBMC__) || defined(__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.       #ifdef _M_I386
  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.    /*  VisualAge for C++ for Windows, Version 3.5                      */
  36.    /*    Licensed Material - Property of IBM                           */
  37.    /*                                                                  */
  38.    /*  5801-ARR and Other Materials                                    */
  39.    /*                                                                  */
  40.    /*  (c) Copyright IBM Corp 1991, 1996. All rights reserved.         */
  41.    /*                                                                  */
  42.    /********************************************************************/
  43.  
  44.    #ifndef NULL
  45.       #if (defined(__EXTENDED__)  || defined( __cplusplus ))
  46.          #define NULL 0
  47.       #else
  48.          #define NULL ((void *)0)
  49.       #endif
  50.    #endif
  51.  
  52.    #define CLOCKS_PER_SEC 1000
  53.  
  54.    #ifndef __size_t
  55.       #define __size_t
  56.       typedef unsigned int size_t;
  57.    #endif
  58.  
  59.    typedef unsigned long clock_t;
  60.  
  61.    #ifndef __time_t
  62.       #define __time_t
  63.       typedef long time_t;
  64.    #endif
  65.  
  66.    #ifndef __tm_t
  67.       #define __tm_t
  68.       struct tm
  69.          {
  70.          int tm_sec;      /* seconds after the minute [0-61]        */
  71.          int tm_min;      /* minutes after the hour [0-59]          */
  72.          int tm_hour;     /* hours since midnight [0-23]            */
  73.          int tm_mday;     /* day of the month [1-31]                */
  74.          int tm_mon;      /* months since January [0-11]            */
  75.          int tm_year;     /* years since 1900                       */
  76.          int tm_wday;     /* days since Sunday [0-6]                */
  77.          int tm_yday;     /* days since January 1 [0-365]           */
  78.          int tm_isdst;    /* Daylight Saving Time flag              */
  79.       };
  80.    #endif
  81.  
  82.    extern clock_t     _IMPORT _LNK_CONV clock( void );
  83.    extern double      _IMPORT _LNK_CONV difftime( time_t, time_t );
  84.    extern time_t      _IMPORT _LNK_CONV mktime( struct tm * );
  85.    extern time_t      _IMPORT _LNK_CONV time( time_t * );
  86.    extern char *      _IMPORT _LNK_CONV asctime( const struct tm * );
  87.    extern char *      _IMPORT _LNK_CONV ctime( const time_t * );
  88.    extern struct tm * _IMPORT _LNK_CONV gmtime( const time_t * );
  89.    extern struct tm * _IMPORT _LNK_CONV localtime( const time_t * );
  90.    extern size_t      _IMPORT _LNK_CONV strftime( char *, size_t, const char *, const struct tm * );
  91.    extern void        _IMPORT _LNK_CONV _tzset( void );
  92.    extern char *      _IMPORT _LNK_CONV _strdate( char * );
  93.    extern char *      _IMPORT _LNK_CONV _strtime( char * );
  94.  
  95.    #ifdef __EXTENDED__
  96.      extern char *    _IMPORT _LNK_CONV strptime(const char *, const char *, struct tm *);
  97.    #endif
  98.  
  99.    #ifndef _WIN32S
  100.       extern int  _IMPORT _daylight; /* non-zero if daylight savings time is used */
  101.       extern long _IMPORT _timezone; /* difference in seconds between UCT and local time */
  102.       extern char * _IMPORT _tzname[2]; /* std/daylight savings time zone names  */
  103.    #endif
  104.  
  105. #if (defined(__IBMC__) || defined(__IBMCPP__))
  106.   #pragma info( none )
  107. #endif
  108.    #define difftime( t1, t0 ) ((double)((t1) - (t0)))
  109.    #define ctime( t ) (asctime(localtime(t)))
  110. #if (defined(__IBMC__) || defined(__IBMCPP__))
  111.   #pragma info( restore )
  112. #endif
  113.  
  114.    #ifndef __ANSI__
  115.  
  116.       #define CLK_TCK  CLOCKS_PER_SEC
  117.  
  118.       #ifndef __SAA_L2__
  119.  
  120.          #if defined(__EXTENDED__)
  121.  
  122.             #define daylight _daylight
  123.             #define tzname   _tzname
  124.             #define tzset( ) _tzset( )
  125.  
  126.          #endif
  127.  
  128.       #endif
  129.  
  130.    #endif
  131.  
  132.    #ifdef __cplusplus
  133.       }
  134.    #endif
  135.  
  136. #endif
  137.  
  138. #if (defined(__IBMC__) || defined(__IBMCPP__))
  139. #pragma info( none )
  140. #ifndef __CHKHDR__
  141.    #pragma info( restore )
  142. #endif
  143. #pragma info( restore )
  144. #endif
  145.  
  146.