io/kfile.h File Reference
#include <cfg/compiler.h>#include <cfg/debug.h>#include <cfg/macros.h>Go to the source code of this file.
Data Structures | |
| struct | ReOpenFunc_t |
| Context data for callback functions which operate on pseudo files. More... | |
Typedefs | |
| typedef int32_t | kfile_off_t |
| KFile offset type, used by kfile_seek(). | |
Enumerations | |
| enum | KSeekMode { KSM_SEEK_SET, KSM_SEEK_CUR, KSM_SEEK_END } |
Costants for repositioning read/write file offset. More... | |
Functions | |
| kfile_off_t | kfile_genericSeek (struct KFile *fd, kfile_off_t offset, KSeekMode whence) |
| Move fd file seek position of offset bytes from whence. | |
| struct KFile * | kfile_genericReopen (struct KFile *fd) |
| Reopen file fd. | |
| int | kfile_genericClose (struct KFile *fd) |
| Close file fd. | |
KFile access functions | |
Interface functions for KFile access. | |
| size_t | kfile_read (struct KFile *fd, void *buf, size_t size) |
| Read size bytes from file fd into buf. | |
| int | kfile_gets (struct KFile *fd, char *buf, int size) |
| Read a line long at most as size and put it in buf. | |
| int | kfile_gets_echo (struct KFile *fd, char *buf, int size, bool echo) |
| Read a line long at most as size and put it in buf, with optional echo. | |
| kfile_off_t | kfile_copy (KFile *src, KFile *dst, kfile_off_t size) |
| Copy size bytes from file src to dst. | |
| size_t | kfile_write (struct KFile *fd, const void *buf, size_t size) |
| Write size bytes from buffer buf into KFile fd. | |
| int | kfile_printf (struct KFile *fd, const char *format,...) |
| Formatted write. | |
| int | kfile_print (struct KFile *fd, const char *s) |
| Write a string to kfile fd. | |
| kfile_off_t | kfile_seek (struct KFile *fd, kfile_off_t offset, KSeekMode whence) |
| Seek into file (if seekable). | |
| KFile * | kfile_reopen (struct KFile *fd) |
| Close and reopen file fd. | |
| int | kfile_close (struct KFile *fd) |
| Close file. | |
| int | kfile_flush (struct KFile *fd) |
| Flush file I/O. | |
| int | kfile_error (struct KFile *fd) |
| Get file error mask. | |
| void | kfile_clearerr (struct KFile *fd) |
| Clear errors. | |
| int | kfile_putc (int c, struct KFile *fd) |
| Generic putc implementation using kfile_write. | |
| int | kfile_getc (struct KFile *fd) |
| Generic getc implementation using kfile_read. | |
| void | kfile_resync (KFile *fd, mtime_t delay) |
| Discard input to resynchronize with remote end. | |
| void | kfile_init (struct KFile *fd) |
| Base class KFile constructor. | |
Detailed Description
Definition in file io/kfile.h.
