aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/include/pgtypes_interval.h
blob: f0acbb4512affff649d3f7f5ca244d41cfcf1e92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* src/interfaces/ecpg/include/pgtypes_interval.h */

#ifndef PGTYPES_INTERVAL
#define PGTYPES_INTERVAL

#include <stdint.h>

#include <ecpg_config.h>
#include <pgtypes.h>

#ifndef C_H

typedef int64_t int64;

#define HAVE_INT64_TIMESTAMP

#endif							/* C_H */

typedef struct
{
	int64		time;			/* all time units other than months and years */
	long		month;			/* months and years, after time for alignment */
}			interval;

#ifdef __cplusplus
extern "C"
{
#endif

extern interval * PGTYPESinterval_new(void);
extern void PGTYPESinterval_free(interval * intvl);
extern interval * PGTYPESinterval_from_asc(char *str, char **endptr);
extern char *PGTYPESinterval_to_asc(interval * span);
extern int	PGTYPESinterval_copy(interval * intvlsrc, interval * intvldest);

#ifdef __cplusplus
}
#endif

#endif							/* PGTYPES_INTERVAL */