along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
#include <Python.h>
+#include "includes.h"
#include "librpc/ndr/libndr.h"
static PyObject *uuid_random(PyObject *self, PyObject *args)
{
struct GUID guid;
+ PyObject *pyobj;
char *str;
- if (!PyArg_ParseTuple(args, (char *)""))
+ if (!PyArg_ParseTuple(args, ""))
return NULL;
guid = GUID_random();
return NULL;
}
+ pyobj = PyString_FromString(str);
+
talloc_free(str);
- return PyString_FromString(str);
+ return pyobj;
}
static PyMethodDef methods[] = {
- { "random", (PyCFunction)uuid_random, METH_VARARGS, NULL},
+ { "uuid4", (PyCFunction)uuid_random, METH_VARARGS, NULL},
{ NULL, NULL }
};
-PyMODINIT_FUNC inituuid(void)
+void inituuid(void)
{
- PyObject *mod = Py_InitModule3((char *)"uuid", methods, "UUID helper routines");
+ PyObject *mod = Py_InitModule3("uuid", methods, "UUID helper routines");
if (mod == NULL)
return;
}