Toby,

Here are two examples.  In one I create the string on the heap and
return it as a scheme-object from the C code.  In the other I write
directly into a scheme string, using a locative as the pointer. 
Neither probably works with UTF-8.  You didn't specify how the to-len
was computed, so I assume it is a function of the from-len.  Here is
an example transcript; it assumes you saved the examples to
nullstr.scm and ran csc -s nullstr.scm.

#;1> (use nullstr)
; loading ./nullstr.so ...
#;2> (foo "abc")
"bcd"
#;3> (foo2 "abc")
"bcd"
#;4> (byte-vector->string (byte-vector 66 67 0 255 68 69))
"BC\


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to