Header And Logo

PostgreSQL
| The world's most advanced open source database.

pgtypes_interval.h

Go to the documentation of this file.
00001 /* src/interfaces/ecpg/include/pgtypes_interval.h */
00002 
00003 #ifndef PGTYPES_INTERVAL
00004 #define PGTYPES_INTERVAL
00005 
00006 #include <ecpg_config.h>
00007 
00008 #ifndef C_H
00009 
00010 #ifdef HAVE_LONG_INT_64
00011 #ifndef HAVE_INT64
00012 typedef long int int64;
00013 #endif
00014 #elif defined(HAVE_LONG_LONG_INT_64)
00015 #ifndef HAVE_INT64
00016 typedef long long int int64;
00017 #endif
00018 #else
00019 /* neither HAVE_LONG_INT_64 nor HAVE_LONG_LONG_INT_64 */
00020 #error must have a working 64-bit integer datatype
00021 #endif
00022 
00023 #ifdef USE_INTEGER_DATETIMES
00024 #define HAVE_INT64_TIMESTAMP
00025 #endif
00026 #endif   /* C_H */
00027 
00028 typedef struct
00029 {
00030 #ifdef HAVE_INT64_TIMESTAMP
00031     int64       time;           /* all time units other than months and years */
00032 #else
00033     double      time;           /* all time units other than months and years */
00034 #endif
00035     long        month;          /* months and years, after time for alignment */
00036 }   interval;
00037 
00038 #ifdef __cplusplus
00039 extern      "C"
00040 {
00041 #endif
00042 
00043 extern interval *PGTYPESinterval_new(void);
00044 extern void PGTYPESinterval_free(interval *);
00045 extern interval *PGTYPESinterval_from_asc(char *, char **);
00046 extern char *PGTYPESinterval_to_asc(interval *);
00047 extern int  PGTYPESinterval_copy(interval *, interval *);
00048 
00049 #ifdef __cplusplus
00050 }
00051 #endif
00052 
00053 #endif   /* PGTYPES_INTERVAL */