[Ecls-list] C-STRINGs and lisp strings

Goffioul Michael goffioul at imec.be
Tue Jun 28 08:05:11 UTC 2005


> 1) The user may call the function with a lisp string. Then the should 
> not expect to be able to retreive data from the string. 
> Function "f" may 
> or may not get a pointer to the lisp string, depending on 
> whether it has 
> a fill pointer or not.
> 
> 2) The user creates a c-string, as mandated by UFFI. Then the routine 
> ecl_string_safe_pointer() will do nothing because the array 
> it gets is a 
> simple one (i.e. no fill pointer). The function "f" gets then 
> a pointer 
> to the c-string, it is free to write on the string and the 
> user will see 
> those changes.

So, any such pattern (C function accepting a char buffer) should be
enclosed within a WITH-CSTRING (or equivalent) statement?

Michael.


More information about the ecl-devel mailing list