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

Go to the source code of this file.

Data Structures

struct  io_callbacks_t
 io callback interface More...
 
struct  io_t
 io object implementation More...
 

Typedefs

typedef size_t(* io_read_t) (io_t *self, void *dst, size_t size)
 io object read callback More...
 
typedef size_t(* io_write_t) (io_t *self, const void *src, size_t size)
 io write callback More...
 
typedef size_t(* io_fwrite_t) (io_t *self, const char *fmt, va_list args)
 io write format callback seperate from io_write_t to allow for more efficient implementations if this is not provided, io_write_t will be used instead More...
 
typedef size_t(* io_size_t) (io_t *self)
 io size callback get the total size of an io objects backing data More...
 
typedef size_t(* io_seek_t) (io_t *self, size_t offset)
 io seek callback seek from start callback More...
 
typedef void *(* io_map_t) (io_t *self, os_protect_t protect)
 io map callback map an io objects backing data into memory More...
 
typedef os_error_t(* io_close_t) (io_t *self)
 io close callback destroy an io objects backing data and any associated resources More...
 

Functions

CT_PUREFN CT_IO_API void * io_data (io_t *io)
 get the user data from an io object More...
 
CT_IO_API io_tio_new (const io_callbacks_t *cb, os_access_t flags, const char *name, STA_READS(cb->size) const void *data, arena_t *arena)
 create a new IO object for a given interface More...
 
CT_IO_API io_tio_init (STA_WRITES(sizeof(io_t)+cb->size) void *buffer, const io_callbacks_t *cb, os_access_t flags, const char *name, STA_READS(cb->size) const void *data, arena_t *arena)
 initialize an IO object for a given interface More...