summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-09-24 10:59:01 +0200
committerJim Meyering <meyering@redhat.com>2009-09-24 11:00:44 +0200
commit6a14f1c2502f58ff7bed8cb451f95a83f5ee920a (patch)
tree975cb6488e6413dab5aece9fcf1aee5a595381ac /examples
parent0ca36888c6975ffa7e03df11bf8ded42156939c7 (diff)
downloadlibguestfs-6a14f1c2502f58ff7bed8cb451f95a83f5ee920a.tar.gz
libguestfs-6a14f1c2502f58ff7bed8cb451f95a83f5ee920a.tar.xz
libguestfs-6a14f1c2502f58ff7bed8cb451f95a83f5ee920a.zip
avoid use of all ctype macros
* cfg.mk (disable_temporarily): Don't disable sc_avoid_ctype_macros. * fish/tilde.c: Remove unnecessary inclusion of ctype.h. * bootstrap: Add gnulib's c-ctype module to the list. * daemon/m4/gnulib-cache.m4: Likewise. * daemon/ext2.c: Include "c-ctype.h", not <ctype.h>. Use c_isspace, etc, rather than isspace. * daemon/guestfsd.c: Likewise. * daemon/lvm.c: Likewise. * daemon/proto.c: Likewise. * fish/fish.c: Likewise. * fish/tilde.c: Likewise. * src/generator.ml: Likewise. * src/guestfs.c: Likewise. * examples/to-xml.c: Likewise. * examples/Makefile.am (to_xml_CPPFLAGS): Add -I$(top_srcdir)/gnulib/lib so inclusion of "c-ctype.h" works. (to_xml_CPPFLAGS): Rename from to_xml_CFLAGS.
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile.am4
-rw-r--r--examples/to-xml.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/examples/Makefile.am b/examples/Makefile.am
index fb3d656c..adbb9343 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -7,7 +7,9 @@ hello_CFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src -Wall
hello_LDADD = $(top_builddir)/src/libguestfs.la
to_xml_SOURCES = to-xml.c
-to_xml_CFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src -Wall
+to_xml_CPPFLAGS = \
+ -I$(top_srcdir)/gnulib/lib \
+ -I$(top_srcdir)/src -I$(top_builddir)/src -Wall
to_xml_LDADD = $(top_builddir)/src/libguestfs.la
CLEANFILES = $(noinst_PROGRAMS)
diff --git a/examples/to-xml.c b/examples/to-xml.c
index 6d0a1dfb..e9ea0639 100644
--- a/examples/to-xml.c
+++ b/examples/to-xml.c
@@ -16,9 +16,9 @@
#include <stdint.h>
#include <inttypes.h>
#include <unistd.h>
-#include <ctype.h>
#include <guestfs.h>
+#include "c-ctype.h"
/* Note that if any API call fails, we can just exit. The
* standard error handler will have printed the error message
@@ -149,7 +149,7 @@ display_partitions (guestfs_h *g, const char *dev)
* That's a limitation of sorts of the Linux kernel. (Actually,
* we could do this if we add the kpartx program to libguestfs).
*/
- if (strncmp (dev, "/dev/sd", 7) != 0 || isdigit (dev[strlen(dev)-1])) {
+ if (strncmp (dev, "/dev/sd", 7) != 0 || c_isdigit (dev[strlen(dev)-1])) {
printf ("<vm-image dev=\"%s\"/>\n", dev);
return;
}