]> pd.if.org Git - pdclib/blob - includes/time.h
Re-import from Subversion.
[pdclib] / includes / time.h
1 /* ----------------------------------------------------------------------------
2  * $Id$
3  * ----------------------------------------------------------------------------
4  * Public Domain C Library - http://pdclib.sourceforge.net
5  * This code is Public Domain. Use, modify, and redistribute at will.
6  * ----------------------------------------------------------------------------
7  * Date and time
8  * --------------------------------------------------------------------------*/
9
10 #ifndef _TIME_H
11 #define _TIME_H _TIME_H
12
13 #ifndef _NULL
14 #include "__intern.h"
15 #endif
16
17 /* TODO: Documentation. */
18
19 /* ----------------------------------------------------------------------------
20  * MACROS
21  * --------------------------------------------------------------------------*/
22
23 #define NULL _NULL
24
25 #define CLOCKS_PER_SEC /* TODO - to __intern.h / __personality.h? */
26
27 /* ----------------------------------------------------------------------------
28  * TYPES
29  * --------------------------------------------------------------------------*/
30
31 /* TODO: Get struct tm into __intern.h */
32
33 #ifndef _SIZE_T
34 #define _SIZE_T _SIZE_T
35 typedef __size_t size_t;
36 #endif /* _SIZE_T */
37
38 typedef clock_t; /* TODO - to __intern.h / __personality.h? */
39 typedef time_t;  /* TODO - to __intern.h / __personality.h? */
40
41 /* ----------------------------------------------------------------------------
42  * FUNCTIONS
43  * --------------------------------------------------------------------------*/
44
45 char * asctime( const struct tm * tptr );
46 clock_t clock( void );
47 char * ctime( const time_t * tod );
48 double difftime( time_t t1, time_t t0 );
49 struct tm * gmtime( const time_t * tod );
50 struct tm * localtime( const time_t * tod );
51 time_t mktime( struct tm * tptr );
52 size_t strftime( char * restrict s, size_t n, const char * restrict format,
53                  const struct tm * restrict tptr );
54 time_t time( time_t * tod );
55
56 #endif /* _TIME_H */