PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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 
8 #ifndef C_H
9 
10 #ifdef HAVE_LONG_INT_64
11 #ifndef HAVE_INT64
12 typedef long int int64;
13 #endif
14 #elif defined(HAVE_LONG_LONG_INT_64)
15 #ifndef HAVE_INT64
16 typedef long long int int64;
17 #endif
18 #else
19 /* neither HAVE_LONG_INT_64 nor HAVE_LONG_LONG_INT_64 */
20 #error must have a working 64-bit integer datatype
21 #endif
22 
23 #define HAVE_INT64_TIMESTAMP
24 #endif /* C_H */
25 
26 typedef struct
27 {
28  int64 time; /* all time units other than months and years */
29  long month; /* months and years, after time for alignment */
30 } interval;
31 
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36 
37 extern interval *PGTYPESinterval_new(void);
38 extern void PGTYPESinterval_free(interval *);
39 extern interval *PGTYPESinterval_from_asc(char *, char **);
40 extern char *PGTYPESinterval_to_asc(interval *);
41 extern int PGTYPESinterval_copy(interval *, interval *);
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 
47 #endif /* PGTYPES_INTERVAL */
int PGTYPESinterval_copy(interval *, interval *)
Definition: interval.c:1104
void PGTYPESinterval_free(interval *)
Definition: interval.c:1015
interval * PGTYPESinterval_from_asc(char *, char **)
Definition: interval.c:1021
char * PGTYPESinterval_to_asc(interval *)
Definition: interval.c:1080
interval * PGTYPESinterval_new(void)
Definition: interval.c:1005