-
Notifications
You must be signed in to change notification settings - Fork 1
/
libdevmapper.h
73 lines (52 loc) · 1.35 KB
/
libdevmapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef LIB_DEVICE_MAPPER_H
#define LIB_DEVICE_MAPPER_H
/* The only functions I need from <libdevmapper.h>. It cannot be directly
* included by C++ source. Thanks, guys. */
#include <features.h>
#ifdef __cplusplus
# include <cstdint>
#else
# include <stdint.h>
#endif
/* let's hope they don't change these on us */
enum {
DM_DEVICE_CREATE,
DM_DEVICE_RELOAD,
DM_DEVICE_REMOVE,
DM_DEVICE_REMOVE_ALL,
DM_DEVICE_SUSPEND,
DM_DEVICE_RESUME,
DM_DEVICE_INFO,
DM_DEVICE_DEPS,
DM_DEVICE_RENAME,
DM_DEVICE_VERSION,
DM_DEVICE_STATUS,
DM_DEVICE_TABLE,
DM_DEVICE_WAITEVENT,
DM_DEVICE_LIST,
DM_DEVICE_CLEAR,
DM_DEVICE_MKNODES,
DM_DEVICE_LIST_VERSIONS,
DM_DEVICE_TARGET_MSG,
DM_DEVICE_SET_GEOMETRY
};
typedef void (*dm_log_fn) (int level, const char *file, int line,
const char *f, ...)
__attribute__ ((format(printf, 4, 5)));
#ifdef __cplusplus
extern "C" {
#endif
void dm_log_init(dm_log_fn fn);
void dm_log_init_verbose(int level);
struct dm_task;
struct dm_task *dm_task_create(int type);
void dm_task_destroy(struct dm_task *dmt);
int dm_task_set_name(struct dm_task *dmt, const char *name);
int dm_task_add_target(struct dm_task *dmt, uint64_t start, uint64_t size,
const char *ttype, const char *params);
int dm_task_run(struct dm_task *dmt);
int dm_task_set_uuid(struct dm_task *dmt, const char *uuid);
#ifdef __cplusplus
}
#endif
#endif