1 /** postgresql.c -- elisp binding to libpq.so
3 * Copyright (C) 2000 Electrotechnical Laboratory, JAPAN.
4 * Copyright (C) 2005-2008 Sebastian Freundt <hroptatyr@sxemacs.org>
6 * Original author: SL Baur <steve@beopen.com>
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
20 * 3. Neither the name of the author nor the names of any contributors
21 * may be used to endorse or promote products derived from this
22 * software without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
25 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
34 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 * This file is part of SXEmacs.
40 #ifndef INCLUDED_postgresql_h_
41 #define INCLUDED_postgresql_h_ 1
43 #include LIBPQ_FE_H_FILE /* main PostgreSQL header file */
45 #define BLCKSZ 8192 /* size of a default Postgres disk block */
47 This file contains the GCC bug workaround code for the private
51 /* PGconn is an opaque object and we need to be able to store them in
52 Lisp code because libpq supports multiple connections.
55 struct lcrecord_header header;
57 Lisp_Object notice_processor;
59 typedef struct Lisp_PGconn Lisp_PGconn;
61 DECLARE_LRECORD(pgconn, Lisp_PGconn);
63 #define XPGCONN(x) XRECORD (x, pgconn, Lisp_PGconn)
64 #define XSETPGCONN(x, p) XSETRECORD (x, p, pgconn)
65 #define PGCONNP(x) RECORDP (x, pgconn)
66 #define CHECK_PGCONN(x) CHECK_RECORD (x, pgconn)
67 #define CONCHECK_PGCONN(x) CONCHECK_RECORD (x, pgconn)
71 /* PGresult is an opaque object and we need to be able to store them in
74 struct Lisp_PGresult {
75 struct lcrecord_header header;
78 typedef struct Lisp_PGresult Lisp_PGresult;
80 DECLARE_LRECORD(pgresult, Lisp_PGresult);
82 #define XPGRESULT(x) XRECORD (x, pgresult, Lisp_PGresult)
83 #define XSETPGRESULT(x, p) XSETRECORD (x, p, pgresult)
84 #define PGRESULTP(x) RECORDP (x, pgresult)
85 #define CHECK_PGRESULT(x) CHECK_RECORD (x, pgresult)
86 #define CONCHECK_PGRESULT(x) CONCHECK_RECORD (x, pgresult)
88 #endif /* INCLUDED_postgresql_h_ */