]> git.tuebingen.mpg.de Git - adu.git/commitdiff
Move adu_isspace() to interactive.c.
authorAndre Noll <maan@systemlinux.org>
Sat, 18 Aug 2012 16:28:26 +0000 (18:28 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 11 Aug 2014 14:17:52 +0000 (16:17 +0200)
This macro is only used there, so it need not be public.

adu.h
interactive.c

diff --git a/adu.h b/adu.h
index 83c3c664daa2fcfc4acea3e40e225834baef4638..42b9471ee251e0ccf28ffd185628bfdd3d315634 100644 (file)
--- a/adu.h
+++ b/adu.h
 #endif
 /** \endcond */
 
-/**
- * Wrapper for isspace.
- * NetBSD needs this.
- */
-/*
- * The values should be cast to an unsigned char first, then to int.
- * Why? Because the isdigit (as do all other is/to functions/macros)
- * expect a number from 0 upto and including 255 as their (int) argument.
- * Because char is signed on most systems, casting it to int immediately
- * gives the functions an argument between -128 and 127 (inclusive),
- * which they will use as an array index, and which will thus fail
- * horribly for characters which have their most significant bit set.
- */
-#define adu_isspace(c) isspace((int)(unsigned char)(c))
-
 /**
  * Write a log message to a dynamically allocated string.
  *
index 8f94076c4a8bb08829b482fd830e1820251f8243..7aef9e24df8611cd2de0af5dda187e36c2bc5386 100644 (file)
@@ -129,6 +129,21 @@ static int icom_set(char *line)
        return parse_select_options(line, &params, &admissible_uids, &fi);
 }
 
+/**
+ * Wrapper for isspace.
+ * NetBSD needs this.
+ */
+/*
+ * The values should be cast to an unsigned char first, then to int.
+ * Why? Because the isdigit (as do all other is/to functions/macros)
+ * expect a number from 0 upto and including 255 as their (int) argument.
+ * Because char is signed on most systems, casting it to int immediately
+ * gives the functions an argument between -128 and 127 (inclusive),
+ * which they will use as an array index, and which will thus fail
+ * horribly for characters which have their most significant bit set.
+ */
+#define adu_isspace(c) isspace((int)(unsigned char)(c))
+
 static int exec_interactive_command(char *line)
 {
        const char const *delim = "\t\n\f\r\v ";