[net.lang.lisp] Passing strings back to Lisp

benson@dcdwest.UUCP (Peter Benson) (08/06/85)

In Franz Lisp 38.79 under Berkeley 4.2, the way one might pass a
string from a foreign sub-routine to lisp might look like
this:

char *
return_string()
{
	static char *item = "Return_String";
	s = (char *)calloc(strlen(item)+1,1);
	strcpy(s, item);
	return(s);
}

The function would be compiled and then loaded using something
like:


(removeaddress '_return_string)
(cfasl 'string.o '_return_string 'return_string "function" )

Nevertheless, the string which is returned is inaccessible
since it is outside the address space of Lisp.  The returned
value is always on the order of

#Other-9cd24

Does anyone know how to return strings in a reasonable way?


-- 
                                _
Peter Benson                    | ITT Defense Communications Division
(619)578-3080                   | 10060 Carroll Canyon Road
decvax!ittvax!dcdwest!benson    | San Diego, CA 92131
ucbvax!sdcsvax!dcdwest!benson   |