axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] Re: sock_get_string_buf


From: Camm Maguire
Subject: Re: [Axiom-developer] Re: sock_get_string_buf
Date: 01 Nov 2006 20:31:55 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  Here is the patch in 2005901-9:

--- ./src/interp/sockio.lisp.pamphlet.orig      2006-11-01 16:18:42.000000000 
-0500
+++ ./src/interp/sockio.lisp.pamphlet   2006-11-01 16:20:19.000000000 -0500
@@ -73,13 +73,18 @@
 (progn
   (clines "extern double plus_infinity(), minus_infinity(), NANQ();")
   (clines "extern double sock_get_float();")
+  (clines "int sock_get_string_buf_wrapper(int i, object x, int j)"
+          "{ if (type_of(x)!=t_string) FEwrong_type_argument(sLstring,x);"
+          "   if (x->st.st_fillp<j) FEerror(\"string too small in 
sock_get_string_buf_wrapper\",0);"
+          "   return sock_get_string_buf(i, x->st.st_self, j);}")
   (defentry open_server (string) (int "open_server"))
   (defentry sock_get_int (int) (int "sock_get_int"))
   (defentry sock_send_int (int int) (int "sock_send_int"))
-  (defentry sock_get_string_buf (int string int) (int "sock_get_string_buf"))
+;  (defentry sock_get_string_buf (int string int) (int "sock_get_string_buf"))
+  (defentry sock_get_string_buf (int object int)  (int 
"sock_get_string_buf_wrapper"))
   (defentry sock_send_string_len (int string int) (int "sock_send_string_len"))
   (defentry sock_get_float (int) (double "sock_get_float"))
-  (defentry sock_send_float (int float) (int "sock_send_float"))
+  (defentry sock_send_float (int double) (int "sock_send_float"))
   (defentry sock_send_wakeup (int int) (int "sock_send_wakeup"))
   (defentry server_switch () (int "server_switch"))
   (defentry flush_stdout () (int "flush_stdout"))


There are a few others to be found in debian/patch.all and
debian/patch.merge against this source.  I still use this (20050901)
as the base as it is the last posted tarball.

Take care,

Gabriel Dos Reis <address@hidden> writes:

> Waldek Hebisch <address@hidden> writes:
> 
> | > Greetings, and thanks so much!
> | > 
> | > Waldek Hebisch <address@hidden> writes:
> | > 
> | > > I again had problem with "sock_get_string_buf": trying to use hypertex
> | > > functions which require Axiom (for example search or tutorial input)
> | > > gives:
> | > > 
> | > > (1) ->
> | > >    >> System error:
> | > >    Unexpected end of #<string-input stream from "                ...">.
> | > > 
> | > > Recent patch to gcl fixed the problem on many machines. But on one
> | > > machine (using 2.4.31 kerenel) I was still getting this error.
> | > > 
> | > > So I tried the patch below and it solved the problem.  AFAICS the
> | > > problem is that GCL string parameter wants to preserve string
> | > > _value_, but what Axiom want is pass by reference.  My undersanding
> | > > is that GCL has full right to copy the string, so the only relaiable
> | > > solution must use 'object' type and extract string address from it.
> | > > 
> | > > Remark1: It seems that "official" GCL foreign function interface is
> | > > is very incomplete for real world needs. I would suggest either
> | > > promoting 'object' structure as documented, official low level
> | > > interface, or adding few more arguments types (mostly arrays by 
> reference).
> | > > 
> | > > Remark 2: This may be related to Debian bug 328480 (but what Camm
> | > > wrote seem indicate different problem).
> | > > 
> | > 
> | > This indeed fixes the above -- thanks!  Some axiom code must be
> | > declining do write to a copied buffer or some such.
> | > 
> | > May I suggest adding
> | > 
> | >           "   if (x->st.st_fillp<j) FEerror(\"string too small\",0);"
> | >
> | 
> | Yes, good idea.
> 
> 
> Great!
> 
> I would like to see the final patch, e.g. the things that would be
> committed, including the explanation of what the code and what is
> going in the pamphletss.
> 
> -- Gaby
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

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