myMPD
Internal API documentation
Loading...
Searching...
No Matches
api_tmp.h File Reference

Variables API functions. More...

#include "dist/rax/rax.h"
#include "dist/sds/sds.h"
#include "src/scripts/util.h"
#include <stdbool.h>
Include dependency graph for api_tmp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  t_tmpvar_data

Functions

void scripts_tmp_delete (rax *scripts_tmp_list, sds key)
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)
bool scripts_tmp_set (rax *scripts_tmp_list, sds key, sds value, int lifetime)
void script_tmp_list_should_expire (struct t_scripts_state *scripts_state)
void scripts_tmp_list_expire (rax *scripts_tmp_list, bool cleanup)

Detailed Description

Variables API functions.

Function Documentation

◆ 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_statePointer 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_listpointer to script tmp list
keykey 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_listpointer to script tmp list
bufferbuffer to append the response
request_idjsonrpc request id
keyKey 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_listpointer to script tmp list
bufferbuffer to append the response
request_idjsonrpc 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_listPointer to script tmp list
cleanupExpire 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_listpointer to script tmp list
keyname of the variable
valuevalue of the variable
lifetimelifetime of the tmp variable
Returns
true on success, else false