Harmonize parameter names in ecpg code.
[pgsql.git] / src / interfaces / ecpg / include / ecpglib.h
blob21a213448306ce13e32c0821c7388bd295f90a90
1 /*
2 * Client-visible declarations for ecpglib
4 * src/interfaces/ecpg/include/ecpglib.h
5 */
7 #ifndef _ECPGLIB_H
8 #define _ECPGLIB_H
10 #include <string.h>
12 #include "ecpg_config.h"
13 #include "ecpgtype.h"
14 #include "libpq-fe.h"
15 #include "sqlca.h"
18 * This is a small extract from c.h since we don't want to leak all postgres
19 * definitions into ecpg programs; but we need to know what bool is.
21 #ifndef __cplusplus
23 #ifdef PG_USE_STDBOOL
24 #include <stdbool.h>
25 #else
28 * We assume bool has been defined if true and false are. This avoids
29 * duplicate-typedef errors if this file is included after c.h.
31 #if !(defined(true) && defined(false))
32 typedef unsigned char bool;
33 #endif
35 #ifndef true
36 #define true ((bool) 1)
37 #endif
39 #ifndef false
40 #define false ((bool) 0)
41 #endif
43 #endif /* not PG_USE_STDBOOL */
44 #endif /* not C++ */
47 #ifdef __cplusplus
48 extern "C"
50 #endif
52 void ECPGdebug(int n, FILE *dbgs);
53 bool ECPGstatus(int lineno, const char *connection_name);
54 bool ECPGsetcommit(int lineno, const char *mode, const char *connection_name);
55 bool ECPGsetconn(int lineno, const char *connection_name);
56 bool ECPGconnect(int lineno, int c, const char *name, const char *user,
57 const char *passwd, const char *connection_name, int autocommit);
58 bool ECPGdo(const int lineno, const int compat, const int force_indicator,
59 const char *connection_name, const bool questionmarks,
60 const int st, const char *query,...);
61 bool ECPGtrans(int lineno, const char *connection_name, const char *transaction);
62 bool ECPGdisconnect(int lineno, const char *connection_name);
63 bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks,
64 const char *name, const char *variable);
65 bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name);
66 bool ECPGdeallocate_all(int lineno, int compat, const char *connection_name);
67 char *ECPGprepared_statement(const char *connection_name, const char *name, int lineno);
68 PGconn *ECPGget_PGconn(const char *connection_name);
69 PGTransactionStatusType ECPGtransactionStatus(const char *connection_name);
71 /* print an error message */
72 void sqlprint(void);
74 /* define this for simplicity as well as compatibility */
76 #define SQLCODE sqlca.sqlcode
77 #define SQLSTATE sqlca.sqlstate
79 /* dynamic SQL */
81 bool ECPGdo_descriptor(int line, const char *connection,
82 const char *descriptor, const char *query);
83 bool ECPGdeallocate_desc(int line, const char *name);
84 bool ECPGallocate_desc(int line, const char *name);
85 bool ECPGget_desc_header(int lineno, const char *desc_name, int *count);
86 bool ECPGget_desc(int lineno, const char *desc_name, int index,...);
87 bool ECPGset_desc_header(int lineno, const char *desc_name, int count);
88 bool ECPGset_desc(int lineno, const char *desc_name, int index,...);
90 void ECPGset_noind_null(enum ECPGttype type, void *ptr);
91 bool ECPGis_noind_null(enum ECPGttype type, const void *ptr);
92 bool ECPGdescribe(int line, int compat, bool input,
93 const char *connection_name, const char *stmt_name,...);
95 void ECPGset_var(int number, void *pointer, int lineno);
96 void *ECPGget_var(int number);
98 /* dynamic result allocation */
99 void ECPGfree_auto_mem(void);
101 #ifdef ENABLE_THREAD_SAFETY
102 void ecpg_pthreads_init(void);
103 #endif
105 #ifdef __cplusplus
107 #endif
109 #endif /* _ECPGLIB_H */