]> granicus.if.org Git - postgresql/blob - src/interfaces/ecpg/include/ecpglib.h
679ff1a7638477346e88d74950b6c6d2d1439a3b
[postgresql] / src / interfaces / ecpg / include / ecpglib.h
1 /*
2  * this is a small part of c.h since we don't want to leak all postgres
3  * definitions into ecpg programs
4  */
5
6 #ifndef _ECPGLIB_H
7 #define _ECPGLIB_H
8
9 #include <stdio.h>
10
11 #ifndef __BEOS__
12 #ifndef __cplusplus
13 #ifndef bool
14 #define bool char
15 #endif   /* ndef bool */
16
17 #ifndef true
18 #define true    ((bool) 1)
19 #endif   /* ndef true */
20 #ifndef false
21 #define false   ((bool) 0)
22 #endif   /* ndef false */
23 #endif   /* not C++ */
24 #else                                                   /* __BEOS__ */
25 #include <SupportDefs.h>
26 #endif   /* __BEOS__ */
27
28 #ifndef TRUE
29 #define TRUE    1
30 #endif   /* TRUE */
31
32 #ifndef FALSE
33 #define FALSE   0
34 #endif   /* FALSE */
35
36 #ifdef __cplusplus
37 extern          "C"
38 {
39 #endif
40
41 void            ECPGdebug(int, FILE *);
42 bool            ECPGstatus(int, const char *);
43 bool            ECPGsetcommit(int, const char *, const char *);
44 bool            ECPGsetconn(int, const char *);
45 bool            ECPGconnect_informix(int, const char *, const char *, const char *, const char *, int);
46 bool            ECPGconnect(int, const char *, const char *, const char *, const char *, int);
47 bool            ECPGdo(int, const char *, char *,...);
48 bool            ECPGtrans(int, const char *, const char *);
49 bool            ECPGdisconnect(int, const char *);
50 bool            ECPGprepare(int, char *, char *);
51 bool            ECPGdeallocate(int, char *);
52 bool            ECPGdeallocate_all(int);
53 char           *ECPGprepared_statement(char *);
54
55 void            ECPGlog(const char *format,...);
56 char           *ECPGerrmsg(void);
57
58  /* print an error message */
59 void            sqlprint(void);
60
61 /* define this for simplicity as well as compatibility */
62
63 #define           SQLCODE        sqlca.sqlcode
64
65 /* dynamic SQL */
66
67 bool ECPGdo_descriptor(int line, const char *connection,
68                                   const char *descriptor, const char *query);
69 bool            ECPGdeallocate_desc(int line, const char *name);
70 bool            ECPGallocate_desc(int line, const char *name);
71 void            ECPGraise(int line, int code, const char *str);
72 bool            ECPGget_desc_header(int, char *, int *);
73 bool            ECPGget_desc(int, char *, int,...);
74
75 bool            ECPGdescribe(int, bool, const char *, ...);
76
77 /* dynamic result allocation */
78 void            ECPGfree_auto_mem(void);
79
80 enum COMPAT_MODE { ECPG_COMPAT_PGSQL = 0, ECPG_COMPAT_INFORMIX};
81
82 #ifdef __cplusplus
83 }
84
85 #endif
86
87 #endif /* _ECPGLIB_H */