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 |
13 | typedef long int int64; |
14 | #endif |
15 | #elif defined(HAVE_LONG_LONG_INT_64) |
16 | #ifndef HAVE_INT64 |
17 | typedef 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 | |
27 | typedef 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 |
34 | extern "C" |
35 | { |
36 | #endif |
37 | |
38 | extern interval * PGTYPESinterval_new(void); |
39 | extern void PGTYPESinterval_free(interval *); |
40 | extern interval * PGTYPESinterval_from_asc(char *, char **); |
41 | extern char *PGTYPESinterval_to_asc(interval *); |
42 | extern int PGTYPESinterval_copy(interval *, interval *); |
43 | |
44 | #ifdef __cplusplus |
45 | } |
46 | #endif |
47 | |
48 | #endif /* PGTYPES_INTERVAL */ |
49 | |