js_getline_stdin(3)

NAME
js_getline_stdin - grab a line of text from the standard input

SYNOPSIS
#include JsStr.h

int js_getline_stdin(js_string *js)

DESCRIPTION
js_getline_stdin reads a single line from the standard input, and places the read contents in the js_string object js.

ARGUMENTS
js is the js_string object we place the read contents in.

WARNING
The js_string object needs to be set to JS_US_ASCII, or another non-binary encoding, before using this function. This is because there are no newline characters (nor any other special characters) in binary data.

RETURN VALUE
js_getline_stdin returns JS_SUCCESS on successful reading of a line, JS_ERROR otherwise.

EXAMPLE
The following reads a single line from the standard input and places the contents in foo:

	js_string *foo;
	foo = js_create(256,1);
	js_set_encode(foo,JS_US_ASCII);
	js_getline_stdin(foo);

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