[or-cvs] r6959: Add a utility function to verify that a string has been thro (in tor/trunk: . src/common)

nickm at seul.org nickm at seul.org
Mon Jul 31 18:01:38 UTC 2006


Author: nickm
Date: 2006-07-31 14:01:37 -0400 (Mon, 31 Jul 2006)
New Revision: 6959

Modified:
   tor/trunk/
   tor/trunk/src/common/util.c
   tor/trunk/src/common/util.h
Log:
 r6980 at Kushana:  nickm | 2006-07-31 13:18:22 -0400
 Add a utility function to verify that a string has been through strlower.



Property changes on: tor/trunk
___________________________________________________________________
Name: svk:merge
   - c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/eventdns:6979
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/oo-connections:6950
   + c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/eventdns:6980
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/oo-connections:6950

Modified: tor/trunk/src/common/util.c
===================================================================
--- tor/trunk/src/common/util.c	2006-07-31 18:01:27 UTC (rev 6958)
+++ tor/trunk/src/common/util.c	2006-07-31 18:01:37 UTC (rev 6959)
@@ -337,6 +337,19 @@
   return 1;
 }
 
+/** Return 1 if no character in <b>s</b> is uppercase, else return 0.
+ */
+int
+tor_strisnonupper(const char *s)
+{
+  while (*s) {
+    if (! TOR_ISUPPER(*s))
+      return 0;
+    s++;
+  }
+  return 1;
+}
+
 /* Compares the first strlen(s2) characters of s1 with s2.  Returns as for
  * strcmp.
  */

Modified: tor/trunk/src/common/util.h
===================================================================
--- tor/trunk/src/common/util.h	2006-07-31 18:01:27 UTC (rev 6958)
+++ tor/trunk/src/common/util.h	2006-07-31 18:01:37 UTC (rev 6959)
@@ -97,6 +97,7 @@
 void tor_strlower(char *s);
 void tor_strupper(char *s);
 int tor_strisprint(const char *s);
+int tor_strisnonupper(const char *s);
 int strcmpstart(const char *s1, const char *s2);
 int strcasecmpstart(const char *s1, const char *s2);
 int strcmpend(const char *s1, const char *s2);



More information about the tor-commits mailing list