From e84d6e6102fcc55eff0044351cb7d8d1a3296e20 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 12 Feb 2013 15:02:43 +0000 Subject: [PATCH] examples: Rename example programs, replacing '_' with '-'. --- .gitignore | 12 +++--- examples/Makefile.am | 41 ++++++++++++--------- examples/{copy_over.c => copy-over.c} | 8 ++-- examples/{create_disk.c => create-disk.c} | 0 examples/{display_icon.c => display-icon.c} | 4 +- examples/{inspect_vm.c => inspect-vm.c} | 0 examples/{libvirt_auth.c => libvirt-auth.c} | 8 ++-- examples/{mount_local.c => mount-local.c} | 4 +- inspector/virt-inspector.pod | 4 +- src/guestfs.pod | 2 +- 10 files changed, 45 insertions(+), 38 deletions(-) rename examples/{copy_over.c => copy-over.c} (96%) rename examples/{create_disk.c => create-disk.c} (100%) rename examples/{display_icon.c => display-icon.c} (96%) rename examples/{inspect_vm.c => inspect-vm.c} (100%) rename examples/{libvirt_auth.c => libvirt-auth.c} (94%) rename examples/{mount_local.c => mount-local.c} (97%) diff --git a/.gitignore b/.gitignore index f190cc85e..c6882d016 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/examples/Makefile.am b/examples/Makefile.am index 5d3a69433..c7a654f90 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -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 \ $< diff --git a/examples/copy_over.c b/examples/copy-over.c similarity index 96% rename from examples/copy_over.c rename to examples/copy-over.c index ec0261683..03441a73e 100644 --- a/examples/copy_over.c +++ b/examples/copy-over.c @@ -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; } diff --git a/examples/create_disk.c b/examples/create-disk.c similarity index 100% rename from examples/create_disk.c rename to examples/create-disk.c diff --git a/examples/display_icon.c b/examples/display-icon.c similarity index 96% rename from examples/display_icon.c rename to examples/display-icon.c index 5166a7b70..967fb9339 100644 --- a/examples/display_icon.c +++ b/examples/display-icon.c @@ -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); } diff --git a/examples/inspect_vm.c b/examples/inspect-vm.c similarity index 100% rename from examples/inspect_vm.c rename to examples/inspect-vm.c diff --git a/examples/libvirt_auth.c b/examples/libvirt-auth.c similarity index 94% rename from examples/libvirt_auth.c rename to examples/libvirt-auth.c index 3d315c3b4..01cef7eaf 100644 --- a/examples/libvirt_auth.c +++ b/examples/libvirt-auth.c @@ -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) { diff --git a/examples/mount_local.c b/examples/mount-local.c similarity index 97% rename from examples/mount_local.c rename to examples/mount-local.c index fb09bb3b7..658de51e9 100644 --- a/examples/mount_local.c +++ b/examples/mount-local.c @@ -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"); diff --git a/inspector/virt-inspector.pod b/inspector/virt-inspector.pod index 3157b523d..4578f4202 100755 --- a/inspector/virt-inspector.pod +++ b/inspector/virt-inspector.pod @@ -387,10 +387,10 @@ that libguestfs supports, and from guestfish. For a description of the C inspection API, read L. -For example code using the C inspection API, look for C +For example code using the C inspection API, look for C which ships with libguestfs. -C has also been translated into other languages. For +C has also been translated into other languages. For example, C is the Perl translation, and there are other translations for OCaml, Python, etc. See L for a diff --git a/src/guestfs.pod b/src/guestfs.pod index 93fc06169..d21ac8cb0 100644 --- a/src/guestfs.pod +++ b/src/guestfs.pod @@ -2644,7 +2644,7 @@ L. The example program below should make this clearer. There is also a more substantial working example program supplied with -the libguestfs sources, called C. +the libguestfs sources, called C. main () {