* 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.
modules='
arpa_inet
+c-ctype
closeout
gitlog-to-changelog
gnu-make
sc_unmarked_diagnostics \
sc_prohibit_ctype_h \
sc_prohibit_asprintf \
- sc_avoid_ctype_macros \
sc_avoid_write
# Avoid uses of write(2). Either switch to streams (fwrite), or use
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <ctype.h>
#include "../src/guestfs_protocol.h"
#include "daemon.h"
+#include "c-ctype.h"
#include "actions.h"
char **
if (colon) {
*colon = '\0';
- do { colon++; } while (*colon && isspace (*colon));
+ do { colon++; } while (*colon && c_isspace (*colon));
if (add_string (&ret, &size, &alloc, p) == -1) {
free (out);
}
p += 17;
- while (*p && isspace (*p))
+ while (*p && c_isspace (*p))
p++;
if (!*p) {
reply_with_error ("malformed Filesystem UUID in the output of tune2fs -l");
/* Now 'p' hopefully points to the start of the UUID. */
q = p;
- while (*q && (isxdigit (*q) || *q == '-'))
+ while (*q && (c_isxdigit (*q) || *q == '-'))
q++;
if (!*q) {
reply_with_error ("malformed Filesystem UUID in the output of tune2fs -l");
#include <sys/wait.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <ctype.h>
#include <signal.h>
#include <printf.h>
+#include "c-ctype.h"
#include "daemon.h"
static char *read_cmdline (void);
const struct printf_info *info ATTRIBUTE_UNUSED,
const void *const *args)
{
-#define SAFE(c) (isalnum((c)) || \
+#define SAFE(c) (c_isalnum((c)) || \
(c) == '/' || (c) == '-' || (c) == '_' || (c) == '.')
int i, len;
const char *str = *((const char **) (args[0]));
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <ctype.h>
#include "daemon.h"
+#include "c-ctype.h"
#include "actions.h"
/* LVM actions. Keep an eye on liblvm, although at the time
pend++;
}
- while (*p && isspace (*p)) /* Skip any leading whitespace. */
+ while (*p && c_isspace (*p)) /* Skip any leading whitespace. */
p++;
/* Sigh, skip trailing whitespace too. "pvs", I'm looking at you. */
len = strlen (p)-1;
- while (*p && isspace (p[len]))
+ while (*p && c_isspace (p[len]))
p[len--] = '\0';
if (!*p) { /* Empty line? Skip it. */
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=gl hash ignore-value manywarnings warnings
+# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=gl c-ctype hash ignore-value manywarnings warnings
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
gl_MODULES([
+ c-ctype
hash
ignore-value
manywarnings
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <ctype.h>
#include <sys/param.h> /* defines MIN */
#include <rpc/types.h>
#include <rpc/xdr.h>
+#include "c-ctype.h"
#include "ignore-value.h"
#include "daemon.h"
printf (" ");
printf ("|");
for (j = i; j < MIN (i+16, len); ++j)
- if (isprint (buf[j]))
+ if (c_isprint (buf[j]))
printf ("%c", buf[j]);
else
printf (".");
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)
#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
* 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;
}
#include <getopt.h>
#include <signal.h>
#include <assert.h>
-#include <ctype.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <guestfs.h>
#include "fish.h"
+#include "c-ctype.h"
#include "closeout.h"
#include "progname.h"
/* Skip any initial whitespace before the command. */
again:
- while (*buf && isspace (*buf))
+ while (*buf && c_isspace (*buf))
buf++;
if (!*buf) continue;
* as separate fragments because we can't just copy it: we have to remove
* the \.
*/
- while (*p && (!isblank (*p) || in_quote)) {
+ while (*p && (!c_isblank (*p) || in_quote)) {
const char *end = p;
/* Check if the fragment starts with a quote */
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <ctype.h>
#include <assert.h>
#include <pwd.h>
#include <sys/types.h>
pr "#include <stdlib.h>\n";
pr "#include <string.h>\n";
pr "#include <inttypes.h>\n";
- pr "#include <ctype.h>\n";
pr "#include <rpc/types.h>\n";
pr "#include <rpc/xdr.h>\n";
pr "\n";
pr "#include \"daemon.h\"\n";
+ pr "#include \"c-ctype.h\"\n";
pr "#include \"../src/guestfs_protocol.h\"\n";
pr "#include \"actions.h\"\n";
pr "\n";
pr " fprintf (stderr, \"%%s: failed: passed a NULL string\\n\", __func__);\n";
pr " return -1;\n";
pr " }\n";
- pr " if (!*str || isspace (*str)) {\n";
+ pr " if (!*str || c_isspace (*str)) {\n";
pr " fprintf (stderr, \"%%s: failed: passed a empty string or one beginning with whitespace\\n\", __func__);\n";
pr " return -1;\n";
pr " }\n";
pr " pend++;\n";
pr " }\n";
pr "\n";
- pr " while (*p && isspace (*p)) /* Skip any leading whitespace. */\n";
+ pr " while (*p && c_isspace (*p)) /* Skip any leading whitespace. */\n";
pr " p++;\n";
pr "\n";
pr " if (!*p) { /* Empty line? Skip it. */\n";
pr "#include <stdlib.h>\n";
pr "#include <string.h>\n";
pr "#include <inttypes.h>\n";
- pr "#include <ctype.h>\n";
pr "\n";
pr "#include <guestfs.h>\n";
+ pr "#include \"c-ctype.h\"\n";
pr "#include \"fish.h\"\n";
pr "\n";
| name, FBuffer ->
pr " printf (\"%%s%s: \", indent);\n" name;
pr " for (i = 0; i < %s->%s_len; ++i)\n" typ name;
- pr " if (isprint (%s->%s[i]))\n" typ name;
+ pr " if (c_isprint (%s->%s[i]))\n" typ name;
pr " printf (\"%%s%%c\", indent, %s->%s[i]);\n" typ name;
pr " else\n";
pr " printf (\"%%s\\\\x%%02x\", indent, %s->%s[i]);\n" typ name;
#include <stdarg.h>
#include <stddef.h>
#include <unistd.h>
-#include <ctype.h>
#include <string.h>
#include <fcntl.h>
#include <time.h>
#include "guestfs.h"
#include "guestfs-internal-actions.h"
#include "guestfs_protocol.h"
+#include "c-ctype.h"
#include "ignore-value.h"
#ifdef HAVE_GETTEXT
printf (" ");
printf ("|");
for (j = i; j < MIN (i+16, nr); ++j)
- if (isprint ((*(char **)buf_rtn)[j]))
+ if (c_isprint ((*(char **)buf_rtn)[j]))
printf ("%c", (*(char **)buf_rtn)[j]);
else
printf (".");