]> arthur.barton.de Git - ngircd-alex.git/commitdiff
- neue Funktion ngt_LowerStr().
authorAlexander Barton <alex@barton.de>
Fri, 22 Mar 2002 00:17:27 +0000 (00:17 +0000)
committerAlexander Barton <alex@barton.de>
Fri, 22 Mar 2002 00:17:27 +0000 (00:17 +0000)
src/ngircd/tool.c
src/ngircd/tool.h

index c801ccfddde079e7bdf898ed8848fcae9a79a537..ed5abb86bc9c8279d3f94b1a048e1a9ceb81fe78 100644 (file)
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: tool.c,v 1.7 2002/03/12 14:37:52 alex Exp $
+ * $Id: tool.c,v 1.8 2002/03/22 00:17:27 alex Exp $
  *
  * tool.c: Hilfsfunktionen, ggf. Platformabhaengig
  */
@@ -19,6 +19,7 @@
 
 #include "imp.h"
 #include <assert.h>
+#include <ctype.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -50,4 +51,26 @@ GLOBAL VOID ngt_TrimStr( CHAR *String )
 } /* ngt_TrimStr */
 
 
+GLOBAL CHAR *ngt_LowerStr( CHAR *String )
+{
+       /* String in Kleinbuchstaben konvertieren. Der uebergebene
+        * Speicherbereich wird durch das Ergebnis ersetzt, zusaetzlich
+        * wird dieser auch als Pointer geliefert. */
+
+       CHAR *ptr;
+
+       assert( String != NULL );
+
+       /* Zeichen konvertieren */
+       ptr = String;
+       while( *ptr )
+       {
+               *ptr = tolower( *ptr );
+               ptr++;
+       }
+       
+       return String;
+} /* ngt_LowerStr */
+
+
 /* -eof- */
index 3fab3a68335e2910419de7b42aa934afae9b5dd0..b72cb86a3160c333395f1ff8033d83b49af2a6a8 100644 (file)
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: tool.h,v 1.6 2002/03/12 14:37:52 alex Exp $
+ * $Id: tool.h,v 1.7 2002/03/22 00:17:27 alex Exp $
  *
  * log.h: Hilfsfunktionen (Header)
  */
@@ -21,6 +21,8 @@
 
 GLOBAL VOID ngt_TrimStr( CHAR *String );
 
+GLOBAL CHAR *ngt_LowerStr( CHAR *String );
+
 
 #endif