examples: Rename example programs, replacing '_' with '-'.

This commit is contained in:
Richard W.M. Jones
2013-02-12 15:02:43 +00:00
parent 4215d0ca68
commit e84d6e6102
10 changed files with 45 additions and 38 deletions

12
.gitignore vendored
View File

@@ -96,17 +96,17 @@ Makefile.in
/erlang/guestfs.beam
/erlang/guestfs.erl
/erlang/test.img
/examples/copy_over
/examples/create_disk
/examples/display_icon
/examples/copy-over
/examples/create-disk
/examples/display-icon
/examples/guestfs-examples.3
/examples/guestfs-faq.1
/examples/guestfs-performance.1
/examples/guestfs-recipes.1
/examples/guestfs-testing.1
/examples/inspect_vm
/examples/libvirt_auth
/examples/mount_local
/examples/inspect-vm
/examples/libvirt-auth
/examples/mount-local
/examples/stamp-guestfs-examples.pod
/examples/stamp-guestfs-faq.pod
/examples/stamp-guestfs-performance.pod

View File

@@ -21,7 +21,14 @@ EXTRA_DIST = \
guestfs-faq.pod \
guestfs-performance.pod \
guestfs-recipes.pod \
guestfs-testing.pod
guestfs-testing.pod \
copy-over.c \
create-disk.c \
display-icon.c \
inspect-vm.c \
libvirt-auth.c \
mount-local.c \
virt-dhcp-address.c
CLEANFILES = \
stamp-guestfs-examples.pod \
@@ -30,19 +37,19 @@ CLEANFILES = \
stamp-guestfs-recipes.pod \
stamp-guestfs-testing.pod
noinst_PROGRAMS = create_disk display_icon inspect_vm
noinst_PROGRAMS = create-disk display-icon inspect-vm
if HAVE_LIBVIRT
noinst_PROGRAMS += copy_over libvirt_auth
noinst_PROGRAMS += copy-over libvirt-auth
endif
if HAVE_HIVEX
noinst_PROGRAMS += virt-dhcp-address
endif
if HAVE_FUSE
noinst_PROGRAMS += mount_local
noinst_PROGRAMS += mount-local
endif
if HAVE_LIBVIRT
copy_over_SOURCES = copy_over.c
copy_over_SOURCES = copy-over.c
copy_over_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-I$(top_srcdir)/src -I$(top_builddir)/src
@@ -55,7 +62,7 @@ copy_over_LDADD = \
$(top_builddir)/src/libguestfs.la \
$(LIBVIRT_LIBS)
libvirt_auth_SOURCES = libvirt_auth.c
libvirt_auth_SOURCES = libvirt-auth.c
libvirt_auth_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-I$(top_srcdir)/src -I$(top_builddir)/src
@@ -69,7 +76,7 @@ libvirt_auth_LDADD = \
$(LIBVIRT_LIBS)
endif
create_disk_SOURCES = create_disk.c
create_disk_SOURCES = create-disk.c
create_disk_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-I$(top_srcdir)/src -I$(top_builddir)/src
@@ -79,7 +86,7 @@ create_disk_CFLAGS = \
create_disk_LDADD = \
$(top_builddir)/src/libguestfs.la
display_icon_SOURCES = display_icon.c
display_icon_SOURCES = display-icon.c
display_icon_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-I$(top_srcdir)/src -I$(top_builddir)/src
@@ -89,7 +96,7 @@ display_icon_CFLAGS = \
display_icon_LDADD = \
$(top_builddir)/src/libguestfs.la
inspect_vm_SOURCES = inspect_vm.c
inspect_vm_SOURCES = inspect-vm.c
inspect_vm_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-I$(top_srcdir)/src -I$(top_builddir)/src
@@ -100,7 +107,7 @@ inspect_vm_LDADD = \
$(top_builddir)/src/libguestfs.la
if HAVE_FUSE
mount_local_SOURCES = mount_local.c
mount_local_SOURCES = mount-local.c
mount_local_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \
-I$(top_srcdir)/src -I$(top_builddir)/src
@@ -142,17 +149,17 @@ noinst_DATA = \
guestfs-examples.3 $(top_builddir)/html/guestfs-examples.3.html: stamp-guestfs-examples.pod
stamp-guestfs-examples.pod: guestfs-examples.pod create_disk.c inspect_vm.c
stamp-guestfs-examples.pod: guestfs-examples.pod copy-over.c create-disk.c display-icon.c inspect-vm.c libvirt-auth.c mount-local.c virt-dhcp-address.c
$(PODWRAPPER) \
--section 3 \
--man guestfs-examples.3 \
--html $(top_builddir)/html/guestfs-examples.3.html \
--verbatim $(srcdir)/copy_over.c:@COPY_OVER@ \
--verbatim $(srcdir)/create_disk.c:@CREATE_DISK@ \
--verbatim $(srcdir)/display_icon.c:@DISPLAY_ICON@ \
--verbatim $(srcdir)/inspect_vm.c:@INSPECT_VM@ \
--verbatim $(srcdir)/libvirt_auth.c:@LIBVIRT_AUTH@ \
--verbatim $(srcdir)/mount_local.c:@MOUNT_LOCAL@ \
--verbatim $(srcdir)/copy-over.c:@COPY_OVER@ \
--verbatim $(srcdir)/create-disk.c:@CREATE_DISK@ \
--verbatim $(srcdir)/display-icon.c:@DISPLAY_ICON@ \
--verbatim $(srcdir)/inspect-vm.c:@INSPECT_VM@ \
--verbatim $(srcdir)/libvirt-auth.c:@LIBVIRT_AUTH@ \
--verbatim $(srcdir)/mount-local.c:@MOUNT_LOCAL@ \
--verbatim $(srcdir)/virt-dhcp-address.c:@VIRT_DHCP_ADDRESS@ \
--license examples \
$<

