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

Go to the source code of this file.

Functions

STA_DECL 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...
 
STA_DECL 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...
 
STA_DECL io_tio_view_init (void *buffer, const char *name, const void *data, size_t size)
 
STA_DECL io_tio_string_init (void *buffer, const char *name, const char *string)
 

Function Documentation

◆ io_string()

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

Parameters
namethe name of the IO view
stringthe backing string view
arenathe arena to allocate from
Returns
the io object

Definition at line 90 of file view.c.

◆ io_string_init()

STA_DECL io_t* io_string_init ( void *  buffer,
const char *  name,
const char *  string 
)

Definition at line 107 of file view.c.

◆ io_view()

STA_DECL io_t* io_view ( const char *  name,
const void *  data,
size_t  size,
arena_t arena 
)

create a readonly IO object for a given view of memory

public allocating api

Definition at line 83 of file view.c.

◆ io_view_init()

STA_DECL io_t* io_view_init ( void *  buffer,
const char *  name,
const void *  data,
size_t  size 
)

public in place api

Definition at line 101 of file view.c.