htils 1
A small set of utilities for C programming.
Loading...
Searching...
No Matches
cookie.c File Reference
#include <h2o/memory.h>
#include <htils/assert.h>
#include <htils/basictypes.h>
#include <h2otils/cookie.h>
#include <h2otils/darray.h>
#include <h2otils/string.h>

Functions

h2o_cookie_th2o_cookie_new (h2o_mem_pool_t *pool, const h2o_string *name, const h2o_string *value)
 Creates a new cookie with values.
 
h2o_cookie_th2o_cookie_from_string (h2o_mem_pool_t *pool, const h2o_string *str)
 Creates a new cookie from a string.
 

Function Documentation

◆ h2o_cookie_from_string()

h2o_cookie_t * h2o_cookie_from_string ( h2o_mem_pool_t *  pool,
const h2o_string str 
)

Creates a new cookie from a string.

Parses the string and creates a new cookie from it.

Parameters
poolThe memory pool to allocate the cookie from.
strThe string to parse.
Precondition
pool and str must be valid and cannot be null.
Returns
A pointer to the new cookie.

◆ h2o_cookie_new()

h2o_cookie_t * h2o_cookie_new ( h2o_mem_pool_t *  pool,
const h2o_string name,
const h2o_string value 
)

Creates a new cookie with values.

Allocates a new cookie with the given values to conform to the Set-Cookie syntax.

Parameters
poolThe memory pool to allocate the cookie from.
nameThe name of the cookie.
valueThe value of the cookie.
Precondition
pool, name, and value must be valid and cannot be null.