Go to the source code of this file.
Functions | |
SRD_PRIV int | py_attr_as_str (const PyObject *py_obj, const char *attr, char **outstr) |
Get the value of a Python object's attribute, returned as a newly allocated char *. More... | |
SRD_PRIV int | py_dictitem_as_str (const PyObject *py_obj, const char *key, char **outstr) |
Get the value of a Python dictionary item, returned as a newly allocated char *. More... | |
SRD_PRIV int | py_str_as_str (const PyObject *py_str, char **outstr) |
Get the value of a Python unicode string object, returned as a newly allocated char *. More... | |
SRD_PRIV int | py_strlist_to_char (const PyObject *py_strlist, char ***outstr) |
Convert a Python list of unicode strings to a NULL-terminated UTF8-encoded char * array. More... | |
SRD_PRIV int py_attr_as_str | ( | const PyObject * | py_obj, |
const char * | attr, | ||
char ** | outstr | ||
) |
Get the value of a Python object's attribute, returned as a newly allocated char *.
py_obj | The object to probe. |
attr | Name of the attribute to retrieve. |
outstr | ptr to char * storage to be filled in. |
Definition at line 36 of file util.c.
References py_str_as_str(), srd_dbg(), SRD_ERR_PYTHON, and srd_exception_catch().
Referenced by srd_decoder_load().
SRD_PRIV int py_dictitem_as_str | ( | const PyObject * | py_obj, |
const char * | key, | ||
char ** | outstr | ||
) |
Get the value of a Python dictionary item, returned as a newly allocated char *.
py_obj | The dictionary to probe. |
key | Key of the item to retrieve. |
outstr | Pointer to char * storage to be filled in. |
Definition at line 77 of file util.c.
References py_str_as_str(), srd_dbg(), and SRD_ERR_PYTHON.
SRD_PRIV int py_str_as_str | ( | const PyObject * | py_str, |
char ** | outstr | ||
) |
Get the value of a Python unicode string object, returned as a newly allocated char *.
py_str | The unicode string object. |
outstr | ptr to char * storage to be filled in. |
Definition at line 115 of file util.c.
References srd_dbg(), SRD_ERR_MALLOC, SRD_ERR_PYTHON, srd_exception_catch(), and SRD_OK.
Referenced by py_attr_as_str(), py_dictitem_as_str(), srd_decoder_doc_get(), srd_decoder_searchpath_add(), srd_exception_catch(), and srd_inst_option_set().
SRD_PRIV int py_strlist_to_char | ( | const PyObject * | py_strlist, |
char *** | outstr | ||
) |
Convert a Python list of unicode strings to a NULL-terminated UTF8-encoded char * array.
The caller must g_free() each string when finished.
py_strlist | The list object. |
outstr | ptr to char ** storage to be filled in. |
Definition at line 169 of file util.c.
References srd_err(), SRD_ERR_MALLOC, SRD_ERR_PYTHON, and SRD_OK.
Referenced by srd_decoder_load().