Code: Show/Hide #ifndef __RANDPT_H #define __RANDPT_H #define I_RANDPT "randpt-1" typedef struct Irandpt { INTERFACE_HEAD_DECL /* pyint: impl */ void (*RandomPoint)(Arena *a, Region *rgn, int *x, int *y); /* pyint: arena, region, int out, int out -> void */ } Irandpt; #endif |
Code: Show/Hide /* implementing interface I_RANDPT in python {{{ */ local void pyint_func_I_RANDPT_Check(Arena *arg1_in, Region * arg2_in, int *arg3_out, int *arg4_out) { PyObject *args, *out; int arg3_out_v; int arg4_out_v; args = Py_BuildValue("(O&O&)", cvt_c2p_arena, arg1_in, cvt_c2p_region, arg2_in); if (!args) { log_py_exception(L_ERROR, "python error building args for " "function Check in interface I_RANDPT"); return ; } out = call_gen_py_interface(PYINTPREFIX I_RANDPT, "Check", args, arg1_in); if (!out) { log_py_exception(L_ERROR, "python error calling " "function Check in interface I_RANDPT"); return ; } if (!PyArg_ParseTuple(out, "ii", &arg3_out_v, &arg4_out_v)) { Py_DECREF(out); log_py_exception(L_ERROR, "python error unpacking results of " "function Check in interface I_RANDPT"); return ; } *arg3_out = arg3_out_v; *arg4_out = arg4_out_v; Py_DECREF(out); return ; } local struct Irandpt pyint_int_I_RANDPT = { INTERFACE_HEAD_INIT(I_RANDPT, "pyint-I_RANDPT") pyint_func_I_RANDPT_Check }; /* }}} */ |