Header And Logo

PostgreSQL
| The world's most advanced open source database.

ecpglib.h

Go to the documentation of this file.
00001 /*
00002  * this is a small part of c.h since we don't want to leak all postgres
00003  * definitions into ecpg programs
00004  * src/interfaces/ecpg/include/ecpglib.h
00005  */
00006 
00007 #ifndef _ECPGLIB_H
00008 #define _ECPGLIB_H
00009 
00010 #include "libpq-fe.h"
00011 #include "ecpgtype.h"
00012 #include "sqlca.h"
00013 #include <string.h>
00014 
00015 #ifdef ENABLE_NLS
00016 extern char *
00017 ecpg_gettext(const char *msgid)
00018 __attribute__((format_arg(1)));
00019 #else
00020 #define ecpg_gettext(x) (x)
00021 #endif
00022 
00023 #ifndef __cplusplus
00024 #ifndef bool
00025 #define bool char
00026 #endif   /* ndef bool */
00027 
00028 #ifndef true
00029 #define true    ((bool) 1)
00030 #endif   /* ndef true */
00031 #ifndef false
00032 #define false   ((bool) 0)
00033 #endif   /* ndef false */
00034 #endif   /* not C++ */
00035 
00036 #ifndef TRUE
00037 #define TRUE    1
00038 #endif   /* TRUE */
00039 
00040 #ifndef FALSE
00041 #define FALSE   0
00042 #endif   /* FALSE */
00043 
00044 #ifdef __cplusplus
00045 extern      "C"
00046 {
00047 #endif
00048 
00049 void        ECPGdebug(int, FILE *);
00050 bool        ECPGstatus(int, const char *);
00051 bool        ECPGsetcommit(int, const char *, const char *);
00052 bool        ECPGsetconn(int, const char *);
00053 bool        ECPGconnect(int, int, const char *, const char *, const char *, const char *, int);
00054 bool        ECPGdo(const int, const int, const int, const char *, const bool, const int, const char *,...);
00055 bool        ECPGtrans(int, const char *, const char *);
00056 bool        ECPGdisconnect(int, const char *);
00057 bool        ECPGprepare(int, const char *, const bool, const char *, const char *);
00058 bool        ECPGdeallocate(int, int, const char *, const char *);
00059 bool        ECPGdeallocate_all(int, int, const char *);
00060 char       *ECPGprepared_statement(const char *, const char *, int);
00061 PGconn     *ECPGget_PGconn(const char *);
00062 PGTransactionStatusType ECPGtransactionStatus(const char *);
00063 
00064 char       *ECPGerrmsg(void);
00065 
00066  /* print an error message */
00067 void        sqlprint(void);
00068 
00069 /* define this for simplicity as well as compatibility */
00070 
00071 #define     SQLCODE     sqlca.sqlcode
00072 #define     SQLSTATE        sqlca.sqlstate
00073 
00074 /* dynamic SQL */
00075 
00076 bool        ECPGdo_descriptor(int, const char *, const char *, const char *);
00077 bool        ECPGdeallocate_desc(int, const char *);
00078 bool        ECPGallocate_desc(int, const char *);
00079 bool        ECPGget_desc_header(int, const char *, int *);
00080 bool        ECPGget_desc(int, const char *, int,...);
00081 bool        ECPGset_desc_header(int, const char *, int);
00082 bool        ECPGset_desc(int, const char *, int,...);
00083 
00084 void        ECPGset_noind_null(enum ECPGttype, void *);
00085 bool        ECPGis_noind_null(enum ECPGttype, void *);
00086 bool        ECPGdescribe(int, int, bool, const char *, const char *,...);
00087 
00088 void        ECPGset_var(int, void *, int);
00089 void       *ECPGget_var(int number);
00090 
00091 /* dynamic result allocation */
00092 void        ECPGfree_auto_mem(void);
00093 
00094 #ifdef ENABLE_THREAD_SAFETY
00095 void        ecpg_pthreads_init(void);
00096 #endif
00097 
00098 #ifdef __cplusplus
00099 }
00100 #endif
00101 
00102 #endif   /* _ECPGLIB_H */