1 // This file is under GNU General Public License 3.0
7 #include "dynamic_api.h"
15 // this struct is compatible to struct tm
16 typedef struct _timestamp {
26 long tm_gmtoff; // offset from GMT in seconds
29 // for time values all functions are using POSIX struct tm
30 typedef struct tm timestamp;
33 // new_timestamp() - allocate a new timestamp
36 // clock (in) initial value or 0 if not available
39 // pointer to timestamp object or NULL if out of memory
41 DYNAMIC_API timestamp * new_timestamp(time_t clock);
44 // free_timestamp() - free memory occupied by timestamp
47 // ts (in) pointer to timestamp to free
49 DYNAMIC_API void free_timestamp(timestamp *ts);
52 // timestamp_dup() - duplicate a timestamp
55 // src (in) pointer to timestamp to duplicate
58 // pointer to copy or NULL if out of memory
60 DYNAMIC_API timestamp * timestamp_dup(const timestamp *src);