Standard file I/O functions. More...
Macros | |
| #define | KZS_FILE_ERROR |
| Result value indicating that an error occurred in the function. | |
| #define | KZS_FILE_READONLY |
| File is opened in read only text mode. | |
| #define | KZS_FILE_READONLY_BINARY |
| File is opened in read only binary mode. | |
| #define | KZS_FILE_WRITEONLY |
| File is opened in writeable text mode. | |
| #define | KZS_FILE_WRITEONLY_BINARY |
| File is opened in writeable binary mode. | |
Typedefs | |
| typedef void | kzsFile |
| File type. | |
Enumerations | |
| enum | KzsFileOrigin { KZS_FILE_ORIGIN_SEEK_SET , KZS_FILE_ORIGIN_SEEK_CUR , KZS_FILE_ORIGIN_SEEK_END } |
| Origin for kzsFseek. More... | |
Functions | |
| kzInt | kzsFclose (kzsFile *file) |
| Closes a file. | |
| kzBool | kzsFeof (kzsFile *file) |
| Checks if the end of a file has been reached. | |
| kzInt | kzsFerror (kzsFile *file) |
| Checks if there is an error in a file. | |
| kzInt | kzsFflush (kzsFile *file) |
| Flushes the stream. | |
| kzInt | kzsFgetc (kzsFile *file) |
| Gets a byte from a file. | |
| kzInt | kzsFileGetSize (kzsFile *file) |
| Get the size of a file. | |
| kzInt | kzsFileno (const kzsFile *file) |
| Gets file descriptor. | |
| kzInt | kzsFileReadSkip (kzsFile *file, kzUint byteCount) |
| Skips bytes in a file. | |
| kzsFile * | kzsFopen (kzString fileName, kzString mode) |
| Opens a file. | |
| kzInt | kzsFputc (kzInt character, kzsFile *file) |
| Writes a byte to a file. | |
| kzUint | kzsFread (void *buffer, kzUint elementSize, kzUint elementCount, kzsFile *file) |
| Reads elements from a file. | |
| kzInt | kzsFseek (kzsFile *file, kzInt offset, enum KzsFileOrigin origin) |
| Seeks to given position in a file. | |
| kzInt | kzsFtell (kzsFile *file) |
| Gets the current position in a file. | |
| kzUint | kzsFwrite (const void *buffer, kzUint elementSize, kzUint elementCount, kzsFile *file) |
| Writes elements to a file. | |
Standard file I/O functions.
Copyright 2008-2017 by Rightware. All rights reserved.
| #define KZS_FILE_ERROR |
Result value indicating that an error occurred in the function.
| #define KZS_FILE_WRITEONLY |
File is opened in writeable text mode.
| #define KZS_FILE_WRITEONLY_BINARY |
File is opened in writeable binary mode.
| #define KZS_FILE_READONLY |
File is opened in read only text mode.
| #define KZS_FILE_READONLY_BINARY |
File is opened in read only binary mode.
| typedef void kzsFile |
File type.
| enum KzsFileOrigin |
| kzInt kzsFseek | ( | kzsFile * | file, |
| kzInt | offset, | ||
| enum KzsFileOrigin | origin ) |
Seeks to given position in a file.
Reads elements from a file.
Returns the number of elements read.
Writes elements to a file.
Returns the number of elements written.
Skips bytes in a file.
Returns the number of bytes skipped. Returns KZS_FILE_ERROR if an error occurred. This function is intended for skipping in a file only when reading it. To skip in a writable file, use kzsFseek with KZS_FILE_ORIGIN_SEEK_CUR as origin.