.\" Process this file with .\" groff -man -Tascii cryptday.1 .\" .TH js_read 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_read \- Read data from an open file .SH SYNOPSIS .nf .B #include "JsStr.h" .sp .B "int js_read(js_file *desc, js_string *js, int count)" .fi .SH DESCRIPTION .B js_read is a function that reads data from an open file, and places the data in a .I js_string object. .SH ARGUMENTS .B desc is a pointer to a file object opened for writing. .B js is a pointer to a .I js_string object that we will place the read contents in. .B count is the number of octets we read from the open file. Note that this is the number of octets, and does not take in to account the .I unit size of the .I js_string object .B js. .SH "RETURN VALUE" .B js_read returns the number of octets read on success, and .I JS_ERROR if an error occured. .SH EXAMPLE The following reads 100 bytes from the file "filename": .nf js_string *foo; js_file *bar; foo = js_create(256,1); js_str2js(foo,"filename",8,1); js_open_read(foo,bar); js_read(bar,foo,100); /* Clobbering the contents of foo */ .fi .SH AUTHOR Sam Trenholme <kiwi-zttfryb@koala.samiam.org>