#include "io/io.h"
#include "io/impl.h"
#include "os/os.h"
#include "base/panic.h"
#include "std/str.h"
#include "arena/arena.h"
Go to the source code of this file.
|
STA_DECL os_error_t | io_free (io_t *io) |
|
STA_DECL os_error_t | io_close (io_t *io) |
|
STA_DECL size_t | io_read (io_t *io, void *dst, size_t size) |
|
STA_DECL size_t | io_write (io_t *io, const void *src, size_t size) |
|
STA_DECL size_t | io_printf (io_t *io, const char *fmt,...) |
|
STA_DECL size_t | io_vprintf (io_t *io, const char *fmt, va_list args) |
| vprintf to an io object More...
|
|
STA_DECL size_t | io_size (io_t *io) |
| get the total size of an io objects contents More...
|
|
STA_DECL size_t | io_seek (io_t *io, size_t offset) |
| seek to an absolute offset in a file More...
|
|
STA_DECL const char * | io_name (const io_t *io) |
| get the name of an io object More...
|
|
STA_DECL void * | io_map (io_t *io, os_protect_t protect) |
| map an io object into memory maps an io objects entire contents into memory. More...
|
|
STA_DECL os_error_t | io_error (const io_t *io) |
| get the last error from the io object More...
|
|
◆ io_close()
Definition at line 38 of file io.c.
◆ io_error()
get the last error from the io object
- Parameters
-
- Returns
- the last set error
Definition at line 144 of file io.c.
◆ io_free()
Definition at line 26 of file io.c.
◆ io_map()
map an io object into memory maps an io objects entire contents into memory.
- Warning
- while the return value is a mutable pointer, the writability of the memory is determined by
protect
as well as the access mode the io object was created with.
- Parameters
-
io | the io object to map from |
protect | the protection level of the memory |
- Returns
- memory mapping to the contents
Definition at line 120 of file io.c.
◆ io_name()
get the name of an io object
- Parameters
-
- Returns
- the name of the object
Definition at line 112 of file io.c.
◆ io_printf()
STA_DECL size_t io_printf |
( |
io_t * |
io, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Definition at line 64 of file io.c.
◆ io_read()
STA_DECL size_t io_read |
( |
io_t * |
io, |
|
|
void * |
dst, |
|
|
size_t |
size |
|
) |
| |
Definition at line 44 of file io.c.
◆ io_seek()
seek to an absolute offset in a file
- Parameters
-
io | the io object |
offset | the offset to seek to |
- Returns
- the offset after seeking
Definition at line 103 of file io.c.
◆ io_size()
get the total size of an io objects contents
- Parameters
-
- Returns
- the total size in bytes of its contents
Definition at line 94 of file io.c.
◆ io_vprintf()
STA_DECL size_t io_vprintf |
( |
io_t * |
io, |
|
|
const char * |
fmt, |
|
|
va_list |
args |
|
) |
| |
vprintf to an io object
- Precondition
- the io object must have been created with the eOsAccessWrite flag
- Parameters
-
io | the io object |
fmt | the format string |
args | the format arguments |
- Returns
- the number of bytes actually written
Definition at line 79 of file io.c.
◆ io_write()
STA_DECL size_t io_write |
( |
io_t * |
io, |
|
|
const void * |
src, |
|
|
size_t |
size |
|
) |
| |
Definition at line 54 of file io.c.