source: swig/perl/language.i @ 02888af

abac0-leakabac0-meicompt_changesgec13mei-idmei-rt0-nmei_rt0mei_rt2mei_rt2_fix_1meiyap-rt1meiyap1rt2tvf-new-xml
Last change on this file since 02888af was e17b1fa, checked in by Mike Ryan <mikeryan@…>, 14 years ago

map abac_chunk_t <-> scalar in perl

  • Property mode set to 100644
File size: 514 bytes
Line 
1%typemap(argout) bool &success {
2    --argvi;
3    SV *array = $result;
4
5    $result = sv_newmortal();
6    sv_setiv($result, *$1);
7    ++argvi;
8
9    $result = array;
10    ++argvi;
11}
12
13%typemap(in,numinputs=0) bool &success(bool temp) {
14    $1 = &temp;
15}
16
17// abac_chunk_t is a string
18%typemap(in) abac_chunk_t {
19    STRLEN len;
20    $1.ptr = (unsigned char *)SvPV($input, len);
21    $1.len = len;
22}
23
24%typemap(out) abac_chunk_t {
25    $result = newSVpvn(
26        (const char *)$1.ptr,
27        $1.len
28    );
29    ++argvi;
30}
Note: See TracBrowser for help on using the repository browser.