X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=includes%2Ftime.h;h=41075dbc81c9f71d090db9e878ed9041d24945f1;hp=c527cc31b68003aa1c54a89e55228da5464a25ea;hb=76ee46321244f74eee3b5df0800ffdee0e8c3c37;hpb=33ea80a48bfc48263e3cc855e7a4bfef7ebe8d98 diff --git a/includes/time.h b/includes/time.h index c527cc3..41075db 100644 --- a/includes/time.h +++ b/includes/time.h @@ -1,45 +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 - -#include "__NULL.h" - -#define CLOCKS_PER_SEC // TODO - personality? - -// ---------------------------------------------------------------------------- -// TYPES - -#include "__size_t.h" -#include "__tm.h" - -typedef clock_t; // TODO - personality? -typedef time_t; // 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 +#define _PDCLIB_TIME_H +#include <_PDCLIB_aux.h> +#include <_PDCLIB_int.h> + +_PDCLIB_BEGIN_EXTERN_C +#ifndef _PDCLIB_SIZE_T_DEFINED +#define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED +typedef _PDCLIB_size_t size_t; +#endif + +#ifndef _PDCLIB_NULL_DEFINED +#define _PDCLIB_NULL_DEFINED _PDCLIB_NULL_DEFINED +#define NULL _PDCLIB_NULL +#endif + +typedef _PDCLIB_time_t time_t; +typedef _PDCLIB_clock_t clock_t; + +#define TIME_UTC _PDCLIB_TIME_UTC + +#ifndef _PDCLIB_STRUCT_TIMESPEC_DEFINED +#define _PDCLIB_STRUCT_TIMESPEC_DEFINED +_PDCLIB_DEFINE_STRUCT_TIMESPEC() +#endif + +#ifndef _PDCLIB_STRUCT_TM_DEFINED +#define _PDCLIB_STRUCT_TM_DEFINED +_PDCLIB_DEFINE_STRUCT_TM() +#endif + +time_t time( time_t* t ) _PDCLIB_nothrow; +int timespec_get( struct timespec *ts, int base ) _PDCLIB_nothrow; + +_PDCLIB_END_EXTERN_C +#endif