Browse Source

strlower moved from registrar.

Jan Janak 22 years ago
parent
commit
5c4113af02
1 changed files with 16 additions and 0 deletions
  1. 16 0
      ut.h

+ 16 - 0
ut.h

@@ -28,6 +28,7 @@
  *
  * History
  * ------
+ * 2003-02-13 strlower added (janakj)
  * 2003-01-29 pathmax added (jiri)
  * 2003-01-28 scratchpad removed (jiri)
  * 2003-01-18 un_escape function introduced for convenience of code needing
@@ -44,6 +45,7 @@
 #include <sys/time.h>
 #include <limits.h>
 #include <unistd.h>
+#include <ctype.h>
 
 #include "config.h"
 #include "dprint.h"
@@ -357,4 +359,18 @@ error:
 	return -1;
 } 
 
+
+/*
+ * Convert a string to lower case
+ */
+static inline void strlower(str* _s)
+{
+	int i;
+
+	for(i = 0; i < _s->len; i++) {
+		_s->s[i] = tolower(_s->s[i]);
+	}
+}
+
+
 #endif