summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-09-10 08:54:36 -0600
committerKarl Williamson <khw@cpan.org>2016-09-17 17:22:26 -0600
commit062b685031576af47e0f0097d66e7274cccc443f (patch)
treee369e02b1a132a192cdf6b02f340b16afc33feff /handy.h
parenta791584fcdb7d580494680fbbcca3e3f880b78bf (diff)
downloadperl-062b685031576af47e0f0097d66e7274cccc443f.tar.gz
handy.h: Add memLT, memLE, memGT, memGE
These correspond to strLT, etc. I am deferring documenting them in case this turns out to be a bad idea for some reason.
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/handy.h b/handy.h
index fc68736e4b..d131cfc9e0 100644
--- a/handy.h
+++ b/handy.h
@@ -493,6 +493,11 @@ Returns zero if non-equal, or non-zero if equal.
(sizeof(s2)-1 == l && memEQ(s1, ("" s2 ""), (sizeof(s2)-1)))
#define memNEs(s1, l, s2) !memEQs(s1, l, s2)
+#define memLT(s1,s2,l) (memcmp(s1,s2,l) < 0)
+#define memLE(s1,s2,l) (memcmp(s1,s2,l) <= 0)
+#define memGT(s1,s2,l) (memcmp(s1,s2,l) > 0)
+#define memGE(s1,s2,l) (memcmp(s1,s2,l) >= 0)
+
/*
* Character classes.
*