2013-08-19 15:00:15 +02:00
|
|
|
#ifndef UTIL_LINUX_PYLIBMOUNT_H
|
|
|
|
#define UTIL_LINUX_PYLIBMOUNT_H
|
|
|
|
|
|
|
|
#include <Python.h>
|
|
|
|
#include <structmember.h>
|
|
|
|
|
|
|
|
#include "libmount.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);
|
2013-08-22 09:44:38 +02:00
|
|
|
extern void FS_AddModuleObject(PyObject *mod);
|
2013-08-19 15:00:15 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* tab.c
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
PyObject_HEAD
|
|
|
|
|
|
|
|
struct libmnt_table *tab;
|
|
|
|
struct libmnt_iter *iter;
|
|
|
|
PyObject *errcb;
|
2013-08-19 17:10:07 +02:00
|
|
|
} TableObject;
|
2013-08-19 15:00:15 +02:00
|
|
|
|
2013-08-19 17:10:07 +02:00
|
|
|
extern PyTypeObject TableType;
|
2013-08-19 15:00:15 +02:00
|
|
|
|
|
|
|
extern PyObject *PyObjectResultTab(struct libmnt_table *tab);
|
|
|
|
|
2013-08-22 09:44:38 +02:00
|
|
|
extern void Table_unref(struct libmnt_table *tab);
|
|
|
|
extern void Table_AddModuleObject(PyObject *mod);
|
|
|
|
|
2013-08-19 15:00:15 +02:00
|
|
|
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;
|
|
|
|
|
2013-08-19 17:10:07 +02:00
|
|
|
} ContextObjext;
|
2013-08-19 15:00:15 +02:00
|
|
|
|
2013-08-19 17:10:07 +02:00
|
|
|
extern PyTypeObject ContextType;
|
2013-08-22 09:44:38 +02:00
|
|
|
extern void Context_AddModuleObject(PyObject *mod);
|
2013-08-19 15:00:15 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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 */
|