js_buf_eof(3)

NAME
js_buf_eof - determine if we have reached the end of a file (in a buffered context)

SYNOPSIS
#include JsStr.h

int js_buf_eof(js_file *desc)

DESCRIPTION
js_buf_eof determines, in a buffered context, if we have reached the end of the file pointed to by desc.

ARGUMENTS
desc is a pointer to a file object we are examining.

WARNING
This routine only works in a buffered context. In particular, it will not determine if we are at the end of a file after a js_read is performed.

RETURN VALUE
js_buf_eof returns 0 if we not at the end of a file (in a buffered context), and 1 if we are.

EXAMPLE
The following checks if we are at the end of the file "filename" after reading a single line from the file:

	js_string *foo;
	js_file *bar;
	foo = js_create(256,1);
	js_str2js(foo,"filename",8,1);
	js_open_read(foo,bar);
	js_set_encode(foo,JS_US_ASCII);
        js_buf_getline(bar,foo);
	printf("%d,js_buf_eof(bar));

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