Cthulhu  0.2.10
Cthulhu compiler collection
io.h File Reference
#include <ctu_io_api.h>
#include "core/analyze.h"
#include "os/core.h"
#include <stddef.h>
#include <stdarg.h>
Include dependency graph for io.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

typedef typedefCT_BEGIN_API struct io_t io_t
 
CT_IO_API os_error_t io_free (STA_RELEASE io_t *io)
 destroy an IO object and free its memory More...
 
CT_IO_API os_error_t io_close (INOUT_NOTNULL io_t *io)
 destroy an IO object More...
 
CT_NODISCARD CT_IO_API io_tio_file (const char *path, os_access_t mode, arena_t *arena)
 create an IO object from a file More...
 
CT_NODISCARD CT_IO_API io_tio_memory (const char *name, const void *data, size_t size, os_access_t flags, arena_t *arena)
 create an IO object from an initial view of memory More...
 
CT_NODISCARD CT_IO_API io_tio_blob (const char *name, size_t size, os_access_t flags, arena_t *arena)
 create an IO object in memory of a given size size specifies the initial internal buffer size, the file seek position starts at 0 More...
 
CT_NODISCARD CT_IO_API io_tio_view (const char *name, const void *data, size_t size, arena_t *arena)
 create a readonly IO object for a given view of memory More...
 
CT_NODISCARD CT_IO_API io_tio_string (const char *name, const char *string, arena_t *arena)
 create an IO view of a string create a readonly IO view of a string More...
 
CT_NODISCARD CT_IO_API io_tio_file_init (STA_WRITES(IO_FILE_SIZE) void *buffer, const char *path, os_access_t mode)
 create an io object from a file initializes an io object using a preallocated buffer. More...
 
CT_NODISCARD CT_IO_API io_tio_memory_init (STA_WRITES(IO_BUFFER_SIZE) void *buffer, const char *name, const void *data, size_t size, os_access_t flags, arena_t *arena)
 create an io object from a memory buffer initializes an io object using a preallocated buffer. More...
 
CT_NODISCARD CT_IO_API io_tio_blob_init (STA_WRITES(IO_BUFFER_SIZE) void *buffer, const char *name, size_t size, os_access_t flags, arena_t *arena)
 create an io object from a memory buffer initializes an io object using a preallocated buffer. More...
 
CT_NODISCARD CT_IO_API io_tio_view_init (STA_WRITES(IO_VIEW_SIZE) void *buffer, const char *name, const void *data, size_t size)
 create an io object from a memory buffer initializes an io object using a preallocated buffer. More...
 
CT_NODISCARD CT_IO_API io_tio_string_init (STA_WRITES(IO_VIEW_SIZE) void *buffer, const char *name, const char *string)
 create an io object from a memory buffer initializes an io object using a preallocated buffer. More...
 
CT_IO_API size_t io_read (io_t *io, STA_WRITES(size) void *dst, size_t size)
 read from an io object More...
 
CT_IO_API size_t io_write (io_t *io, STA_READS(size) const void *src, size_t size)
 write to an io object More...
 
CT_IO_API size_t io_printf (io_t *io, STA_FORMAT_STRING const char *fmt,...)
 printf to an io object More...
 
CT_IO_API size_t io_vprintf (io_t *io, const char *fmt, va_list args)
 vprintf to an io object More...
 
CT_NODISCARD CT_IO_API const char * io_name (const io_t *io)
 get the name of an io object More...
 
CT_NODISCARD CT_IO_API size_t io_size (io_t *io)
 get the total size of an io objects contents More...
 
CT_NODISCARD CT_IO_API size_t io_seek (io_t *io, size_t offset)
 seek to an absolute offset in a file More...
 
CT_NODISCARD CT_IO_API 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...
 
CT_NODISCARD CT_IO_API os_error_t io_error (const io_t *io)
 get the last error from the io object More...