[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] add strupper function



Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv6078/src/common

Modified Files:
	util.c util.h 
Log Message:
add strupper function

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/util.c,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -d -r1.218 -r1.219
--- util.c	3 Sep 2005 04:40:05 -0000	1.218
+++ util.c	8 Sep 2005 18:33:51 -0000	1.219
@@ -299,6 +299,16 @@
   }
 }
 
+/** Convert all alphabetic characters in the nul-terminated string <b>s</b> to
+ * lowercase. */
+void tor_strupper(char *s)
+{
+  while (*s) {
+    *s = toupper(*s);
+    ++s;
+  }
+}
+
 /* Compares the first strlen(s2) characters of s1 with s2.  Returns as for
  * strcmp.
  */

Index: util.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/util.h,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- util.h	3 Sep 2005 04:40:05 -0000	1.137
+++ util.h	8 Sep 2005 18:33:51 -0000	1.138
@@ -69,6 +69,7 @@
 /* String manipulation */
 #define HEX_CHARACTERS "0123456789ABCDEFabcdef"
 void tor_strlower(char *s);
+void tor_strupper(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);