Mercurial > hg > xemacs-beta
comparison modules/postgresql/postgresql.c @ 5118:e0db3c197671 ben-lisp-object
merge up to latest default branch, doesn't compile yet
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sat, 26 Dec 2009 21:18:49 -0600 |
parents | 3742ea8250b5 6ef4efc5cfe0 |
children | d1247f3cc363 |
comparison
equal
deleted
inserted
replaced
5117:3742ea8250b5 | 5118:e0db3c197671 |
---|---|
1 /* | 1 /* |
2 postgresql.c -- Emacs Lisp binding to libpq.so | 2 postgresql.c -- Emacs Lisp binding to libpq.so |
3 Copyright (C) 2000 Electrotechnical Laboratory, JAPAN. | 3 Copyright (C) 2000 Electrotechnical Laboratory, JAPAN. |
4 Licensed to the Free Software Foundation. | 4 Licensed to the Free Software Foundation. |
5 | 5 |
6 Author: SL Baur <steve@beopen.com> | 6 Author: SL Baur <steve@xemacs.org> |
7 Maintainer: SL Baur <steve@beopen.com> | 7 Maintainer: SL Baur <steve@xemacs.org> |
8 | 8 |
9 Please send patches to this file to me first before submitting them to | 9 Please send patches to this file to me first before submitting them to |
10 xemacs-patches. | 10 xemacs-patches. |
11 | 11 |
12 | 12 |
238 allocate_pgconn (void) | 238 allocate_pgconn (void) |
239 { | 239 { |
240 #ifdef RUNNING_XEMACS_21_1 | 240 #ifdef RUNNING_XEMACS_21_1 |
241 Lisp_PGconn *pgconn = ALLOC_LCRECORD_TYPE (Lisp_PGconn, | 241 Lisp_PGconn *pgconn = ALLOC_LCRECORD_TYPE (Lisp_PGconn, |
242 lrecord_pgconn); | 242 lrecord_pgconn); |
243 #else | 243 #elif RUNNING_XEMACS_21_4 |
244 Lisp_PGconn *pgconn = ALLOC_LCRECORD_TYPE (Lisp_PGconn, | 244 Lisp_PGconn *pgconn = ALLOC_LCRECORD_TYPE (Lisp_PGconn, |
245 &lrecord_pgconn); | 245 &lrecord_pgconn); |
246 #else | |
247 Lisp_PGconn *pgconn = XPGCONN (ALLOC_LISP_OBJECT (pgconn)); | |
246 #endif | 248 #endif |
247 pgconn->pgconn = (PGconn *)NULL; | 249 pgconn->pgconn = (PGconn *)NULL; |
248 return pgconn; | 250 return pgconn; |
249 } | 251 } |
250 | 252 |
264 } | 266 } |
265 } | 267 } |
266 | 268 |
267 #ifdef RUNNING_XEMACS_21_1 | 269 #ifdef RUNNING_XEMACS_21_1 |
268 DEFINE_LRECORD_IMPLEMENTATION ("pgconn", pgconn, | 270 DEFINE_LRECORD_IMPLEMENTATION ("pgconn", pgconn, |
269 2mark_pgconn, print_pgconn, finalize_pgconn, | 271 mark_pgconn, print_pgconn, finalize_pgconn, |
270 NULL, NULL, | 272 NULL, NULL, |
271 Lisp_PGconn); | 273 Lisp_PGconn); |
272 #elif defined (RUNNING_XEMACS_21_4) | 274 #elif defined (RUNNING_XEMACS_21_4) |
273 DEFINE_LRECORD_IMPLEMENTATION ("pgconn", pgconn, | 275 DEFINE_LRECORD_IMPLEMENTATION ("pgconn", pgconn, |
274 0, /*dumpable-flag*/ | 276 0, /*dumpable-flag*/ |
275 mark_pgconn, print_pgconn, finalize_pgconn, | 277 mark_pgconn, print_pgconn, finalize_pgconn, |
276 NULL, NULL, | 278 NULL, NULL, |
277 pgconn_description, | 279 pgconn_description, |
278 Lisp_PGconn); | 280 Lisp_PGconn); |
279 #else | 281 #else |
280 DEFINE_NONDUMPABLE_LRECORD_IMPLEMENTATION ("pgconn", pgconn, | 282 DEFINE_NODUMP_LISP_OBJECT ("pgconn", pgconn, |
281 mark_pgconn, print_pgconn, | 283 mark_pgconn, print_pgconn, |
282 finalize_pgconn, | 284 finalize_pgconn, |
283 NULL, NULL, | 285 NULL, NULL, |
284 pgconn_description, | 286 pgconn_description, |
285 Lisp_PGconn); | 287 Lisp_PGconn); |
286 #endif | 288 #endif |
287 /****/ | 289 /****/ |
288 | 290 |
289 /* PGresult is an opaque object and we need to be able to store them in | 291 /* PGresult is an opaque object and we need to be able to store them in |
290 Lisp code. | 292 Lisp code. |
370 allocate_pgresult (void) | 372 allocate_pgresult (void) |
371 { | 373 { |
372 #ifdef RUNNING_XEMACS_21_1 | 374 #ifdef RUNNING_XEMACS_21_1 |
373 Lisp_PGresult *pgresult = ALLOC_LCRECORD_TYPE (Lisp_PGresult, | 375 Lisp_PGresult *pgresult = ALLOC_LCRECORD_TYPE (Lisp_PGresult, |
374 lrecord_pgresult); | 376 lrecord_pgresult); |
375 #else | 377 #elif RUNNING_XEMACS_21_4 |
376 Lisp_PGresult *pgresult = ALLOC_LCRECORD_TYPE (Lisp_PGresult, | 378 Lisp_PGresult *pgresult = ALLOC_LCRECORD_TYPE (Lisp_PGresult, |
377 &lrecord_pgresult); | 379 &lrecord_pgresult); |
380 #else | |
381 Lisp_PGresult *pgresult = XPGRESULT (ALLOC_LISP_OBJECT (pgresult)); | |
378 #endif | 382 #endif |
379 pgresult->pgresult = (PGresult *)NULL; | 383 pgresult->pgresult = (PGresult *)NULL; |
380 return pgresult; | 384 return pgresult; |
381 } | 385 } |
382 | 386 |
399 #ifdef RUNNING_XEMACS_21_1 | 403 #ifdef RUNNING_XEMACS_21_1 |
400 DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, | 404 DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, |
401 mark_pgresult, print_pgresult, finalize_pgresult, | 405 mark_pgresult, print_pgresult, finalize_pgresult, |
402 NULL, NULL, | 406 NULL, NULL, |
403 Lisp_PGresult); | 407 Lisp_PGresult); |
404 #else | 408 #elif defined (RUNNING_XEMACS_21_4) |
405 DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, | 409 DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, |
406 0, /*dumpable-flag*/ | 410 0, /*dumpable-flag*/ |
407 mark_pgresult, print_pgresult, finalize_pgresult, | 411 mark_pgresult, print_pgresult, finalize_pgresult, |
408 NULL, NULL, | 412 NULL, NULL, |
409 pgresult_description, | 413 pgresult_description, |
410 Lisp_PGresult); | 414 Lisp_PGresult); |
415 #else | |
416 DEFINE_NODUMP_LISP_OBJECT ("pgresult", pgresult, | |
417 mark_pgresult, print_pgresult, finalize_pgresult, | |
418 NULL, NULL, | |
419 pgresult_description, | |
420 Lisp_PGresult); | |
411 #endif | 421 #endif |
412 | 422 |
413 /***********************/ | 423 /***********************/ |
414 | 424 |
415 /* notices */ | 425 /* notices */ |
1604 | 1614 |
1605 void | 1615 void |
1606 syms_of_postgresql(void) | 1616 syms_of_postgresql(void) |
1607 { | 1617 { |
1608 #ifndef RUNNING_XEMACS_21_1 | 1618 #ifndef RUNNING_XEMACS_21_1 |
1609 INIT_LRECORD_IMPLEMENTATION (pgconn); | 1619 INIT_LISP_OBJECT (pgconn); |
1610 INIT_LRECORD_IMPLEMENTATION (pgresult); | 1620 INIT_LISP_OBJECT (pgresult); |
1611 #endif | 1621 #endif |
1612 DEFSYMBOL (Qpostgresql); | 1622 DEFSYMBOL (Qpostgresql); |
1613 | 1623 |
1614 /* opaque exported types */ | 1624 /* opaque exported types */ |
1615 DEFSYMBOL (Qpgconnp); | 1625 DEFSYMBOL (Qpgconnp); |