Logo Search packages:      
Sourcecode: bglibs version File versions

int str_findprevof ( const str s,
const char *  list,
unsigned  pos 
)

Find the previous instance of the given list of characters, on or before pos

Definition at line 22 of file findprevof.c.

References len, s, and str_buildmap().

{
  char* p;
  int map[256];
  str_buildmap(map, list);
  if (pos >= s->len) pos = s->len - 1;
  for (p = s->s + pos; p >= s->s; --p, --pos)
    if (map[*(unsigned char*)p] >= 0)
      return pos;
  return -1;
}


Generated by  Doxygen 1.6.0   Back to index