Files
guestfs-inspect/libguestfs-inspect.h
2024-03-03 01:01:56 -05:00

32 lines
744 B
C

enum guestfs_inspect_command {
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 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;
}