Re: obtaining a pointer to a pointer for nlffi

John Reppy <[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
I'm not an NLFFI expert, but I suspect that you need to allocate a word
to hold the pointer to the string too.   ML variables (e.g., stringList)
don't occupy memory that is visible to C.

	- John

On Dec 30, 2006, at 8:44 PM, brian wrote:

> I need a char ** for the arg to a function.
>
> So I created a char * to actually hold the string
>
> stringList = C.alloc C.T.uchar (Word.fromInt (size name + 1))
>
> Then I tried the obvious:
>
> C.Ptr.|&| stringList
>
> but I get an error:
>
>    operator domain: ('Z,'Y) C.obj
>    operand:         (C.uchar,'X) C.obj C.ptr
>    in expression:
>      C.Ptr.|&| stringList
>
> The error message makes perfect sense, it's trying to create a ptr to
> an obj, but I already have a ptr, not an obj.  Unfortunately I can't
> figure out how to make it take the ptr of a ptr.
>
> Help...
>
> Thanks
>
> Brian
>
>
> ---------------------------------------------------------------------- 
> ---
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to  
> share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php? 
> page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Smlnj-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/smlnj-list


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.