From: Christopher Cramer <crayc@pyro.net>
Cc: guile-user@gnu.org
Subject: Re: guile-pg
Date: Tue, 26 Nov 2002 20:07:17 -0600 [thread overview]
Message-ID: <20021126200717.A20864@kiwi.pyrotechnics.com> (raw)
In-Reply-To: <20021126083203.5d2368c4.david@altosw.be>; from david@altosw.be on Tue, Nov 26, 2002 at 08:32:03AM -0500
On Tue, Nov 26, 2002 at 08:32:03AM -0500, David Pirotte wrote:
> Sorry to bother this list with guile-pg problems, but the guile-pg
> list is not accepting my posting (even though I registered)
I've heard that the guile-pg authors have disappeared.
> libpostgres.c:40:15: c.h: No such file or directory
I haven't looked too closely at the patch, but I think if you just
remove this line it should be fine. (I have no idea what c.h is supposed
to be.)
If that doesn't work, you could try my patch, which I've been using for
a long time with no problems. (Although I've never used large objects
at all, so that part may be broken.)
diff -ur guile-pg-0.07/Makefile.am guile-pg-0.07-new/Makefile.am
--- guile-pg-0.07/Makefile.am Fri Jun 2 02:52:34 2000
+++ guile-pg-0.07-new/Makefile.am Sat Jul 20 19:04:00 2002
@@ -43,7 +43,7 @@
SUFFIXES = .x
.c.x:
- guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@
+ guile-snarf $< $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) > $@
## Add -MG to make the .x magic work with auto-dep code.
MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
diff -ur guile-pg-0.07/libpostgres.c guile-pg-0.07-new/libpostgres.c
--- guile-pg-0.07/libpostgres.c Tue Jun 20 04:41:51 2000
+++ guile-pg-0.07-new/libpostgres.c Sat Jul 20 22:02:05 2002
@@ -37,7 +37,6 @@
#include <guile/gh.h>
#include <libpq-fe.h>
-#include <postgres.h>
#include <libpq/libpq-fs.h>
#include <libpostgres.h>
@@ -1151,14 +1150,14 @@
#include <libpostgres.x>
- scm_sysintern("PGRES_TUPLES_OK", SCM_MAKINUM(PGRES_TUPLES_OK));
- scm_sysintern("PGRES_COMMAND_OK", SCM_MAKINUM(PGRES_COMMAND_OK));
- scm_sysintern("PGRES_EMPTY_QUERY", SCM_MAKINUM(PGRES_EMPTY_QUERY));
- scm_sysintern("PGRES_COPY_OUT", SCM_MAKINUM(PGRES_COPY_OUT));
- scm_sysintern("PGRES_COPY_IN", SCM_MAKINUM(PGRES_COPY_IN));
- scm_sysintern("PGRES_BAD_RESPONSE", SCM_MAKINUM(PGRES_BAD_RESPONSE));
- scm_sysintern("PGRES_NONFATAL_ERROR", SCM_MAKINUM(PGRES_NONFATAL_ERROR));
- scm_sysintern("PGRES_FATAL_ERROR", SCM_MAKINUM(PGRES_FATAL_ERROR));
+ scm_c_define("PGRES_TUPLES_OK", SCM_MAKINUM(PGRES_TUPLES_OK));
+ scm_c_define("PGRES_COMMAND_OK", SCM_MAKINUM(PGRES_COMMAND_OK));
+ scm_c_define("PGRES_EMPTY_QUERY", SCM_MAKINUM(PGRES_EMPTY_QUERY));
+ scm_c_define("PGRES_COPY_OUT", SCM_MAKINUM(PGRES_COPY_OUT));
+ scm_c_define("PGRES_COPY_IN", SCM_MAKINUM(PGRES_COPY_IN));
+ scm_c_define("PGRES_BAD_RESPONSE", SCM_MAKINUM(PGRES_BAD_RESPONSE));
+ scm_c_define("PGRES_NONFATAL_ERROR", SCM_MAKINUM(PGRES_NONFATAL_ERROR));
+ scm_c_define("PGRES_FATAL_ERROR", SCM_MAKINUM(PGRES_FATAL_ERROR));
init_libpostgres_lo();
diff -ur guile-pg-0.07/libpostgres_lo.c guile-pg-0.07-new/libpostgres_lo.c
--- guile-pg-0.07/libpostgres_lo.c Fri Jun 2 05:14:55 2000
+++ guile-pg-0.07-new/libpostgres_lo.c Sat Jul 20 20:05:16 2002
@@ -197,7 +197,7 @@
SCM_SETSTREAM (port, (SCM) lobp);
pt->rw_random = 1;
- if (SCM_INPORTP (port)) {
+ if (SCM_INPUT_PORT_P (port)) {
pt->read_buf = malloc (LOB_BUFLEN);
if (pt->read_buf == NULL)
scm_memory_error (s_lob_mklobport);
@@ -207,7 +207,7 @@
pt->read_buf = ((unsigned char *) pt->read_pos) = pt->read_end = &pt->shortbuf;
pt->read_buf_size = 1;
}
- if (SCM_OUTPORTP (port)) {
+ if (SCM_OUTPUT_PORT_P (port)) {
pt->write_buf = malloc (LOB_BUFLEN);
if (pt->write_buf == NULL)
scm_memory_error (s_lob_mklobport);
@@ -219,7 +219,7 @@
}
pt->write_end = pt->write_buf + pt->write_buf_size;
- SCM_SETCAR (port, SCM_CAR (port) & ~SCM_BUF0);
+ SCM_SET_CELL_WORD_0 (port, SCM_CELL_WORD_0 (port) & ~SCM_BUF0);
SCM_ALLOW_INTS;
@@ -315,7 +315,7 @@
}
pt->write_pos = pt->write_buf + remaining;
}
- if (!terminating)
+ if (1 /*!terminating*/)
scm_syserror ("lob_flush");
else {
const char *msg = "Error: could not flush large object file descriptor ";
@@ -445,7 +445,7 @@
lob_flush (port);
}
/* handle line buffering. */
- if ((SCM_CAR (port) & SCM_BUFLINE) && memchr (data, '\n', size))
+ if ((SCM_CELL_WORD_0 (port) & SCM_BUFLINE) && memchr (data, '\n', size))
lob_flush (port);
}
}
diff -ur guile-pg-0.07/scm/postgres.scm.in guile-pg-0.07-new/scm/postgres.scm.in
--- guile-pg-0.07/scm/postgres.scm.in Wed May 31 04:59:07 2000
+++ guile-pg-0.07-new/scm/postgres.scm.in Sat Jul 20 21:11:43 2002
@@ -20,10 +20,56 @@
;; Load the C interface functions
-(if (not (defined? 'pg-guile-pg-loaded)) ;; Unless already loaded (static) ...
- (dynamic-call "init_postgres" (dynamic-link "libpostgres.so")))
+(define-module (database postgres)
+ :export (
+ PGRES_TUPLES_OK
+ PGRES_COMMAND_OK
+ PGRES_EMPTY_QUERY
+ PGRES_COPY_OUT
+ PGRES_COPY_IN
+ PGRES_BAD_RESPONSE
+ PGRES_NONFATAL_ERROR
+ PGRES_FATAL_ERROR
+ pg-connectdb
+ pg-reset
+ pg-get-client-data
+ pg-set-client-data!
+ pg-exec
+ pg-error-message
+ pg-get-db
+ pg-set-db
+ pg-get-user
+ pg-get-pass
+ pg-get-host
+ pg-get-port
+ pg-get-tty
+ pg-get-options
+ pg-get-connection
+ pg-backend-pid
+ pg-result-status
+ pg-ntuples
+ pg-nfields
+ pg-cmdtuples
+ pg-oid-status
+ pg-oid-value
+ pg-fname
+ pg-fnumber
+ pg-ftype
+ pg-fsize
+ pg-getvalue
+ pg-getlength
+ pg-getisnull
+ pg-binary-tuples?
+ pg-fmod
+ pg-guile-pg-version
+ pg-getline
+ pg-putline
+ pg-endcopy
+ pg-trace
+ pg-untrace))
-(define-module (database postgres))
+(if (not (defined? 'pg-guile-pg-loaded)) ;; Unless already loaded (static) ...
+ (load-extension "libpostgres" "init_postgres"))
(define-public (pg-guile-pg-module-config-stamp) "@GUILE_PG_STAMP@")
(define-public (pg-guile-pg-module-version) "@VERSION@")
--
Christopher Cramer <crayc@pyro.net> <http://www.pyro.net/~crayc/>
"Gore would have finished ahead by the barest of margins had he pursued
and gained a complete statewide recount." -- Associated Press, 9/6/2002
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
next prev parent reply other threads:[~2002-11-27 2:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-26 13:32 guile-pg David Pirotte
2002-11-27 2:07 ` Christopher Cramer [this message]
2002-11-26 17:40 ` guile-pg David Pirotte
2002-11-27 20:57 ` guile-pg Christopher Cramer
2002-11-27 11:54 ` guile-pg David Pirotte
2002-11-28 0:24 ` guile-pg Thien-Thi Nguyen
2002-11-30 6:22 ` guile-pg David Pirotte
2002-11-30 8:47 ` guile-pg Thien-Thi Nguyen
2002-11-28 2:29 ` guile-pg Christopher Cramer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021126200717.A20864@kiwi.pyrotechnics.com \
--to=crayc@pyro.net \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).