Fix user summary accounting if pattern is given.
[adu.git] / adu.h
diff --git a/adu.h b/adu.h
index 5e99709c3679571b70ccaf5db5bc70c62957eb83..83c3c664daa2fcfc4acea3e40e225834baef4638 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.
  *
@@ -139,6 +154,9 @@ extern struct osl_table *dir_table;
 /** The adu command line options. */
 extern struct gengetopt_args_info conf;
 
+/** Computed database dir. */
+extern char *database_dir;
+
 /**
  * The select command line options.
  *