1 /*
2 
3 Boost Software License - Version 1.0 - August 17th, 2003
4 
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
11 
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 
27 */
28 module derelict.pq.statfun;
29 
30 version(Derelict_Static) version = DerelictPQ_Static;
31 version(DerelictPQ_Static):
32 
33 public import derelict.pq.types;
34 
35 extern(C) @nogc nothrow {
36     PGconn* PQconnectStart(const(char)*);
37     PGconn* PQconnectStartParams(const(char*)*,const(char*)*,int);
38     PostgresPollingStatusType PQconnectPoll(PGconn*);
39     PGconn* PQconnectdb(const(char)*);
40     PGconn* PQconnectdbParams(const(char*)*,const(char*)*,int);
41     PGconn* PQsetdbLogin(const(char)*,const(char)*,const(char)*,const(char)*,const(char)*,const(char)*,const(char)*);
42     void PQfinish(PGconn*);
43     PQconninfoOption* PQconndefaults();
44     PQconninfoOption* PQconninfoParse(const(char)*,char**);
45     PQconninfoOption* PQconninfo(PGconn*);
46     void PQconninfoFree(PQconninfoOption*);
47     int PQresetStart(PGconn*);
48     PostgresPollingStatusType PQresetPoll(PGconn*);
49     void PQreset(PGconn*);
50     PGcancel* PQgetCancel(PGconn*);
51     void PQfreeCancel(PGcancel*);
52     int PQcancel(PGcancel*,char*,int);
53     int PQrequestCancel(PGconn*);
54     char* PQdb(const(PGconn)*);
55     char* PQuser(const(PGconn)*);
56     char* PQpass(const(PGconn)*);
57     char* PQhost(const(PGconn)*);
58     char* PQport(const(PGconn)*);
59     char* PQtty(const(PGconn)*);
60     char* PQoptions(const(PGconn)*);
61     ConnStatusType PQstatus(const(PGconn)*);
62     PGTransactionStatusType PQtransactionStatus(const(PGconn)*);
63     char* PQparameterStatus(const(PGconn)*,const(char)*);
64     int PQprotocolVersion(const(PGconn)*);
65     int PQserverVersion(const(PGconn)*);
66     char* PQerrorMessage(const(PGconn)*);
67     int PQsocket(const(PGconn)*);
68     int PQbackendPID(const(PGconn)*);
69     int PQconnectionNeedsPassword(const(PGconn)*);
70     int PQconnectionUsedPassword(const(PGconn)*);
71     int PQclientEncoding(const(PGconn)*);
72     int PQsetClientEncoding(PGconn*,const(char)*);
73     int PQsslInUse(PGconn*);
74     void* PQsslStruct(PGconn*,const(char)*);
75     const(char)* PQsslAttribute(PGconn*,const(char)*);
76     const(char*)* PQsslAttributeNames(PGconn*);
77     void* PQgetssl(PGconn*);
78     void PQinitSSL(int);
79     void PQinitOpenSSL(int,int);
80     PGVerbosity PQsetErrorVerbosity(PGconn*,PGVerbosity);
81     PGContextVisibility PQsetErrorContextVisibility(PGconn*,PGContextVisibility);
82     void PQtrace(PGconn*,FILE*);
83     void PQuntrace(PGconn*);
84     PQnoticeReceiver PQsetNoticeReceiver(PGconn*,PQnoticeReceiver,void*);
85     PQnoticeProcessor PQsetNoticeProcessor(PGconn*,PQnoticeProcessor,void*);
86     pgthreadlock_t PQregisterThreadLock(pgthreadlock_t);
87     PGresult* PQexec(PGconn*,const(char)*);
88     PGresult* PQexecParams(PGconn*,const(char)*,int,const(Oid)*,const(ubyte*)*,const(int)*,const int*,int);
89     PGresult* PQprepare(PGconn*,const(char)*,const(char)*,int,const(Oid)*);
90     PGresult* PQexecPrepared(PGconn*,const(char)*,int,const(char*)*,const(int)*,const(int)*,int);
91     int PQsendQuery(PGconn*,const(char)*);
92     int PQsendQueryParams(PGconn*,const(char)*,int,const(Oid)*,const(ubyte*)*,const(int)*,const(int)*,int);
93     int PQsendPrepare(PGconn*,const(char)*,const(char)*,int,const(Oid)*);
94     int PQsendQueryPrepared(PGconn*,const(char)*,int,const(ubyte*)*,const(int)*,const(int)*,int);
95     int PQsetSingleRowMode(PGconn*);
96     PGresult* PQgetResult(PGconn*);
97     int PQisBusy(PGconn*);
98     int PQconsumeInput(PGconn*);
99     immutable (PGnotify)* PQnotifies(PGconn*);
100     int PQputCopyData(PGconn*,const(char)*,int);
101     int PQputCopyEnd(PGconn*,const(char)*);
102     int PQgetCopyData(PGconn*,char**,int);
103     int PQgetline(PGconn*,char*,int);
104     int PQputline(PGconn*,const(char)*);
105     int PQgetlineAsync(PGconn*,char*,int);
106     int PQputnbytes(PGconn*,const(char)*,int);
107     int PQendcopy(PGconn*);
108     int PQsetnonblocking(PGconn*,int);
109     int PQisnonblocking(PGconn*);
110     int PQisthreadsafe();
111     PGPing PQping(const(char)*);
112     PGPing PQpingParams(const(char*)*,const(char*)*,int);
113     int PQflush(PGconn*);
114     PGresult* PQfn(PGconn*,int,int*,int*,int,PQArgBlock*,int);
115     ExecStatusType PQresultStatus(const(PGresult)*);
116     char* PQresStatus(ExecStatusType);
117     char* PQresultErrorMessage(const(PGresult)*);
118     char* PQresultVerboseErrorMessage(const(PGresult)*,PGVerbosity,PGContextVisibility);
119     char* PQresultErrorField(const(PGresult)*,int);
120     int PQntuples(const(PGresult)*);
121     int PQnfields(const(PGresult)*);
122     int PQbinaryTuples(const(PGresult)*);
123     char* PQfname(const(PGresult)*,int);
124     int PQfnumber(const(PGresult)*,const(char)*);
125     Oid PQftable(PGresult*,int);
126     int PQftablecol(const(PGresult)*,int);
127     int PQfformat(const(PGresult)*,int);
128     Oid PQftype(const(PGresult)*,int);
129     int PQfsize(const(PGresult)*,int);
130     int PQfmod(const(PGresult)*,int);
131     char* PQcmdStatus(PGresult*);
132     char* PQoidStatus(PGresult*);
133     Oid PQoidValue(const(PGresult)*);
134     char* PQcmdTuples(PGresult*);
135     const(ubyte)* PQgetvalue(const(PGresult)*,int,int);
136     int PQgetlength(const(PGresult)*,int,int);
137     int PQgetisnull(const(PGresult)*,int,int);
138     int PQnparams(const(PGresult)*);
139     Oid PQparamtype(const(PGresult)*,int);
140     PGresult* PQdescribePrepared(PGconn*,const(char)*);
141     PGresult* PQdescribePortal(PGconn*,const(char)*);
142     int PQsendDescribePrepared(PGconn*,const(char)*);
143     int PQsendDescribePortal(PGconn*,const(char)*);
144     void PQclear(const(PGresult)*);
145     void PQfreemem(void*);
146     PGresult* PQmakeEmptyPGresult(PGconn*,ExecStatusType);
147     PGresult* PQcopyResult(const(PGresult)*,int);
148     int PQsetResultAttrs(PGresult*,int,PGresAttDesc*);
149     void* PQresultAlloc(PGresult*,size_t);
150     int PQsetvalue(PGresult*,int,int,char*,int);
151     size_t PQescapeStringConn(PGconn*,char*,char*,size_t,int*);
152     char* PQescapeLiteral(PGconn*,const(char)*,size_t);
153     char* PQescapeIdentifier(PGconn*,const(char)*,size_t);
154     ubyte* PQescapeByteaConn(PGconn*,ubyte*,size_t,size_t*);
155     ubyte* PQunescapeBytea(ubyte*,size_t*);
156     size_t PQescapeString(char*,char*,size_t);
157     ubyte* PQescapeBytea(ubyte*,size_t,size_t*);
158     void PQprint(FILE*,PGresult*,PQprintOpt*);
159     void PQdisplayTuples(PGresult*,FILE*,int,char*,int,int);
160     void PQprintTuples(PGresult*,FILE*,int,int,int);
161     int lo_open(PGconn*,Oid,int);
162     int lo_close(PGconn*,int);
163     int lo_read(PGconn*,int,char*,size_t);
164     int lo_write(PGconn*,int,const(char)*,size_t);
165     int lo_lseek(PGconn*,int,int,int);
166     pg_int64 lo_lseek64(PGconn*,int,pg_int64,int);
167     Oid lo_creat(PGconn*,int);
168     Oid lo_create(PGconn*,Oid);
169     int lo_tell(PGconn*,int);
170     pg_int64 lo_tell64(PGconn*,int);
171     int lo_truncate(PGconn*,int,size_t);
172     int lo_truncate64(PGconn*,int,pg_int64);
173     int lo_unlink(PGconn*,Oid);
174     Oid lo_import(PGconn*,const(char)*);
175     Oid lo_import_with_oid(PGconn*,const(char)*,Oid);
176     int lo_export(PGconn*,Oid,const(char)*);
177     int PQlibVersion();
178     int PQmblen(char*,int);
179     int PQdsplen(char*,int);
180     int PQenv2encoding();
181     char* PQencryptPassword(char*,char*);
182     int pg_char_to_encoding(const(char)*);
183     const(char)* pg_encoding_to_char(int);
184     int pg_valid_server_encoding_id(int);
185     int PQregisterEventProc(PGconn*,PGEventProc,const(char)*,void*);
186     int PQsetInstanceData(PGconn*,PGEventProc,void*);
187 }