On Friday 21 July 2006 00:57, Leopold Toetsch wrote:

> This can't work for several reasons:
>
> 1) the NCI call signatures don't match the C functions' args:
>
>       .store_nci_func( 'const_string', 'ppt' )
>
> should be: 'SIt'  (return STRING*, interp & C-cstring args)
>
>       .store_nci_func( 'string_to_cstring', 'tpp' )
>
> should be: "tIS"  (return C-string, interp & STRING args)
>
> (You could use 'pIt' and 'pIp' signatures too, then the STRING* result of
> the 'const_string' would be wrapped into a ManagedStruct PMC).

I don't see documentation for the S or I parameters anywhere in the NCI PDD.  
Is there a better place for them?

> 2) print does *not* take c-strings, but STRINGs, therefore:
>
>       hello = string_to_cstring( interpreter, greet_string )
>       print hello
>
> is likely to just segfault.

I did oversimplify the code somewhat.  Here's what I really want to run.

-- c

Reply via email to