From: Sebastian Y. F. <seb...@ye...> - 2007-06-08 17:00:06
|
Hi all, I have been trying to make use of a C library in perl or ruby, but i just can't get the typemap's to work correctly for this situation. I have readed the all the documentation and searched all over the iNet, and now its time to ask for some help ;) I just want to use the C library in perl or ruby as naturally as possible (without the use of the messy functions of cpointer.i) - My problem is with the 'typedef void * data' data type, i can't use any of the predefined typemaps because they don't work with the type void... C Library:: ----------------------------- typedef void * data; extern int data_create(int type, data *info ); // Create the data structure of the type 'type' extern int data_insert(data info, int type, const char *string ); // Insert data into the data structure. extern int data_read(data info ); // Read/Print data inside of the data structure. ----------------------------- Use in perl (or ruby):: (Example the usage, i want to accomplice) ----------------------------- ($rc, $info) = &data_create(4); // Make the swig typemap return the rc and the data structure.. $rc = &data_insert($info,4,"Testing..."); // Inserting some string.. $rc = &data_read($info); // Reading the data in $info ----------------------------- - Can some one please help me out with some examples on how the typemaps should be to make the functions: data_create, data_insert and data_read work like in the above example code.. Thanks in advanced for any help.. -- View this message in context: http://www.nabble.com/Help-Typemap%3A%3A-ruby-or-perl-tf3891041.html#a11030357 Sent from the swig-user mailing list archive at Nabble.com. |