32 lines
756 B
C
32 lines
756 B
C
enum guestfs_inspect_command_const {
|
|
GUESTFS_COMMAND_LS,
|
|
/* GUESTFS_COMMAND_TOUCH, */
|
|
/* GUESTFS_COMMAND_MKDIR, */
|
|
GUESTFS_COMMAND_CAT
|
|
};
|
|
|
|
struct guestfs_ls_args {
|
|
size_t path_length;
|
|
char path[];
|
|
};
|
|
struct guestfs_cat_args {};
|
|
|
|
struct guestfs_inpsect_command {
|
|
enum guestfs_inspect_command_const command;
|
|
union {
|
|
struct guestfs_ls_args ls;
|
|
struct guestfs_cat_args cat;
|
|
} args;
|
|
size_t name_length;
|
|
char name[];
|
|
};
|
|
|
|
static char *endpoint() {
|
|
// TODO: This should be based on GUESTFS_INSPECT_ENDPOINT, or XDG_RUNTIME_DIR if the former is not set, and default to a sensible path if neither are set.
|
|
const char* ep = "ipc:///tmp/guestfs-inspect.sock";
|
|
char *res = malloc(strlen(ep) + 1);
|
|
strcpy(res, ep);
|
|
return res;
|
|
}
|
|
|