js_nonmatch_offset(3)

NAME
js_nonmatch_offset - search for anything besides a literal character in exp in the string js

SYNOPSIS
#include JsStr.h

int js_nonmatch_offset(js_string *exp, js_string *js, int offset)

DESCRIPTION
js_nonmatch_offset searches for any single character that is not in the expression exp in the string js.

The expression exp is treated as a list of characters we do not look for in the string js. No characters are considered metacharacters in the expression exp.

The argument offset determines the minimum offset we will not look for a character in the expression exp at. An offset of 0 indicates we start looking at the beginning of the string js, an offset of 1 means that we will start looking at the second character in the string, and so on.

RETURN VALUE
js_nonmatch_offset returns -2 if all of the characters in the string js were found in the string exp, the offset of the first found character if the a character not in exp was found (0 if it was found at the top of the string, 1 if it was found starting at the second character in the string, etc), and JS_ERROR if there was an error when searching for a character in the expression.

EXAMPLE
The following example will find the first character 6 not in the string "543" in the string "3634567890":

	js_string *foo, *bar;
	foo = js_create(256,1);
	bar = js_create(256,1);
	js_str2js(foo,"3634567890",10,1);
	js_str2js(bar,"543",3,1);
	printf("%d\n",js_nonmatch_offset(bar,foo,1)); /* You will see 2 */

AUTHOR
Sam Trenholme <kiwi-zttfryb@koala.samiam.org>