]> pd.if.org Git - pdclib/blobdiff - includes/time.h
<time.h>: define timespec_get, TIME_UTC, to support <threads.h> implementations
[pdclib] / includes / time.h
index bc5742c8a5ced53370e20d76829b7e8c785e8904..41075dbc81c9f71d090db9e878ed9041d24945f1 100644 (file)
@@ -1,43 +1,36 @@
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Date and time
-// ----------------------------------------------------------------------------
-
-#ifndef __TIME_H
-#define __TIME_H __TIME_H
-
-// TODO: Documentation.
-
-// ----------------------------------------------------------------------------
-// MACROS
-
-#define CLOCKS_PER_SEC // TODO - personality?
-#define NULL           0
-
-// ----------------------------------------------------------------------------
-// TYPES
-
-typedef clock_t; // TODO - personality?
-typedef size_t;  // TODO - personality?
-typedef time_t;  // TODO - personality?
-struct tm;       // TODO - personality?
-
-// ----------------------------------------------------------------------------
-// FUNCTIONS
-
-char * asctime( const struct tm * tptr );
-clock_t clock( void );
-char * ctime( const time_t * tod );
-double difftime( time_t t1, time_t t0 );
-struct tm * gmtime( const time_t * tod );
-struct tm * localtime( const time_t * tod );
-time_t mktime( struct tm * tptr );
-size_t strftime( char * restrict s, size_t n, const char * restrict format,
-                 const struct tm * restrict tptr );
-time_t time( time_t * tod );
-
-#endif // __TIME_H
+#ifndef _PDCLIB_TIME_H\r
+#define _PDCLIB_TIME_H\r
+#include <_PDCLIB_aux.h>\r
+#include <_PDCLIB_int.h>\r
+\r
+_PDCLIB_BEGIN_EXTERN_C\r
+#ifndef _PDCLIB_SIZE_T_DEFINED\r
+#define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED\r
+typedef _PDCLIB_size_t size_t;\r
+#endif\r
+\r
+#ifndef _PDCLIB_NULL_DEFINED\r
+#define _PDCLIB_NULL_DEFINED _PDCLIB_NULL_DEFINED\r
+#define NULL _PDCLIB_NULL\r
+#endif\r
+\r
+typedef _PDCLIB_time_t  time_t;\r
+typedef _PDCLIB_clock_t clock_t;\r
+\r
+#define TIME_UTC _PDCLIB_TIME_UTC\r
+\r
+#ifndef _PDCLIB_STRUCT_TIMESPEC_DEFINED\r
+#define _PDCLIB_STRUCT_TIMESPEC_DEFINED\r
+_PDCLIB_DEFINE_STRUCT_TIMESPEC()\r
+#endif\r
+\r
+#ifndef _PDCLIB_STRUCT_TM_DEFINED\r
+#define _PDCLIB_STRUCT_TM_DEFINED\r
+_PDCLIB_DEFINE_STRUCT_TM()\r
+#endif\r
+\r
+time_t time( time_t* t ) _PDCLIB_nothrow;\r
+int timespec_get( struct timespec *ts, int base ) _PDCLIB_nothrow;\r
+\r
+_PDCLIB_END_EXTERN_C\r
+#endif\r