changeset 24608:1c533e23ce95

util.h: define an enum for normcase specs These will be used in upcoming patches to efficiently create a dirstate foldmap.
author Siddharth Agarwal <sid0@fb.com>
date Thu, 02 Apr 2015 19:17:32 -0700
parents f5b527024fcc
children 670aaee7931c
files mercurial/encoding.py mercurial/util.h
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/encoding.py	Thu Apr 02 19:13:50 2015 -0700
+++ b/mercurial/encoding.py	Thu Apr 02 19:17:32 2015 -0700
@@ -364,7 +364,9 @@
 
     lower: normcase lowercases ASCII strings
     upper: normcase uppercases ASCII strings
-    other: the fallback function should always be called'''
+    other: the fallback function should always be called
+
+    This should be kept in sync with normcase_spec in util.h.'''
     lower = -1
     upper = 1
     other = 0
--- a/mercurial/util.h	Thu Apr 02 19:13:50 2015 -0700
+++ b/mercurial/util.h	Thu Apr 02 19:17:32 2015 -0700
@@ -209,6 +209,13 @@
 	return ret;
 }
 
+/* This should be kept in sync with normcasespecs in encoding.py. */
+enum normcase_spec {
+	NORMCASE_LOWER = -1,
+	NORMCASE_UPPER = 1,
+	NORMCASE_OTHER = 0
+};
+
 #define MIN(a, b) (((a)<(b))?(a):(b))
 /* VC9 doesn't include bool and lacks stdbool.h based on my searching */
 #ifdef _MSC_VER