source: swig/python/language.i @ df3fe37

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

return binary representations of ID and attr certs in abac_chunk_t
suitable for passing off to libabac
supported in perl and python natively
closes #9

  • Property mode set to 100644
File size: 558 bytes
Line 
1%include "chunk.i"
2
3%typemap(argout) bool &success {
4    PyObject *o, *o2, *o3;
5    o = PyBool_FromLong(*$1);
6    if ((!$result) || ($result == Py_None)) {
7        $result = o;
8    } else {
9        if (!PyTuple_Check($result)) {
10            PyObject *o2 = $result;
11            $result = PyTuple_New(1);
12            PyTuple_SetItem($result,0,o2);
13        }
14        o3 = PyTuple_New(2);
15        PyTuple_SetItem(o3,0,o);
16        PyTuple_SetItem(o3,1,$result);
17        $result = o3;
18    }
19}
20
21%typemap(in,numinputs=0) bool &success(bool temp) {
22    $1 = &temp;
23}
Note: See TracBrowser for help on using the repository browser.