Request parameters.
Definition in file params.h.
Increment request parameter list reference count.
Claim ownership of request parameter list.
Decrement request parameter list reference count.
- Parameters
-
params | Parameter list, or NULL |
- Return values
-
params | Parameter list as passed in |
- Parameters
-
params | Parameter list, or NULL |
params | Parameter list |
- Return values
-
Definition at line 51 of file params.h.
#define ref_get(refcnt)
Get additional reference to object.
References ref_get, and parameters::refcnt.
struct parameters* create_parameters |
( |
const char * |
name | ) |
|
Create request parameter list.
- Parameters
-
name | Parameter list name (may be NULL) |
- Return values
-
params | Parameter list, or NULL on failure |
Definition at line 86 of file params.c.
94 claim_parameters ( params );
95 params_put ( params );
100 params =
zalloc (
sizeof ( *params ) + name_len );
104 name_copy = ( (
void * ) ( params + 1 ) );
109 params->
name = name_copy;
116 DBGC ( params,
"PARAMS \"%s\" created\n", params->
name );
static void free_parameters(struct refcnt *refcnt)
Free request parameter list.
#define ref_init(refcnt, free)
Initialise a reference counter.
A request parameter list.
struct parameters * find_parameters(const char *name)
Find request parameter list by name.
struct refcnt refcnt
Reference count.
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
char * strcpy(char *dest, const char *src)
Copy string.
void * zalloc(size_t size)
Allocate cleared memory.
size_t strlen(const char *src)
Get length of string.
struct list_head entries
Parameters.
struct list_head list
List of all parameter lists.
#define INIT_LIST_HEAD(list)
Initialise a list head.
#define NULL
NULL pointer (VOID *)
References DBGC, parameters::entries, find_parameters(), free_parameters(), INIT_LIST_HEAD, parameters::list, list_add_tail, parameters::name, name, NULL, ref_init, parameters::refcnt, strcpy(), strlen(), and zalloc().
Referenced by params_exec(), and uri_params_okx().
struct parameter* add_parameter |
( |
struct parameters * |
params, |
|
|
const char * |
key, |
|
|
const char * |
value, |
|
|
unsigned int |
flags |
|
) |
| |
Add request parameter.
- Parameters
-
params | Parameter list |
key | Parameter key |
value | Parameter value |
flags | Parameter flags |
- Return values
-
param | Parameter, or NULL on failure |
Definition at line 129 of file params.c.
144 key_copy = ( (
void * ) (
param + 1 ) );
145 value_copy = ( key_copy + key_len );
149 param->key = key_copy;
151 param->value = value_copy;
157 DBGC ( params,
"PARAMS \"%s\" added \"%s\"=\"%s\"%s%s\n",
pseudo_bit_t value[0x00020]
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
char * strcpy(char *dest, const char *src)
Copy string.
void * zalloc(size_t size)
Allocate cleared memory.
struct hv_monitor_parameter param[4][32]
Parameters.
size_t strlen(const char *src)
Get length of string.
struct list_head entries
Parameters.
#define PARAMETER_FORM
Request parameter is a form parameter.
#define NULL
NULL pointer (VOID *)
#define PARAMETER_HEADER
Request parameter is a header parameter.
References DBGC, parameters::entries, flags, key, list_add_tail, parameters::name, NULL, param, PARAMETER_FORM, PARAMETER_HEADER, strcpy(), strlen(), value, and zalloc().
Referenced by param_exec(), and uri_params_okx().