2 * Client-visible declarations for ecpglib
4 * src/interfaces/ecpg/include/ecpglib.h
12 #include "ecpg_config.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.
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;
36 #define true ((bool) 1)
40 #define false ((bool) 0)
43 #endif /* not PG_USE_STDBOOL */
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 */
74 /* define this for simplicity as well as compatibility */
76 #define SQLCODE sqlca.sqlcode
77 #define SQLSTATE sqlca.sqlstate
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);
109 #endif /* _ECPGLIB_H */