| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
#include "sflfind.h" char * strfind_r (const char *string, /* String containing data */ const char *pattern) /* Pattern to search for */
Searches for a pattern in a string using the Boyer-Moore- Horspool-Sunday algorithm. The string and pattern are null- terminated strings. Returns a pointer to the pattern if found within the string, or NULL if the pattern was not found. This function is meant to handle character data, and is most effective when you work with large strings. To search binary data use memfind(). Will not work on multibyte characters. Reentrant.
char *result; result = strfind_r ("abracadabra", "cad"); if (result) puts (result);
{ size_t searchbuf [256]; /* One-time search buffer */ Bool secondtime = FALSE; /* Search buffer init needed */ ASSERT (string); /* Expect non-NULL pointers, but */ ASSERT (pattern); /* fall through if not debugging */ return (char *) memfind rb (string, strlen (string), pattern, strlen (pattern), searchbuf, &secondtime); }
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |