static PyObject * stpy_get_producer (PyObject *self, void *closure) { struct symtab *symtab = NULL; struct compunit_symtab *cust; STPY_REQUIRE_VALID (self, symtab); cust = SYMTAB_COMPUNIT (symtab); if (COMPUNIT_PRODUCER (cust) != NULL) { const char *producer = COMPUNIT_PRODUCER (cust); return host_string_to_python_string (producer); } Py_RETURN_NONE; }
static PyObject * stpy_get_producer (PyObject *self, void *closure) { struct symtab *symtab = NULL; struct compunit_symtab *cust; STPY_REQUIRE_VALID (self, symtab); cust = SYMTAB_COMPUNIT (symtab); if (COMPUNIT_PRODUCER (cust) != NULL) { const char *producer = COMPUNIT_PRODUCER (cust); return PyString_Decode (producer, strlen (producer), host_charset (), NULL); } Py_RETURN_NONE; }