python - wrapping a custom hash table using swig -


i have custom implementation of hash table written in c application developing. want create wrapper in swig can map them native types "dict" in python. want able write single interface file can use both perl , python. first of want know if possible, or should individually each python , perl?

it's possible 1 implementation file. depending on complexity of implementation, can simple as:

%module my_hash  %inline %{ #include "my_hash.h" %} 

and generating interface code with:

swig -python my_hash.i swig -perl my_hash.i 

if have write custom typemaps, may have use #ifdef swigpython or #ifdef swigperl specify language-specific code in interface definition.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -