static PyObject* python_api_incoming_message(PyObject *self, PyObject *args) { PyObject *barejid = NULL; PyObject *resource = NULL; PyObject *message = NULL; if (!PyArg_ParseTuple(args, "OOO", &barejid, &resource, &message)) { Py_RETURN_NONE; } char *barejid_str = python_str_or_unicode_to_string(barejid); char *resource_str = python_str_or_unicode_to_string(resource); char *message_str = python_str_or_unicode_to_string(message); allow_python_threads(); api_incoming_message(barejid_str, resource_str, message_str); free(barejid_str); free(resource_str); free(message_str); disable_python_threads(); Py_RETURN_NONE; }
static void c_api_incoming_message(char *barejid, char *resource, char *message) { api_incoming_message(barejid, resource, message); }