Coverity: UNUSED: CID 427
[sxemacs] / src / database / postgresql.h
1 /** postgresql.c -- elisp binding to libpq.so
2  *
3  * Copyright (C) 2000 Electrotechnical Laboratory, JAPAN.
4  * Copyright (C) 2005-2008 Sebastian Freundt <hroptatyr@sxemacs.org>
5  *
6  * Original author:  SL Baur <steve@beopen.com>
7  *
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  *
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.
19  *
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.
23  *
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.
35  *
36  *
37  * This file is part of SXEmacs.
38  */
39
40 #ifndef INCLUDED_postgresql_h_
41 #define INCLUDED_postgresql_h_ 1
42
43 #include LIBPQ_FE_H_FILE        /* main PostgreSQL header file */
44
45 #define BLCKSZ 8192             /* size of a default Postgres disk block */
46 /*
47   This file contains the GCC bug workaround code for the private
48   LRECORD types.
49 */
50
51 /* PGconn is an opaque object and we need to be able to store them in
52    Lisp code because libpq supports multiple connections.
53 */
54 struct Lisp_PGconn {
55         struct lcrecord_header header;
56         PGconn *pgconn;
57         Lisp_Object notice_processor;
58 };
59 typedef struct Lisp_PGconn Lisp_PGconn;
60
61 DECLARE_LRECORD(pgconn, Lisp_PGconn);
62
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)
68
69 /****/
70
71 /* PGresult is an opaque object and we need to be able to store them in
72    Lisp code.
73 */
74 struct Lisp_PGresult {
75         struct lcrecord_header header;
76         PGresult *pgresult;
77 };
78 typedef struct Lisp_PGresult Lisp_PGresult;
79
80 DECLARE_LRECORD(pgresult, Lisp_PGresult);
81
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)
87
88 #endif  /* INCLUDED_postgresql_h_ */