| 50 | | /* http://www.swig.org/Doc1.1/HTML/Python.html#n11 */ |
| | 50 | %typemap(in) (obexftp_info_cb_t infocb, void *user_data) { |
| | 51 | if (!PyCallable_Check($input)) { |
| | 52 | /* should raise an exception here */ |
| | 53 | $1 = NULL; |
| | 54 | $2 = NULL; |
| | 55 | } else { |
| | 56 | Py_XINCREF($input); |
| | 57 | $1 = proxy_info_cb; |
| | 58 | $2 = $input; |
| | 59 | } |
| | 60 | }; |
| | 61 | %{ |
| | 62 | static void proxy_info_cb (int evt, const char *buf, int len, void *data) { |
| | 63 | PyObject *proc = (PyObject *)data; |
| | 64 | /* PyObject *msg = PyString_FromStringAndSize(buf, len); */ |
| | 65 | PyObject_CallFunction(proc, "is", evt, buf); |
| | 66 | } |
| | 67 | %} |