~ubuntu-branches/debian/sid/postgresql-9.3/sid

« back to all changes in this revision

Viewing changes to src/interfaces/ecpg/include/ecpglib.h

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-08 05:39:52 UTC
  • Revision ID: package-import@ubuntu.com-20130508053952-1j7uilp7mjtrvq8q
Tags: upstream-9.3~beta1
ImportĀ upstreamĀ versionĀ 9.3~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 * src/interfaces/ecpg/include/ecpglib.h
 
5
 */
 
6
 
 
7
#ifndef _ECPGLIB_H
 
8
#define _ECPGLIB_H
 
9
 
 
10
#include "libpq-fe.h"
 
11
#include "ecpgtype.h"
 
12
#include "sqlca.h"
 
13
#include <string.h>
 
14
 
 
15
#ifdef ENABLE_NLS
 
16
extern char *
 
17
ecpg_gettext(const char *msgid)
 
18
__attribute__((format_arg(1)));
 
19
#else
 
20
#define ecpg_gettext(x) (x)
 
21
#endif
 
22
 
 
23
#ifndef __cplusplus
 
24
#ifndef bool
 
25
#define bool char
 
26
#endif   /* ndef bool */
 
27
 
 
28
#ifndef true
 
29
#define true    ((bool) 1)
 
30
#endif   /* ndef true */
 
31
#ifndef false
 
32
#define false   ((bool) 0)
 
33
#endif   /* ndef false */
 
34
#endif   /* not C++ */
 
35
 
 
36
#ifndef TRUE
 
37
#define TRUE    1
 
38
#endif   /* TRUE */
 
39
 
 
40
#ifndef FALSE
 
41
#define FALSE   0
 
42
#endif   /* FALSE */
 
43
 
 
44
#ifdef __cplusplus
 
45
extern          "C"
 
46
{
 
47
#endif
 
48
 
 
49
void            ECPGdebug(int, FILE *);
 
50
bool            ECPGstatus(int, const char *);
 
51
bool            ECPGsetcommit(int, const char *, const char *);
 
52
bool            ECPGsetconn(int, const char *);
 
53
bool            ECPGconnect(int, int, const char *, const char *, const char *, const char *, int);
 
54
bool            ECPGdo(const int, const int, const int, const char *, const bool, const int, const char *,...);
 
55
bool            ECPGtrans(int, const char *, const char *);
 
56
bool            ECPGdisconnect(int, const char *);
 
57
bool            ECPGprepare(int, const char *, const bool, const char *, const char *);
 
58
bool            ECPGdeallocate(int, int, const char *, const char *);
 
59
bool            ECPGdeallocate_all(int, int, const char *);
 
60
char       *ECPGprepared_statement(const char *, const char *, int);
 
61
PGconn     *ECPGget_PGconn(const char *);
 
62
PGTransactionStatusType ECPGtransactionStatus(const char *);
 
63
 
 
64
char       *ECPGerrmsg(void);
 
65
 
 
66
 /* print an error message */
 
67
void            sqlprint(void);
 
68
 
 
69
/* define this for simplicity as well as compatibility */
 
70
 
 
71
#define         SQLCODE         sqlca.sqlcode
 
72
#define         SQLSTATE                sqlca.sqlstate
 
73
 
 
74
/* dynamic SQL */
 
75
 
 
76
bool            ECPGdo_descriptor(int, const char *, const char *, const char *);
 
77
bool            ECPGdeallocate_desc(int, const char *);
 
78
bool            ECPGallocate_desc(int, const char *);
 
79
bool            ECPGget_desc_header(int, const char *, int *);
 
80
bool            ECPGget_desc(int, const char *, int,...);
 
81
bool            ECPGset_desc_header(int, const char *, int);
 
82
bool            ECPGset_desc(int, const char *, int,...);
 
83
 
 
84
void            ECPGset_noind_null(enum ECPGttype, void *);
 
85
bool            ECPGis_noind_null(enum ECPGttype, void *);
 
86
bool            ECPGdescribe(int, int, bool, const char *, const char *,...);
 
87
 
 
88
void            ECPGset_var(int, void *, int);
 
89
void       *ECPGget_var(int number);
 
90
 
 
91
/* dynamic result allocation */
 
92
void            ECPGfree_auto_mem(void);
 
93
 
 
94
#ifdef ENABLE_THREAD_SAFETY
 
95
void            ecpg_pthreads_init(void);
 
96
#endif
 
97
 
 
98
#ifdef __cplusplus
 
99
}
 
100
#endif
 
101
 
 
102
#endif   /* _ECPGLIB_H */