1/* src/interfaces/ecpg/pgtypeslib/pgtypeslib_extern.h */
2
3#ifndef _ECPG_PGTYPESLIB_EXTERN_H
4#define _ECPG_PGTYPESLIB_EXTERN_H
5
6#include "pgtypes_error.h"
7
8/* These are the constants that decide which printf() format we'll use in
9 * order to get a string representation of the value */
10#define PGTYPES_TYPE_NOTHING 0
11#define PGTYPES_TYPE_STRING_MALLOCED 1
12#define PGTYPES_TYPE_STRING_CONSTANT 2
13#define PGTYPES_TYPE_CHAR 3
14#define PGTYPES_TYPE_DOUBLE_NF 4 /* no fractional part */
15#define PGTYPES_TYPE_INT64 5
16#define PGTYPES_TYPE_UINT 6
17#define PGTYPES_TYPE_UINT_2_LZ 7 /* 2 digits, pad with leading zero */
18#define PGTYPES_TYPE_UINT_2_LS 8 /* 2 digits, pad with leading
19 * space */
20#define PGTYPES_TYPE_UINT_3_LZ 9
21#define PGTYPES_TYPE_UINT_4_LZ 10
22#define PGTYPES_TYPE_UINT_LONG 11
23
24#define PGTYPES_FMT_NUM_MAX_DIGITS 40
25
26union un_fmt_comb
27{
28 char *str_val;
29 unsigned int uint_val;
30 char char_val;
31 unsigned long int luint_val;
32 double double_val;
33 int64 int64_val;
34};
35
36int pgtypes_fmt_replace(union un_fmt_comb, int, char **, int *);
37
38char *pgtypes_alloc(long);
39char *pgtypes_strdup(const char *);
40
41#ifndef bool
42#define bool char
43#endif /* ndef bool */
44
45#ifndef FALSE
46#define FALSE 0
47#endif /* FALSE */
48
49#ifndef TRUE
50#define TRUE 1
51#endif /* TRUE */
52
53#endif /* _ECPG_PGTYPESLIB_EXTERN_H */
54