summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@khw-desktop.(none)>2010-06-05 11:12:47 -0600
committerYves Orton <demerphq@gmail.com>2010-06-05 23:23:59 +0200
commite6226b18246ce7d24213c41123114ac7967ed04f (patch)
treebbeecac1f9d6394373c38a61828fff2fa868ebc5 /util.h
parentd51c1b21fa08933083b4723794b68ac09a7a248b (diff)
downloadperl-e6226b18246ce7d24213c41123114ac7967ed04f.tar.gz
Change name of ibcmp to foldEQ
As discussed on p5p, ibcmp has different semantics from other cmp functions in that it is a binary instead of ternary function. It is less confusing then to have a name that implies true/false. There are three functions affected: ibcmp, ibcmp_locale and ibcmp_utf8. ibcmp is actually equivalent to foldNE, but for the same reason that things like 'unless' and 'until' are cautioned against, I changed the functions to foldEQ, so that the existing names, like ibcmp_utf8 are defined as macros as being the complement of foldEQ. This patch also changes the one file where turning ibcmp into a macro causes problems. It changes it to use the new name. It also documents for the first time ibcmp, ibcmp_locale and their new names.
Diffstat (limited to 'util.h')
-rw-r--r--util.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/util.h b/util.h
index 6eab055686..3981656eae 100644
--- a/util.h
+++ b/util.h
@@ -39,6 +39,21 @@
#endif /* VMS */
/*
+=for apidoc ibcmp
+
+This is a synonym for (! foldEQ())
+
+=for apidoc ibcmp_locale
+
+This is a synonym for (! foldEQ_locale())
+
+=cut
+*/
+#define ibcmp(s1, s2, len) cBOOL(! foldEQ(s1, s2, len))
+#define ibcmp_locale(s1, s2, len) cBOOL(! foldEQ_locale(s1, s2, len))
+
+
+/*
* Local variables:
* c-indentation-style: bsd
* c-basic-offset: 4