cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
cwist_sstring Struct Reference

#include <sstring.h>

Collaboration diagram for cwist_sstring:

Public Attributes

char * data
 Access directly only when raw handling is necessary.
 
bool is_fixed
 
bool owns_storage
 
bool borrows_buffer
 data is borrowed (static/arena); never freed, detached on mutation
 
size_t size
 
size_t capacity
 
char * base
 
size_t(* get_size )(struct cwist_sstring *str)
 
int(* compare )(struct cwist_sstring *left, const struct cwist_sstring *right)
 Should mimic strcmp, internally use strncmp.
 
cwist_error_t(* copy )(struct cwist_sstring *str, const struct cwist_sstring *from)
 
cwist_error_t(* append )(struct cwist_sstring *str, const struct cwist_sstring *from)
 Append another sstring.
 

Detailed Description

Definition at line 14 of file sstring.h.

Member Data Documentation

◆ append

cwist_error_t(* cwist_sstring::append)(struct cwist_sstring *str, const struct cwist_sstring *from)

Append another sstring.

Returns
1 on success, 0 on failure.

Definition at line 35 of file sstring.h.

Referenced by cwist_sstring_create(), cwist_sstring_destroy(), cwist_sstring_init(), and cwist_sstring_init_escaped().

◆ base

char * cwist_sstring::base

Allocation base when data views a region inside it (NULL means data is the base). Freed on destroy.

Definition at line 24 of file sstring.h.

Referenced by cwist_sstring_adopt_len(), cwist_sstring_adopt_region(), cwist_sstring_borrow(), cwist_sstring_destroy(), cwist_sstring_init(), cwist_sstring_init_escaped(), and cwist_sstring_substr().

◆ borrows_buffer

bool cwist_sstring::borrows_buffer

◆ capacity

size_t cwist_sstring::capacity

Payload bytes the current data buffer can hold, excluding the NUL; 0 means unknown, in which case growth falls back to exact-fit reallocation.

Definition at line 21 of file sstring.h.

Referenced by cwist_sstring_adopt_len(), cwist_sstring_adopt_region(), cwist_sstring_borrow(), cwist_sstring_destroy(), cwist_sstring_init(), cwist_sstring_init_escaped(), and cwist_sstring_substr().

◆ compare

int(* cwist_sstring::compare)(struct cwist_sstring *left, const struct cwist_sstring *right)

Should mimic strcmp, internally use strncmp.

should mimic strcmp, internally use strncmp

Definition at line 27 of file sstring.h.

Referenced by cwist_sstring_create(), cwist_sstring_destroy(), cwist_sstring_init(), and cwist_sstring_init_escaped().

◆ copy

◆ data

◆ get_size

size_t(* cwist_sstring::get_size)(struct cwist_sstring *str)

◆ is_fixed

◆ owns_storage

bool cwist_sstring::owns_storage

◆ size


The documentation for this struct was generated from the following files: