404
|
1 /*
|
|
2 postgresql.h -- Emacs Lisp binding to libpq.so
|
|
3 Copyright (C) 2000 Electrotechnical Laboratory, JAPAN.
|
|
4 Licensed to the Free Software Foundation.
|
|
5
|
|
6 Author: SL Baur <steve@beopen.com>
|
|
7 Maintainer: SL Baur <steve@beopen.com>
|
|
8
|
|
9 Please send patches to this file to me first before submitting them to
|
|
10 xemacs-patches.
|
|
11 */
|
|
12
|
|
13 #ifndef XEMACS_POSTGRESQL_H__
|
|
14 #define XEMACS_POSTGRESQL_H__ 1
|
|
15
|
|
16 #define BLCKSZ 8192 /* size of a default Postres disk block */
|
|
17 /*
|
|
18 This file contains the GCC bug workaround code for the private
|
|
19 LRECORD types.
|
|
20 */
|
|
21
|
|
22 /* PGconn is an opaque object and we need to be able to store them in
|
|
23 Lisp code because libpq supports multiple connections.
|
|
24 */
|
|
25 struct Lisp_PGconn
|
|
26 {
|
|
27 struct lcrecord_header header;
|
|
28 PGconn *pgconn;
|
|
29 };
|
|
30 typedef struct Lisp_PGconn Lisp_PGconn;
|
|
31
|
|
32 DECLARE_LRECORD (pgconn, Lisp_PGconn);
|
|
33
|
|
34 #define XPGCONN(x) XRECORD (x, pgconn, Lisp_PGconn)
|
|
35 #define XSETPGCONN(x, p) XSETRECORD (x, p, pgconn)
|
|
36 #define PGCONNP(x) RECORDP (x, pgconn)
|
|
37 #define CHECK_PGCONN(x) CHECK_RECORD (x, pgconn)
|
|
38 #define CONCHECK_PGCONN(x) CONCHECK_RECORD (x, pgconn)
|
|
39
|
|
40 /****/
|
|
41
|
|
42 /* PGresult is an opaque object and we need to be able to store them in
|
|
43 Lisp code.
|
|
44 */
|
|
45 struct Lisp_PGresult
|
|
46 {
|
|
47 struct lcrecord_header header;
|
|
48 PGresult *pgresult;
|
|
49 };
|
|
50 typedef struct Lisp_PGresult Lisp_PGresult;
|
|
51
|
|
52 DECLARE_LRECORD (pgresult, Lisp_PGresult);
|
|
53
|
|
54 #define XPGRESULT(x) XRECORD (x, pgresult, Lisp_PGresult)
|
|
55 #define XSETPGRESULT(x, p) XSETRECORD (x, p, pgresult)
|
|
56 #define PGRESULTP(x) RECORDP (x, pgresult)
|
|
57 #define CHECK_PGRESULT(x) CHECK_RECORD (x, pgresult)
|
|
58 #define CONCHECK_PGRESULT(x) CONCHECK_RECORD (x, pgresult)
|
|
59
|
|
60 /****/
|
|
61 #ifdef HAVE_POSTGRESQLV7
|
|
62
|
|
63 #ifdef LIBPQ_7_0_IS_FIXED /* this is broken in released 7.0b1 */
|
|
64
|
|
65 /* PGsetenvHandle is an opaque object and we need to be able to store
|
|
66 them in Lisp code in order to make asynchronous environment calls.
|
|
67 */
|
|
68 struct Lisp_PGsetenvHandle
|
|
69 {
|
|
70 struct lcrecord_header header;
|
|
71 PGsetenvHandle *pgsetenv;
|
|
72 };
|
|
73 typedef struct Lisp_PGsetenvHandle Lisp_PGsetenvHandle;
|
|
74
|
|
75 DECLARE_LRECORD (pgsetenv, Lisp_PGsetenvHandle);
|
|
76
|
|
77 #define XPGSETENV(x) XRECORD (x, pgsetenv, Lisp_PGsetenvHandle)
|
|
78 #define XSETPGSETENV(x, p) XSETRECORD (x, p, pgsetenv)
|
|
79 #define PGSETENVP(x) RECORDP (x, pgsetenv)
|
|
80 #define CHECK_PGSETENV(x) CHECK_RECORD (x, pgsetenv)
|
|
81 #define CONCHECK_PGSETENV(x) CONCHECK_RECORD (x, pgsetenv)
|
|
82
|
|
83 #endif /* LIBPQ_7_0_IS_FIXED */
|
|
84
|
|
85 #endif /* HAVE_POSTGRESQLV7 */
|
|
86
|
|
87 #endif /* XEMACS_POSTGRESQL_H__ */
|