1 /* $PostgreSQL: pgsql/src/interfaces/ecpg/include/pgtypes_interval.h,v 1.14 2007/05/28 09:46:47 meskes Exp $ */
3 #ifndef PGTYPES_INTERVAL
4 #define PGTYPES_INTERVAL
6 #include <ecpg_config.h>
10 #ifdef HAVE_LONG_INT_64
12 typedef long int int64;
14 #elif defined(HAVE_LONG_LONG_INT_64)
15 /* We have working support for "long long int", use that */
18 typedef long long int int64;
20 #else /* not HAVE_LONG_INT_64 and not
21 * HAVE_LONG_LONG_INT_64 */
23 /* Won't actually work, but fall back to long int so that code compiles */
25 typedef long int int64;
28 #define INT64_IS_BUSTED
29 #endif /* not HAVE_LONG_INT_64 and not
30 * HAVE_LONG_LONG_INT_64 */
33 #if defined(USE_INTEGER_DATETIMES) && !defined(INT64_IS_BUSTED)
34 #define HAVE_INT64_TIMESTAMP
39 #ifdef HAVE_INT64_TIMESTAMP
40 int64 time; /* all time units other than months and years */
42 double time; /* all time units other than months and years */
44 long month; /* months and years, after time for alignment */
52 extern interval *PGTYPESinterval_new(void);
53 extern void PGTYPESinterval_free(interval *);
54 extern interval *PGTYPESinterval_from_asc(char *, char **);
55 extern char *PGTYPESinterval_to_asc(interval *);
56 extern int PGTYPESinterval_copy(interval *, interval *);
62 #endif /* PGTYPES_INTERVAL */