Back to index

cell-binutils  2.17cvs20070401
Functions | Variables
strncasecmp.c File Reference
#include <ansidecl.h>
#include <stddef.h>

Go to the source code of this file.

Functions

int strncasecmp (const char *s1, const char *s2, register size_t n)

Variables

static const unsigned char charmap []

Function Documentation

int strncasecmp ( const char *  s1,
const char *  s2,
register size_t  n 
)

Definition at line 71 of file strncasecmp.c.

{
    register unsigned char u1, u2;

    for (; n != 0; --n) {
       u1 = (unsigned char) *s1++;
       u2 = (unsigned char) *s2++;
       if (charmap[u1] != charmap[u2]) {
           return charmap[u1] - charmap[u2];
       }
       if (u1 == '\0') {
           return 0;
       }
    }
    return 0;
}

Variable Documentation

const unsigned char charmap[] [static]

Definition at line 35 of file strncasecmp.c.