aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common.h')
-rw-r--r--common.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/common.h b/common.h
index abef5af..ed4b05e 100644
--- a/common.h
+++ b/common.h
@@ -7,6 +7,7 @@
#include <limits.h>
#include <stddef.h>
+#include <ctype.h>
#include "pack.h"
@@ -39,6 +40,13 @@
T(LLONG, signed, long long, long long) \
T(ULLONG, unsigned, long long, long long)
+// safe_islower: islower but no domain errors
+static inline int safe_islower(int c)
+{
+ if (c < 0 || c > UCHAR_MAX) return 0;
+ return islower(c);
+}
+
size_t getsize(enum pack_type t);
#endif // !PACK_COMMON_H