.\" Process this file with .\" groff -man -Tascii cryptday.1 .\" .TH js_buf_eof 3 "August 2000" JS "js library reference" .\" We don't want hyphenation (it's too ugly) .\" We also disable justification when using nroff .hy 0 .if n .na .SH NAME js_buf_eof \- determine if we have reached the end of a file (in a buffered context) .SH SYNOPSIS .nf .B #include "JsStr.h" .sp .B "int js_buf_eof(js_file *desc)" .fi .SH DESCRIPTION .B js_buf_eof determines, in a buffered context, if we have reached the end of the file pointed to by .B desc. .SH ARGUMENTS .B desc is a pointer to a file object we are examining. .SH 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 .B js_read is performed. .SH "RETURN VALUE" .B js_buf_eof returns 0 if we not at the end of a file (in a buffered context), and 1 if we are. .SH EXAMPLE The following checks if we are at the end of the file "filename" after reading a single line from the file: .nf 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\n",js_buf_eof(bar)); .fi .SH AUTHOR Sam Trenholme <kiwi-zttfryb@koala.samiam.org>