static PyObject * api_rfc2047_encode (PyObject *self, PyObject *args) { int status; char *charset, *encoding, *text; char *buf = NULL; if (!PyArg_ParseTuple (args, "sss", &charset, &encoding, &text)) return NULL; status = mu_rfc2047_encode (charset, encoding, text, &buf); return status_object (status, PyString_FromString (buf ? buf : "")); }
static PyObject * api_mime_get_num_parts (PyObject *self, PyObject *args) { int status; size_t nparts; PyMime *py_mime; if (!PyArg_ParseTuple (args, "O!", &PyMimeType, &py_mime)) return NULL; status = mu_mime_get_num_parts (py_mime->mime, &nparts); return status_object (status, PyInt_FromSize_t (nparts)); }
static PyObject * api_stream_write (PyObject *self, PyObject *args) { int status; char *wbuf; size_t size, write_count; PyStream *py_stm; if (!PyArg_ParseTuple (args, "O!si", &PyStreamType, &py_stm, &wbuf, &size)) return NULL; status = mu_stream_write (py_stm->stm, wbuf, size, &write_count); return status_object (status, PyInt_FromLong (write_count)); }
static PyObject * api_stream_to_message (PyObject *self, PyObject *args) { int status; PyStream *py_stm; PyMessage *py_msg = PyMessage_NEW (); if (!PyArg_ParseTuple (args, "O!", &PyStreamType, &py_stm)) return NULL; Py_INCREF (py_msg); status = mu_stream_to_message (py_stm->stm, &py_msg->msg); return status_object (status, (PyObject *)py_msg); }
static PyObject * api_authority_get_ticket (PyObject *self, PyObject *args) { int status; PyAuthority *py_auth; PyTicket *py_ticket = PyTicket_NEW (); if (!PyArg_ParseTuple (args, "O!", &PyAuthorityType, &py_auth)) return NULL; Py_INCREF (py_ticket); status = mu_authority_get_ticket (py_auth->auth, &py_ticket->ticket); return status_object (status, (PyObject *)py_ticket); }
static PyObject * api_mime_get_message (PyObject *self, PyObject *args) { int status; PyMime *py_mime; PyMessage *py_msg = PyMessage_NEW (); if (!PyArg_ParseTuple (args, "O!", &PyMimeType, &py_mime)) return NULL; status = mu_mime_get_message (py_mime->mime, &py_msg->msg); Py_INCREF (py_msg); return status_object (status, (PyObject *)py_msg); }
static PyObject * api_mime_get_part (PyObject *self, PyObject *args) { int status; Py_ssize_t npart; PyMime *py_mime; PyMessage *py_part = PyMessage_NEW (); if (!PyArg_ParseTuple (args, "O!n", &PyMimeType, &py_mime, &npart)) return NULL; ASSERT_INDEX_RANGE (npart, "mime part"); status = mu_mime_get_part (py_mime->mime, npart, &py_part->msg); Py_INCREF (py_part); return status_object (status, (PyObject *)py_part); }
static PyObject * api_wicket_get_ticket (PyObject *self, PyObject *args) { int status; char *user; PyWicket *py_wicket; PyTicket *py_ticket = PyTicket_NEW (); if (!PyArg_ParseTuple (args, "O!s", &PyWicketType, &py_wicket, &user)) return NULL; Py_INCREF (py_ticket); status = mu_wicket_get_ticket (py_wicket->wicket, user, &py_ticket->ticket); return status_object (status, (PyObject *)py_ticket); }