1/* src/interfaces/ecpg/include/pgtypes_interval.h */
2
3#ifndef PGTYPES_INTERVAL
4#define PGTYPES_INTERVAL
5
6#include <ecpg_config.h>
7#include <pgtypes.h>
8
9#ifndef C_H
10
11#ifdef HAVE_LONG_INT_64
12#ifndef HAVE_INT64
13typedef long int int64;
14#endif
15#elif defined(HAVE_LONG_LONG_INT_64)
16#ifndef HAVE_INT64
17typedef long long int int64;
18#endif
19#else
20/* neither HAVE_LONG_INT_64 nor HAVE_LONG_LONG_INT_64 */
21#error must have a working 64-bit integer datatype
22#endif
23
24#define HAVE_INT64_TIMESTAMP
25#endif /* C_H */
26
27typedef struct
28{
29 int64 time; /* all time units other than months and years */
30 long month; /* months and years, after time for alignment */
31} interval;
32
33#ifdef __cplusplus
34extern "C"
35{
36#endif
37
38extern interval * PGTYPESinterval_new(void);
39extern void PGTYPESinterval_free(interval *);
40extern interval * PGTYPESinterval_from_asc(char *, char **);
41extern char *PGTYPESinterval_to_asc(interval *);
42extern int PGTYPESinterval_copy(interval *, interval *);
43
44#ifdef __cplusplus
45}
46#endif
47
48#endif /* PGTYPES_INTERVAL */
49