X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=perl%2FGuestfs.xs;h=5905dc5eb84ae519c35d18084bf0f98acc9ffdbe;hp=8a6c4bb927947a47221624e04ddce70b845540c6;hb=ad8a256f54a6cb99f89bb444c8597a152a793dce;hpb=05c34c1c1479bb07b31cfbf912743a8cf014a636;ds=sidebyside diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs index 8a6c4bb..5905dc5 100644 --- a/perl/Guestfs.xs +++ b/perl/Guestfs.xs @@ -2583,3 +2583,22 @@ PREINIT: } free (lines); +void +glob_expand (g, pattern) + guestfs_h *g; + char *pattern; +PREINIT: + char **paths; + int i, n; + PPCODE: + paths = guestfs_glob_expand (g, pattern); + if (paths == NULL) + croak ("glob_expand: %s", guestfs_last_error (g)); + for (n = 0; paths[n] != NULL; ++n) /**/; + EXTEND (SP, n); + for (i = 0; i < n; ++i) { + PUSHs (sv_2mortal (newSVpv (paths[i], 0))); + free (paths[i]); + } + free (paths); +