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 #ifdef USE_INTEGER_DATETIMES
24 #define HAVE_INT64_TIMESTAMP
25 #endif
26 #endif /* C_H */
27 
28 typedef struct
29 {
30 #ifdef HAVE_INT64_TIMESTAMP
31  int64 time; /* all time units other than months and years */
32 #else
33  double time; /* all time units other than months and years */
34 #endif
35  long month; /* months and years, after time for alignment */
36 } interval;
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
43 extern interval *PGTYPESinterval_new(void);
44 extern void PGTYPESinterval_free(interval *);
45 extern interval *PGTYPESinterval_from_asc(char *, char **);
46 extern char *PGTYPESinterval_to_asc(interval *);
47 extern int PGTYPESinterval_copy(interval *, interval *);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif /* PGTYPES_INTERVAL */
int PGTYPESinterval_copy(interval *, interval *)
Definition: interval.c:1158
void PGTYPESinterval_free(interval *)
Definition: interval.c:1069
interval * PGTYPESinterval_from_asc(char *, char **)
Definition: interval.c:1075
char * PGTYPESinterval_to_asc(interval *)
Definition: interval.c:1134
interval * PGTYPESinterval_new(void)
Definition: interval.c:1059