Cthulhu  0.2.10
Cthulhu compiler collection
buffer.c File Reference
#include "io/impl.h"
#include "io/impl/buffer.h"
#include "os/os.h"
#include "core/macros.h"
#include "arena/arena.h"
#include "base/panic.h"
#include "base/util.h"
Include dependency graph for buffer.c:

Go to the source code of this file.

Functions

STA_DECL io_t * io_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...
 
STA_DECL io_t * io_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...
 
STA_DECL io_t * io_memory_init (void *buffer, const char *name, const void *data, size_t size, os_access_t flags, arena_t *arena)
 
STA_DECL io_t * io_blob_init (void *buffer, const char *name, size_t size, os_access_t flags, arena_t *arena)
 

Function Documentation

◆ io_blob()

STA_DECL io_t* io_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

Parameters
namethe name of the io object
sizethe starting size of the buffer
flagsthe access mode
arenathe arena to allocate from
Returns
the io object

Definition at line 126 of file buffer.c.

◆ io_blob_init()

STA_DECL io_t* io_blob_init ( void *  buffer,
const char *  name,
size_t  size,
os_access_t  flags,
arena_t *  arena 
)

Definition at line 143 of file buffer.c.

◆ io_memory()

STA_DECL io_t* io_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

public allocating api

Definition at line 119 of file buffer.c.

◆ io_memory_init()

STA_DECL io_t* io_memory_init ( void *  buffer,
const char *  name,
const void *  data,
size_t  size,
os_access_t  flags,
arena_t *  arena 
)

public in place api

Definition at line 137 of file buffer.c.