home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / INCLUDE / TIME.H < prev    next >
Text File  |  1993-09-17  |  4KB  |  115 lines

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