At 4:35 PM -0400 5/20/05, C. Scott Ananian wrote:
On Fri, 20 May 2005, Dan Sugalski wrote:

Well, mostly. string->cstring conversion is potentially lossy, if for no other reason than embedded nulls will get in your way. I see we're not exposing anything to do that, though, which we ought to fix.

pascal-style strings (ie, char* and length) are the canonical way to fix this. C code generally doesn't have too much trouble replacing strcpy with memcpy, etc...

That's what parrot strings are. (Well, a bit more than that, since we carry around encoding and charset information as well) It's only when you drop down to C-style "blob 'o memory with an in-band EOS marker" that you run into trouble.


There are interfaces in the extension system to get a void * and length back from a PMC when fetching string data out, but I see we don't have that for plain strings. I'll probably fix that this weekend if someone doesn't beat me to it.
--
Dan


--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to