in reply to Re: Wrapping C constructor with opaque pointer using Platypus
in thread Wrapping C constructor with opaque pointer using Platypus
Sorry for lateness, I was away on week-end.
Hello there. Unfortunately I can't find the Alien::igraph, did you post that somewhere? No matter though.
It's on a bitbucket repository only right now: https://bitbucket.org/fgabolde/alien-igraph
From a cursory look at the igraph library, it seems igraph API expects you to manage the allocation of igraph_t structure on your own. Either a static or malloc'ed struct, but you have to allocate it somewhere. From this I presume you'd want a chunk (sizeof(igraph_t)) of opaque data in your perl object, not an opaque pointer. HtH.
Like I said, I don't know much about C, but it does not look like the library expects me to allocate memory. From the API docs:
igraph_t g; igraph_empty(&g, 0, 1);
seems to be enough to get an initialized graph in g. If this were XS I'd just do that but I don't really understand how to drop down to C in Platypus.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Wrapping C constructor with opaque pointer using Platypus
by Corion (Patriarch) on Feb 13, 2017 at 09:51 UTC | |
by pokki (Monk) on Feb 14, 2017 at 10:13 UTC |