X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=includes%2Ftime.h;h=b707a31c1f1dff2cee56f4c933ee83a240b83a54;hb=refs%2Ftags%2FOLD;hp=aeda70f71005f2a4c4ef238a167d31fbe1324a05;hpb=1e221deb9ee725a14b3656f94e2763f8faeb18dc;p=pdclib diff --git a/includes/time.h b/includes/time.h index aeda70f..b707a31 100644 --- a/includes/time.h +++ b/includes/time.h @@ -1,15 +1,56 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Provides a time datatype and time handling functions. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $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 +#ifndef _TIME_H +#define _TIME_H _TIME_H -// TODO +#ifndef _NULL +#include "__intern.h" +#endif -#endif // __TIME_H +/* TODO: Documentation. */ + +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ + +#define NULL _NULL + +#define CLOCKS_PER_SEC /* TODO - to __intern.h / __personality.h? */ + +/* ---------------------------------------------------------------------------- + * TYPES + * --------------------------------------------------------------------------*/ + +/* TODO: Get struct tm into __intern.h */ + +#ifndef _SIZE_T +#define _SIZE_T _SIZE_T +typedef __size_t size_t; +#endif /* _SIZE_T */ + +typedef clock_t; /* TODO - to __intern.h / __personality.h? */ +typedef time_t; /* TODO - to __intern.h / __personality.h? */ + +/* ---------------------------------------------------------------------------- + * 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 */