Variables API functions.
More...
#include "compile_time.h"
#include "src/scripts/api_tmp.h"
#include "src/lib/json/json_print.h"
#include "src/lib/json/json_rpc.h"
#include "src/lib/mem.h"
#include "src/lib/sds_extras.h"
#include "src/scripts/util.h"
#include <errno.h>
#include <time.h>
|
| void | scripts_tmp_delete (rax *scripts_tmp_list, sds key) |
| |
| bool | scripts_tmp_set (rax *scripts_tmp_list, sds key, sds value, int lifetime) |
| |
| sds | scripts_tmp_get (rax *scripts_tmp_list, sds buffer, unsigned request_id, sds key) |
| |
| sds | scripts_tmp_list (rax *scripts_tmp_list, sds buffer, unsigned request_id) |
| |
| void | script_tmp_list_should_expire (struct t_scripts_state *scripts_state) |
| |
| void | scripts_tmp_list_expire (rax *scripts_tmp_list, bool cleanup) |
| |
◆ script_tmp_list_should_expire()
| void script_tmp_list_should_expire |
( |
struct t_scripts_state * |
scripts_state | ) |
|
Checks if the tmp var list should be expired
- Parameters
-
| scripts_state | Pointer to scripts_state |
◆ scripts_tmp_delete()
| void scripts_tmp_delete |
( |
rax * |
scripts_tmp_list, |
|
|
sds |
key |
|
) |
| |
Deletes a tmp variable in the tree, ignores not existing keys
- Parameters
-
| scripts_tmp_list | pointer to script tmp list |
| key | key to remove |
◆ scripts_tmp_get()
| sds scripts_tmp_get |
( |
rax * |
scripts_tmp_list, |
|
|
sds |
buffer, |
|
|
unsigned |
request_id, |
|
|
sds |
key |
|
) |
| |
Returns a jsonrpc response with the value of a tmp variable or an empty string if not found
- Parameters
-
| scripts_tmp_list | pointer to script tmp list |
| buffer | buffer to append the response |
| request_id | jsonrpc request id |
| key | Key to get |
- Returns
- pointer to buffer
◆ scripts_tmp_list()
| sds scripts_tmp_list |
( |
rax * |
scripts_tmp_list, |
|
|
sds |
buffer, |
|
|
unsigned |
request_id |
|
) |
| |
Returns a jsonrpc response with all script tmp variables
- Parameters
-
| scripts_tmp_list | pointer to script tmp list |
| buffer | buffer to append the response |
| request_id | jsonrpc request id |
- Returns
- pointer to buffer
◆ scripts_tmp_list_expire()
| void scripts_tmp_list_expire |
( |
rax * |
scripts_tmp_list, |
|
|
bool |
cleanup |
|
) |
| |
Expires the script tmp var list
- Parameters
-
| scripts_tmp_list | Pointer to script tmp list |
| cleanup | Expire all entries and free the radix tree? |
◆ scripts_tmp_set()
| bool scripts_tmp_set |
( |
rax * |
scripts_tmp_list, |
|
|
sds |
key, |
|
|
sds |
value, |
|
|
int |
lifetime |
|
) |
| |
Adds/modifies a tmp variable in the tree
- Parameters
-
| scripts_tmp_list | pointer to script tmp list |
| key | name of the variable |
| value | value of the variable |
| lifetime | lifetime of the tmp variable |
- Returns
- true on success, else false