Xiqual 0.9.1
In file include/files.h:
Autofile structure.
- size_t
size
- Size of file.
- size_t
pos
- Current position in an open file.
- size_t
read
- Number of bytes read in last read operation.
- char*
name
- Name of file.
- char*
buf
- A buffer used in file_read() operations.
- size_t
bufsize
- Size of buf element.
- FILE*
f
- The actual FILE pointer.
- void (*readhook)(char* buf, size_t len)
- Hook called when reading.
Documentation
Autofile structure. Use file_new() to create a
structure with a filename. The other file_* operations can be used
to read, write and seek in the file.
-
- size_t
size
- Size of file. Writing operations will add the number of bytes
written from each call.
- size_t
pos
- Current position in an open file. This usually equals size with
a file being written to.
- size_t
read
- Number of bytes read in last read operation. The pos element
will point to the point after last byte read. Start point of the
last read chunk of data is pos - read.
- char*
name
- Name of file. No special checking is made on this name to
ensure it is valid for the OS to create.
- char*
buf
- A buffer used in file_read() operations. You must create this
buffer with file_initbuf(). The buffersize shouldn't need to be
larger than the size of a file.
- size_t
bufsize
- Size of buf element. file_read() will not read more than this
much per call. The previous buffer contents are of course lost. No
special care is made to clear the contents before reading, so do
not expect everything to be nicely NULL-terminated.
- FILE*
f
- The actual FILE pointer. For internal use.
- void
(*readhook)(char* buf, size_t
len)
- Hook called when reading. This is called right after reading in
all data and ensuring anything was read. See md5.c in the base
Xiqual directory for an example of simple usage of a hook.
- Author:
- Ronny Bangsund
- See Also:
- file_new(), file_free(), file_getsize(), file_initbuf(), file_load(), file_seek(), file_scan(), file_read(), file_write(), file_readhook(),
file_writehook()
Alphabetic index
This page was generated with the help of DOC++.