| 1 |
/* |
| 2 |
* Client-visible declarations for ecpglib |
| 3 |
* |
| 4 |
* src/interfaces/ecpg/include/ecpglib.h |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef _ECPGLIB_H |
| 8 |
#define _ECPGLIB_H |
| 9 |
|
| 10 |
#include <stdbool.h> |
| 11 |
#include <string.h> |
| 12 |
|
| 13 |
#include "ecpg_config.h" |
| 14 |
#include "ecpgtype.h" |
| 15 |
#include "libpq-fe.h" |
| 16 |
#include "sqlca.h" |
| 17 |
|
| 18 |
|
| 19 |
#ifdef __cplusplus |
| 20 |
extern "C" |
| 21 |
{ |
| 22 |
#endif |
| 23 |
|
| 24 |
void ECPGdebug(int n, FILE *dbgs); |
| 25 |
bool ECPGstatus(int lineno, const char *connection_name); |
| 26 |
bool ECPGsetcommit(int lineno, const char *mode, const char *connection_name); |
| 27 |
bool ECPGsetconn(int lineno, const char *connection_name); |
| 28 |
bool ECPGconnect(int lineno, int c, const char *name, const char *user, |
| 29 |
const char *passwd, const char *connection_name, int autocommit); |
| 30 |
bool ECPGdo(const int lineno, const int compat, const int force_indicator, |
| 31 |
const char *connection_name, const bool questionmarks, |
| 32 |
const int st, const char *query,...); |
| 33 |
bool ECPGtrans(int lineno, const char *connection_name, const char *transaction); |
| 34 |
bool ECPGdisconnect(int lineno, const char *connection_name); |
| 35 |
bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, |
| 36 |
const char *name, const char *variable); |
| 37 |
bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name); |
| 38 |
bool ECPGdeallocate_all(int lineno, int compat, const char *connection_name); |
| 39 |
char *ECPGprepared_statement(const char *connection_name, const char *name, int lineno); |
| 40 |
PGconn *ECPGget_PGconn(const char *connection_name); |
| 41 |
PGTransactionStatusType ECPGtransactionStatus(const char *connection_name); |
| 42 |
|
| 43 |
/* print an error message */ |
| 44 |
void sqlprint(void); |
| 45 |
|
| 46 |
/* define this for simplicity as well as compatibility */ |
| 47 |
|
| 48 |
#define SQLCODE sqlca.sqlcode |
| 49 |
#define SQLSTATE sqlca.sqlstate |
| 50 |
|
| 51 |
/* dynamic SQL */ |
| 52 |
|
| 53 |
bool ECPGdo_descriptor(int line, const char *connection, |
| 54 |
const char *descriptor, const char *query); |
| 55 |
bool ECPGdeallocate_desc(int line, const char *name); |
| 56 |
bool ECPGallocate_desc(int line, const char *name); |
| 57 |
bool ECPGget_desc_header(int lineno, const char *desc_name, int *count); |
| 58 |
bool ECPGget_desc(int lineno, const char *desc_name, int index,...); |
| 59 |
bool ECPGset_desc_header(int lineno, const char *desc_name, int count); |
| 60 |
bool ECPGset_desc(int lineno, const char *desc_name, int index,...); |
| 61 |
|
| 62 |
void ECPGset_noind_null(enum ECPGttype type, void *ptr); |
| 63 |
bool ECPGis_noind_null(enum ECPGttype type, const void *ptr); |
| 64 |
bool ECPGdescribe(int line, int compat, bool input, |
| 65 |
const char *connection_name, const char *stmt_name,...); |
| 66 |
|
| 67 |
void ECPGset_var(int number, void *pointer, int lineno); |
| 68 |
void *ECPGget_var(int number); |
| 69 |
|
| 70 |
/* dynamic result allocation */ |
| 71 |
void ECPGfree_auto_mem(void); |
| 72 |
|
| 73 |
void ecpg_pthreads_init(void); |
| 74 |
|
| 75 |
#ifdef __cplusplus |
| 76 |
} |
| 77 |
#endif |
| 78 |
|
| 79 |
#endif /* _ECPGLIB_H */ |