X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Favailable.c;h=17ce1b13f187a330de0df8aecbfc1add764b0b03;hb=aec3091fa9c65e2f84d0bf9cdd520e597957eca9;hp=77fdfa2c7ccb5f05c4fec942e760d2e7a00a222c;hpb=2d9953097b6d3b71122d444a4550047e97aee009;p=libguestfs.git diff --git a/daemon/available.c b/daemon/available.c index 77fdfa2..17ce1b1 100644 --- a/daemon/available.c +++ b/daemon/available.c @@ -22,7 +22,7 @@ #include #include -#include "../src/guestfs_protocol.h" +#include "guestfs_protocol.h" #include "daemon.h" #include "actions.h" @@ -53,3 +53,21 @@ do_available (char *const *groups) return 0; } + +char ** +do_available_all_groups (void) +{ + size_t i; + char **groups = NULL; + int size = 0, alloc = 0; + + for (i = 0; optgroups[i].group != NULL; ++i) { + if (add_string (&groups, &size, &alloc, optgroups[i].group) == -1) + return NULL; + } + + if (add_string (&groups, &size, &alloc, NULL) == -1) + return NULL; + + return groups; /* caller frees */ +}