js_atoi(3)

NAME
js_atoi - Return the integer value of a positive number embedded in a js_string object

SYNOPSIS
#include JsStr.h

unsigned int js_atoi(js_string *js, int offset);

DESCRIPTION
js_atoi determines the integer value of a string of numbers in a js_string object.

ARGUMENTS
js is a pointer to the js_string object that you wish to view the integer value of a string of numbers in. offset is the character number of the character we want to look at. 0 is the first character in the string, 1 is the second character, and so on.

EXAMPLE
The following example code creates a js_string object, then determines the string value starting at the second character.

	js_string *foo;
	int val;
	foo = js_create(256,1);
	js_set_encode(foo,JS_US_ASCII);
        js_qstr2js(foo,"Z123");
	val = js_atoi(foo,1); /* Should be 123 */

RETURN VALUE
js_atoi returns the integer value of the non-negative string in question. This function will return 0 if it is not able to get the value for the string in question.

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