Quoth Jim Ursetto on Pungenday, the 10th of Discord:
> On Mar 24, 2011, at 8:53 PM, Peter Danenberg wrote:
> > so let's change the binding to:
> > 
> >  (foreign-lambda int "FCGX_PutStr" blob int fcgx-stream)
> 
> Shouldn't this be scheme-pointer, not blob?  I believe calling that
> with a string would result in a type error, so I am surprised you
> can get it to work.

Maybe you're right, Jim; scheme-pointer seems to work equally
well. Attached.
Index: fastcgi.scm
===================================================================
--- fastcgi.scm (revision 23250)
+++ fastcgi.scm (working copy)
@@ -50,7 +50,7 @@
 ;;;
 
 (define-foreign-type fcgx-stream c-pointer)
-(define-foreign-type fcgx-param-array (pointer c-string))
+(define-foreign-type fcgx-param-array (c-pointer c-string))
 
 (define (fcgx-init-if-necessary!)
   (unless (or *fcgi-has-been-initialised*
@@ -125,7 +125,7 @@
   (foreign-lambda c-string "FCGX_GetParam" c-string fcgx-param-array))
 
 (define fcgx-put-str
-  (foreign-lambda int "FCGX_PutStr" c-string int fcgx-stream))
+  (foreign-lambda int "FCGX_PutStr" scheme-pointer int fcgx-stream))
 
 (define fcgx-has-seen-eof
   (foreign-lambda bool "FCGX_HasSeenEOF" fcgx-stream))
@@ -199,8 +199,8 @@
 ;;; Utility function for incrementing a char**.
 (define sarray-pointer+1
   (foreign-lambda*
-    (pointer c-string)
-    (((pointer c-string) p))
+    (c-pointer c-string)
+    (((c-pointer c-string) p))
     "return(p + 1);"))
 
 (define (wrap-env e)
@@ -213,7 +213,7 @@
     ;; Convert the char ** array into a list of key/value cons pairs.
     (let loop ((strlist '()) (p e))
       (let ((deref
-             ((foreign-lambda* c-string (((pointer c-string) ps)) 
"return(*ps);")
+             ((foreign-lambda* c-string (((c-pointer c-string) ps)) 
"return(*ps);")
               p)))
         (cond
          (deref
_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to