21 if (!req || !key)
return;
40 if (!req || !key || !req->
flash)
return NULL;
101 if (!buf)
return NULL;
109 if (len + 2 >=
cap) {
137 for (
char *
p = b->
key; *
p;
p++) {
138 if (*
p ==
'"' || *
p ==
'\\') buf[len++] =
'\\';
145 if (*
p ==
'"' || *
p ==
'\\') buf[len++] =
'\\';
152 if (len + 2 >=
cap) {
Memory allocation wrappers backed by libttak.
void cwist_free(void *ptr)
Free memory obtained via cwist_alloc/cwist_strdup/etc.
void * cwist_realloc(void *ptr, size_t new_size)
Resize an existing allocation (libttak tracked).
void * cwist_alloc(size_t size)
Allocate zeroed memory tracked by libttak.
uint64_t siphash24(const void *src, size_t len, const uint8_t key[16])
Compute SipHash-2-4 over a byte range using a 16-byte secret key.
char * cwist_flash_pop_all_json(cwist_http_request *req)
Serialize all flash entries to a JSON object and clear the map.
const char * cwist_flash_get(cwist_http_request *req, const char *key)
Read and remove a flash entry.
void cwist_flash_set(cwist_http_request *req, const char *key, const char *value)
Store a flash entry on the request.
const char * cwist_flash_peek(cwist_http_request *req, const char *key)
Read a flash entry without removing it.
One-time flash messages (ala Flask flash/get_flashed_messages).
const char * cwist_query_map_get(cwist_query_map *map, const char *key)
Get a value by key.
void cwist_query_map_set(cwist_query_map *map, const char *key, const char *value)
Set a key-value pair.
cwist_query_map * cwist_query_map_create(void)
Create a new query map.
cwist_query_map * flash
Flash messages for this request (one-time read).
struct cwist_query_bucket * next
cwist_query_bucket ** buckets