[squeak-dev] Pass C string into Squeak

Igor Stasenko siguctua at gmail.com
Wed Jan 6 09:52:45 UTC 2010


2010/1/6 Ang BeePeng <beepeng86 at yahoo.com>:
>
> Hi.
>
> I wish I can get some help on this. I want to pass a C string into Squeak. I
> saw "primitiveStringAtPut", "primitiveStringReplace" etc.. I'm thinking of
> call a primitive in smalltalk, pass an empty String object onto stack, then
> have interpreter/primitive to fill in the String. Any better way to achieve
> that? What precaution should I take, to prevent C string from causing error
> once it is in Squeak?
>

There is an interface to _create_ string objects in primitive, without
modifying existing one.
Load VMMaker into your image and look for senders of stringClass (or
byteStringClass , if i'm not mistaken).
You can see an example how to create a strings object and fill with
with contents from C string.

> Thanks.
>
> Ang Beepeng
> --
> View this message in context: http://n4.nabble.com/Pass-C-string-into-Squeak-tp999636p999636.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list