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: Extended -e syntax Date: Mon, 1 Mar 2004 14:20:23 -0600 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <20040301142023.A29325@kiwi.pyrotechnics.com> References: <200402292232.51103.clinton@unknownlamer.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1078194130 25680 80.91.224.253 (2 Mar 2004 02:22:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 2 Mar 2004 02:22:10 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Mar 02 03:22:01 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AxzXl-0008IH-00 for ; Tue, 02 Mar 2004 03:22:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AxzWp-0007sT-10 for guile-user@m.gmane.org; Mon, 01 Mar 2004 21:21:03 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1Axtst-0001HR-1Y for guile-user@gnu.org; Mon, 01 Mar 2004 15:19:27 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1AxtsM-0001Bw-90 for guile-user@gnu.org; Mon, 01 Mar 2004 15:19:26 -0500 Original-Received: from [207.7.10.6] (helo=kiwi.pyro.net) by monty-python.gnu.org with smtp (Exim 4.30) id 1AxtsL-0001Av-LC for guile-user@gnu.org; Mon, 01 Mar 2004 15:18:53 -0500 Original-Received: (qmail 32251 invoked by uid 8610); 1 Mar 2004 20:20:23 -0000 Original-To: guile-user@gnu.org Mail-Followup-To: guile-user@gnu.org Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200402292232.51103.clinton@unknownlamer.org>; from clinton@unknownlamer.org on Sun, Feb 29, 2004 at 10:32:45PM -0500 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2872 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2872 On Sun, Feb 29, 2004 at 10:32:45PM -0500, Clinton Ebadi wrote: > I've been trying to get guile-pg to compile and it hasn't been working out > too well...ttn uses his new build system stuff with guile-pg and they only > work with Guile 1.4.x unless Guile has support for his extended -e syntax. Here's a patch for the sourceforge guile-pg that gets it to compile with Guile 1.6. No idea if it works with 1.7. I sent this to the (then) guile-pg maintainer years ago but he never released another version. I have been using this for a long time now with no problems, but I've never used large objects so that part is not tested. You need to run automake after applying this patch. * Makefile.am: change to work with Guile 1.6 snarfer * libpostgres.c, libpostgres_lo.c, scm/postgres.scm.in: update to use Guile 1.6 API 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 In politics you have to understand not where the voters are when a poll is taken, but where they are likely to end up on Election Day. -- Rep. Tom Davis, former NRCC Chairman _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user