tidying: skip_whitespace
[exim.git] / src / src / functions.h
index f3877563db67ce3bd9a661a79b2ed66f7ac35f06..28d6f26a66c7d0a83bf1b6fbda26607ff75e03f8 100644 (file)
@@ -13,6 +13,7 @@ are in in fact in separate headers. */
 #ifndef _FUNCTIONS_H_
 #define _FUNCTIONS_H_
 
+#include <ctype.h>
 #include <sys/time.h>
 
 
@@ -666,6 +667,15 @@ return US strncpy(CS dst, CCS src, n);
 /*XXX will likely need unchecked copy also */
 
 
+/* Advance the string pointer given over any whitespace.
+Return the next char as there's enought places using it to be useful. */
+
+#define Uskip_whitespace(sp) skip_whitespace(CUSS sp)
+
+static inline uschar skip_whitespace(const uschar ** sp)
+{ while (isspace(**sp)) (*sp)++; return **sp; }
+
+
 /******************************************************************************/
 
 #if !defined(MACRO_PREDEF) && !defined(COMPILE_UTILITY)