?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*-------------------------------------------------------------------------
  2.    time.h
  3.  
  4.    Copyright (C) 2001, Johan Knol <johan.knol AT iduna.nl>
  5.  
  6.    This library is free software; you can redistribute it and/or modify it
  7.    under the terms of the GNU General Public License as published by the
  8.    Free Software Foundation; either version 2, or (at your option) any
  9.    later version.
  10.  
  11.    This library is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14.    GNU General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with this library; see the file COPYING. If not, write to the
  18.    Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
  19.    MA 02110-1301, USA.
  20.  
  21.    As a special exception, if you link this library with other files,
  22.    some of which are compiled with SDCC, to produce an executable,
  23.    this library does not by itself cause the resulting executable to
  24.    be covered by the GNU General Public License. This exception does
  25.    not however invalidate any other reasons why the executable file
  26.    might be covered by the GNU General Public License.
  27. -------------------------------------------------------------------------*/
  28.  
  29. #ifndef TIME_H
  30. #define TIME_H
  31.  
  32. #ifndef __TIME_UNSIGNED
  33. #define __TIME_UNSIGNED 1
  34. #endif
  35.  
  36. /* Bounds-checking interfaces from annex K of the C11 standard. */
  37. #if defined (__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__
  38.  
  39. #ifndef __RSIZE_T_DEFINED
  40. #define __RSIZE_T_DEFINED
  41. typedef size_t rsize_t;
  42. #endif
  43.  
  44. #ifndef __ERRNO_T_DEFINED
  45. #define __ERRNO_T_DEFINED
  46. typedef int errno_t;
  47. #endif
  48.  
  49. #endif
  50.  
  51. #if __TIME_UNSIGNED
  52. struct tm
  53. {
  54.   unsigned char tm_sec;                   /* Seconds.     [0-60]      */
  55.   unsigned char tm_min;                   /* Minutes.     [0-59]      */
  56.   unsigned char tm_hour;                  /* Hours.       [0-23]      */
  57.   unsigned char tm_mday;                  /* Day.         [1-31]      */
  58.   unsigned char tm_mon;                   /* Month.       [0-11]      */
  59.   int tm_year;                            /* Year since 1900          */
  60.   unsigned char tm_wday;                  /* Day of week. [0-6]       */
  61.   int tm_yday;                            /* Days in year.[0-365]     */
  62.   unsigned char tm_isdst;                 /* Daylight saving time     */
  63.   unsigned char tm_hundredth;             /* not standard 1/100th sec */
  64. };
  65. #else
  66. struct tm
  67. {
  68.   int tm_sec;                   /* Seconds.     [0-60]  */
  69.   int tm_min;                   /* Minutes.     [0-59]  */
  70.   int tm_hour;                  /* Hours.       [0-23]  */
  71.   int tm_mday;                  /* Day.         [1-31]  */
  72.   int tm_mon;                   /* Month.       [0-11]  */
  73.   int tm_year;                  /* Year since 1900      */
  74.   int tm_wday;                  /* Day of week. [0-6]   */
  75.   int tm_yday;                  /* Days in year.[0-365] */
  76.   int tm_isdst;                 /* Daylight saving time */
  77.   char *tm_zone;                /* Abbreviated timezone */
  78. };
  79. #endif
  80.  
  81. typedef unsigned long time_t;
  82.  
  83. time_t time(time_t *t);
  84. struct tm *gmtime(time_t *timep);
  85. struct tm *localtime(time_t *timep);
  86. time_t mktime(struct tm *timeptr);
  87. char *asctime(struct tm *timeptr);
  88. char *ctime(time_t *timep);
  89.  
  90. #endif /* TIME_H */
  91.