[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/app/e2fsprogs/e2fsprogs-1.42.9/contrib/python-uuid/uuid.c b/ap/app/e2fsprogs/e2fsprogs-1.42.9/contrib/python-uuid/uuid.c
new file mode 100644
index 0000000..34dd56a
--- /dev/null
+++ b/ap/app/e2fsprogs/e2fsprogs-1.42.9/contrib/python-uuid/uuid.c
@@ -0,0 +1,23 @@
+#include <Python.h>
+#include <time.h>
+#include <uuid/uuid.h>
+
+static PyObject * _uuid_generate(PyObject *self, PyObject *args)
+{
+ uuid_t u;
+ char uuid[37];
+ if (!PyArg_ParseTuple(args, "")) return NULL;
+ uuid_generate(u);
+ uuid_unparse(u, uuid);
+ return Py_BuildValue("s", uuid);
+}
+
+static PyMethodDef _uuid_methods[] = {
+ {"generate", _uuid_generate, METH_VARARGS, "Generate UUID"},
+ {NULL, NULL, 0, NULL}
+};
+
+void inite2fsprogs_uuid(void)
+{
+ (void) Py_InitModule("e2fsprogs_uuid", _uuid_methods);
+}