From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Christopher Cramer Newsgroups: gmane.lisp.guile.user Subject: Re: guile-pg Date: Tue, 26 Nov 2002 20:07:17 -0600 Sender: guile-user-admin@gnu.org Message-ID: <20021126200717.A20864@kiwi.pyrotechnics.com> References: <20021126083203.5d2368c4.david@altosw.be> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1038362865 30888 80.91.224.249 (27 Nov 2002 02:07:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 27 Nov 2002 02:07:45 +0000 (UTC) Cc: guile-user@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Grc8-00081t-00 for ; Wed, 27 Nov 2002 03:07:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18GrcT-0003EX-00; Tue, 26 Nov 2002 21:08:05 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18Grbd-0001Ax-00 for guile-user@gnu.org; Tue, 26 Nov 2002 21:07:13 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18Grba-00019Y-00 for guile-user@gnu.org; Tue, 26 Nov 2002 21:07:12 -0500 Original-Received: from pyro.net ([207.7.10.6] helo=kiwi.pyro.net) by monty-python.gnu.org with smtp (Exim 4.10) id 18Grba-00018q-00 for guile-user@gnu.org; Tue, 26 Nov 2002 21:07:10 -0500 Original-Received: (qmail 22788 invoked by uid 8610); 27 Nov 2002 02:07:17 -0000 Original-To: David Pirotte Mail-Followup-To: David Pirotte , guile-user@gnu.org Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20021126083203.5d2368c4.david@altosw.be>; from david@altosw.be on Tue, Nov 26, 2002 at 08:32:03AM -0500 Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.user:1387 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1387 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 #include -#include #include #include @@ -1151,14 +1150,14 @@ #include - 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 "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