aboutsummaryrefslogtreecommitdiff
path: root/libio/dbz/case.h
diff options
context:
space:
mode:
Diffstat (limited to 'libio/dbz/case.h')
-rw-r--r--libio/dbz/case.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libio/dbz/case.h b/libio/dbz/case.h
new file mode 100644
index 00000000000..d5ef6961550
--- /dev/null
+++ b/libio/dbz/case.h
@@ -0,0 +1,12 @@
+extern int cistrncmp();
+extern char *rfc822ize();
+
+extern char casemap[];
+
+/* must call cistrncmp before invoking TOLOW... */
+#define TOLOW(c) (casemap[(c)+128]) /* see case.c for why 128 */
+
+/* ...but the use of it in CISTREQN is safe without the preliminary call (!) */
+/* CISTREQN is an optimised case-insensitive strncmp(a,b,n)==0; n > 0 */
+#define CISTREQN(a, b, n) \
+ (TOLOW((a)[0]) == TOLOW((b)[0]) && cistrncmp(a, b, n) == 0)