guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guile-pg


From: Christopher Cramer
Subject: Re: guile-pg
Date: Tue, 26 Nov 2002 20:07:17 -0600
User-agent: Mutt/1.2.5i

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 <address@hidden> <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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]