Logo Search packages:      
Sourcecode: bglibs version File versions

int str_case_startb ( const str a,
const char *  b,
unsigned  len 
)

Match the prefix of the string to a binary chunk.

Definition at line 24 of file case_start.c.

References len, and s.

Referenced by str_case_start(), and str_case_starts().

{
  const char* aptr;
  if (len > a->len) return 0;
  for (aptr = a->s; len > 0; --len) {
    char bc = *b++;
    char ac = *aptr++;
    if (isupper(bc)) bc = tolower(bc);
    if (isupper(ac)) ac = tolower(ac);
    if (ac != bc) return 0;
  }
  return 1;
}


Generated by  Doxygen 1.6.0   Back to index