Re: Question about accessing global data from a line function

2016-11-30 Thread Perf Tech
, because > they often do not have a name at all. > > > > You can place reference of your my-var to package variable though and > dereference it in your C code. > > > > Regards, > > Vadim. > > > > > > > > *From:* Perf Tech [mailto:perfte...@

Question about accessing global data from a line function

2016-11-23 Thread Perf Tech
Dear expert, I am trying to access perl global variable ($data in this case) from within a inline C function, but the "data" variable I used is not defined. Any idea how to do it? Thanks Jin $data = "this is a test"; test(); use Inline C => <<'END_OF_C_CODE'; void test() { printf("here:

Re: question on implementing C function with binary string as input and output

2014-04-07 Thread Perf Tech
Thanks Rob a lot for the great example! Wish it's included in the cookbook. On Sun, Apr 6, 2014 at 7:53 PM, sisyph...@optusnet.com.au wrote: -Original Message- From: sisyph...@optusnet.com.au I don't know (off the top of my head) how to concatenate binary strings in C ...

question on implementing C function with binary string as input and output

2014-04-06 Thread Perf Tech
https://metacpan.org/pod/Inline::C-Cookbook has lots of good examples. But I can't find an example on implementing a C function which takes a perl string (may contain binary characters such as \x00 in the string) and return another perl string (with binary characters). In another word, the C