summaryrefslogtreecommitdiffstats
path: root/libmount/python/pylibmount.h
diff options
context:
space:
mode:
authorOndrej Oprala2013-08-19 15:00:15 +0200
committerKarel Zak2013-08-19 15:00:15 +0200
commit813683a3525d0530968698b92cd604b1f49b26a7 (patch)
treecc745538765055bca6dfc74c1728de6b76184f5c /libmount/python/pylibmount.h
parentbuild-sys: add pylibmount (diff)
downloadkernel-qcow2-util-linux-813683a3525d0530968698b92cd604b1f49b26a7.tar.gz
kernel-qcow2-util-linux-813683a3525d0530968698b92cd604b1f49b26a7.tar.xz
kernel-qcow2-util-linux-813683a3525d0530968698b92cd604b1f49b26a7.zip
pylibmount: basic code
[kzak@redhat.com: - split to more patches - split to more .c files] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/python/pylibmount.h')
-rw-r--r--libmount/python/pylibmount.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/libmount/python/pylibmount.h b/libmount/python/pylibmount.h
new file mode 100644
index 000000000..6903d1f7f
--- /dev/null
+++ b/libmount/python/pylibmount.h
@@ -0,0 +1,78 @@
+#ifndef UTIL_LINUX_PYLIBMOUNT_H
+#define UTIL_LINUX_PYLIBMOUNT_H
+
+#include <Python.h>
+#include <structmember.h>
+
+#include "libmount.h"
+#include "mountP.h"
+
+#define NODEL_ATTR "This attribute cannot be deleted"
+#define CONSTRUCT_ERR "Error during object construction"
+#define ARG_ERR "Invalid number or type of arguments"
+#define NOFS_ERR "No filesystems to mount"
+#define MEMORY_ERR strerror(ENOMEM)
+#define CONV_ERR "Type conversion failed"
+
+/*
+ * fs.c
+ */
+typedef struct {
+ PyObject_HEAD
+ struct libmnt_fs *fs;
+} FsObject;
+
+extern PyTypeObject FsType;
+
+extern PyObject *PyObjectResultFs(struct libmnt_fs *fs);
+
+extern void pymnt_init_fs(PyObject *mod);
+
+/*
+ * tab.c
+ */
+typedef struct {
+ PyObject_HEAD
+
+ struct libmnt_table *tab;
+ struct libmnt_iter *iter;
+ PyObject *errcb;
+} TabObject;
+
+extern PyTypeObject TabType;
+
+extern PyObject *PyObjectResultTab(struct libmnt_table *tab);
+
+extern void pymnt_init_table(PyObject *mod);
+extern void pymnt_free_table(struct libmnt_table *tab);
+extern int pymnt_table_parser_errcb(struct libmnt_table *tb, const char *filename, int line);
+
+/*
+ * context.c
+ */
+typedef struct {
+ PyObject_HEAD
+
+ struct libmnt_context *cxt;
+ PyObject *table_errcb;
+
+} CxtObject;
+
+extern PyTypeObject CxtType;
+extern void pymnt_init_context(PyObject *mod);
+
+/*
+ * misc
+ */
+extern PyObject *LibmountError;
+extern PyObject *UL_IncRef(void *killme);
+extern void *UL_RaiseExc(int e);
+
+extern PyObject *PyObjectResultInt(int i);
+extern PyObject *PyObjectResultStr(const char *s);
+
+extern char *pystos(PyObject *pys);
+
+
+
+#endif /* UTIL_LINUX_PYLIBMOUNT */