src/compat/strcasecmp.c File Reference

#include "main.h"
#include "memcpy.h"
Include dependency graph for strcasecmp.c:

Go to the source code of this file.

Functions

int egg_strcasecmp (const char *s1, const char *s2)
int egg_strncasecmp (const char *s1, const char *s2, size_t n)

Function Documentation

int egg_strcasecmp ( const char *  s1,
const char *  s2 
)

Definition at line 29 of file strcasecmp.c.

00030 {
00031   while ((*s1) && (*s2) && (toupper(*s1) == toupper(*s2))) {
00032     s1++;
00033     s2++;
00034   }
00035   return toupper(*s1) - toupper(*s2);
00036 }

int egg_strncasecmp ( const char *  s1,
const char *  s2,
size_t  n 
)

Definition at line 40 of file strcasecmp.c.

00041 {
00042   if (!n)
00043     return 0;
00044   while (--n && (*s1) && (*s2) && (toupper(*s1) == toupper(*s2))) {
00045     s1++;
00046     s2++;
00047   }
00048   return toupper(*s1) - toupper(*s2);
00049 }


Generated on 7 Sep 2016 for Eggdrop by  doxygen 1.6.1