PostgreSQL Source Code  git master
pgtypes_interval.h
Go to the documentation of this file.
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 * intvl);
40 extern interval * PGTYPESinterval_from_asc(char *str, char **endptr);
41 extern char *PGTYPESinterval_to_asc(interval * span);
42 extern int PGTYPESinterval_copy(interval * intvlsrc, interval * intvldest);
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 #endif /* PGTYPES_INTERVAL */
const char * str
void PGTYPESinterval_free(interval *intvl)
Definition: interval.c:997
char * PGTYPESinterval_to_asc(interval *span)
Definition: interval.c:1062
int PGTYPESinterval_copy(interval *intvlsrc, interval *intvldest)
Definition: interval.c:1082
interval * PGTYPESinterval_new(void)
Definition: interval.c:987
interval * PGTYPESinterval_from_asc(char *str, char **endptr)
Definition: interval.c:1003