js_val(3)

NAME
js_val - Return the big-endian numeric value of a given character in a js_string object

SYNOPSIS
#include JsStr.h

int js_val(js_string *js, int offset);

DESCRIPTION
js_val determines the big-endian numeric value of a given character in a js_string object.

ARGUMENTS
js is a pointer to the js_string object that you wish to view the numeric value of a character 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 numeric value of the first character.

	js_string *foo;
	int val;
	foo = js_create(256,1);
	js_set_encode(foo,JS_US_ASCII);
        js_qstr2js(foo," ");
	val = js_val(foo,0); /* Should be 32 (ASCII space) */

RETURN VALUE
js_val returns the value of the character in question. This function will return JS_ERROR if it is not able to get the value for the character in question.

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