src/timestamp.h
author Krista Bennett <krista@pep-project.org>
Tue, 14 Aug 2018 13:45:34 +0200
branchENGINE-451
changeset 2826 07c080d73a63
parent 1513 e7f7e42385b5
permissions -rw-r--r--
ENGINE-451: abandoning branch - config files to be dealt with using gpgme (and hotfix will be external to engine
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 #pragma once
     5 
     6 #include <time.h>
     7 #include "dynamic_api.h"
     8 
     9 #ifdef __cplusplus
    10 extern "C" {
    11 #endif
    12 
    13 
    14 // for time values all functions are using POSIX struct tm
    15 
    16 typedef struct tm timestamp;
    17 
    18 
    19 // new_timestamp() - allocate a new timestamp
    20 //
    21 //  parameters:
    22 //      clock (in)      initial value or 0 if not available
    23 //
    24 //  return value:
    25 //      pointer to timestamp object or NULL if out of memory
    26 
    27 DYNAMIC_API timestamp * new_timestamp(time_t clock);
    28 
    29 
    30 // free_timestamp() - free memory occupied by timestamp
    31 //
    32 //  parameters:
    33 //      ts (in)         pointer to timestamp to free
    34 
    35 DYNAMIC_API void free_timestamp(timestamp *ts);
    36 
    37 
    38 // timestamp_dup() - duplicate a timestamp
    39 //
    40 //  parameters:
    41 //      src (in)        pointer to timestamp to duplicate
    42 //
    43 //  return value:
    44 //      pointer to copy or NULL if out of memory
    45 
    46 DYNAMIC_API timestamp * timestamp_dup(const timestamp *src);
    47 
    48 
    49 #ifdef __cplusplus
    50 }
    51 #endif
    52