View File

@@ -39,14 +39,14 @@ static void
usage (void)
{
fprintf (stderr,
"Usage: copy_over source srcdir dest destdir\n"
"Usage: copy-over source srcdir dest destdir\n"
"\n"
" source : the source domain (a libvirt guest name)\n"
" srcdir : the directory to copy from the source guest\n"
" dest : the destination domain (a libvirt guest name)\n"
" destdir : the destination directory (must exist at destination)\n"
"\n"
"eg: copy_over Src /home/rjones Dest /tmp/dir\n"
"eg: copy-over Src /home/rjones Dest /tmp/dir\n"
"would copy /home/rjones from Src to /tmp/dir on Dest\n"
"\n"
"The destination guest cannot be running.\n");
@@ -196,7 +196,7 @@ start_srcthread (void *arg)
/* This function deals with the complexity of adding the domain,
* launching the handle, and mounting up filesystems. See
* 'examples/inspect_vm.c' to understand how this works.
* 'examples/inspect-vm.c' to understand how this works.
*/
static int
open_guest (guestfs_h *g, const char *dom, int readonly)
@@ -219,7 +219,7 @@ open_guest (guestfs_h *g, const char *dom, int readonly)
return -1;
if (roots[0] == NULL || roots[1] != NULL) {
fprintf (stderr, "copy_over: %s: no operating systems or multiple operating systems found\n", dom);
fprintf (stderr, "copy-over: %s: no operating systems or multiple operating systems found\n", dom);
return -1;
}

View File

@@ -31,7 +31,7 @@ main (int argc, char *argv[])
FILE *fp;
if (argc != 2) {
fprintf (stderr, "usage: display_icon disk.img\n");
fprintf (stderr, "usage: display-icon disk.img\n");
exit (EXIT_FAILURE);
}
disk = argv[1];
@@ -59,7 +59,7 @@ main (int argc, char *argv[])
if (roots == NULL)
exit (EXIT_FAILURE);
if (roots[0] == NULL) {
fprintf (stderr, "display_icon: no operating systems found\n");
fprintf (stderr, "display-icon: no operating systems found\n");
exit (EXIT_FAILURE);
}

View File

@@ -13,7 +13,7 @@ usage (void)
fprintf (stderr,
"Usage:\n"
"\n"
" libvirt_auth URI domain\n"
" libvirt-auth URI domain\n"
"\n"
"where:\n"
"\n"
@@ -22,7 +22,7 @@ usage (void)
"\n"
"Example:\n"
"\n"
" libvirt_auth 'qemu+libssh2://USER@localhost/system' 'foo'\n"
" libvirt-auth 'qemu+libssh2://USER@localhost/system' 'foo'\n"
"\n"
"would connect (read-only) to libvirt URI given and open the guest\n"
"called 'foo' and list some information about its filesystems.\n"
@@ -109,7 +109,7 @@ auth_callback (guestfs_h *g,
ssize_t len;
int r;
printf ("libvirt_auth.c: authentication required for libvirt URI '%s'\n\n",
printf ("libvirt-auth.c: authentication required for libvirt URI '%s'\n\n",
buf);
/* Ask libguestfs what credentials libvirt is demanding. */
@@ -120,7 +120,7 @@ auth_callback (guestfs_h *g,
/* Now ask the user for answers. */
for (i = 0; creds[i] != NULL; ++i)
{
printf ("libvirt_auth.c: credential '%s'\n", creds[i]);
printf ("libvirt-auth.c: credential '%s'\n", creds[i]);
if (strcmp (creds[i], "authname") == 0 ||
strcmp (creds[i], "echoprompt") == 0) {

View File

@@ -1,6 +1,6 @@
/* Demonstrate the use of the 'mount-local' API.
*
* Run this program as (eg) mount_local /tmp/test.img. Note that
* Run this program as (eg) mount-local /tmp/test.img. Note that
* '/tmp/test.img' is created or overwritten. Follow the instructions
* on screen.
*/
@@ -31,7 +31,7 @@ static void
usage (void)
{
fprintf (stderr,
"Usage: mount_local disk.img\n"
"Usage: mount-local disk.img\n"
"\n"
"NOTE: disk.img will be created or overwritten.\n"
"\n");

View File

@@ -387,10 +387,10 @@ that libguestfs supports, and from guestfish.
For a description of the C inspection API, read
L<guestfs(3)/INSPECTION>.
For example code using the C inspection API, look for C<inspect_vm.c>
For example code using the C inspection API, look for C<inspect-vm.c>
which ships with libguestfs.
C<inspect_vm.c> has also been translated into other languages. For
C<inspect-vm.c> has also been translated into other languages. For
example, C<inspect_vm.pl> is the Perl translation, and there are other
translations for OCaml, Python, etc. See
L<guestfs(3)/USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES> for a

View File

@@ -2644,7 +2644,7 @@ L</guestfs_get_libvirt_requested_credential_defresult>.
The example program below should make this clearer.
There is also a more substantial working example program supplied with
the libguestfs sources, called C<libvirt_auth.c>.
the libguestfs sources, called C<libvirt-auth.c>.
main ()
{