|
myMPD
Internal API documentation
|
Script thread utility functions. More...
#include "compile_time.h"#include "src/scripts/util.h"#include "src/lib/api.h"#include "src/lib/config_def.h"#include "src/lib/list.h"#include "src/lib/log.h"#include "src/lib/mem.h"#include "src/lib/sds_extras.h"#include "src/scripts/api_tmp.h"#include "src/scripts/api_vars.h"#include <time.h>
Functions | |
| static const char * | lua_err_to_str (int rc) |
| void | scripts_state_save (struct t_scripts_state *scripts_state, bool free_data) |
| void | scripts_state_default (struct t_scripts_state *scripts_state, struct t_config *config) |
| void | list_free_cb_script_list_user_data (struct t_list_node *current) |
| void | scripts_state_free (struct t_scripts_state *scripts_state) |
| void | free_t_script_thread_arg (struct t_script_thread_arg *script_thread_arg) |
| sds | script_get_result (lua_State *lua_vm, int rc) |
| void | send_script_raw_response (unsigned long conn_id, const char *partition, sds data) |
| void | send_script_raw_error (unsigned long conn_id, const char *partition, const char *data) |
Script thread utility functions.
| void free_t_script_thread_arg | ( | struct t_script_thread_arg * | script_thread_arg | ) |
Frees the t_script_thread_arg struct
| script_thread_arg | pointer to the struct to free |
| void list_free_cb_script_list_user_data | ( | struct t_list_node * | current | ) |
Callback function to free script_list user_data.
| current | list node |
|
static |
Returns a phrase for lua errors
| rc | return code of the lua script |
| sds script_get_result | ( | lua_State * | lua_vm, |
| int | rc | ||
| ) |
Gets the result from script loading or execution
| lua_vm | lua instance |
| rc | return code |
| void scripts_state_default | ( | struct t_scripts_state * | scripts_state, |
| struct t_config * | config | ||
| ) |
Sets scripts_state defaults.
| scripts_state | pointer to central scripts state |
| config | pointer to static config |
| void scripts_state_free | ( | struct t_scripts_state * | scripts_state | ) |
Frees the scripts_state.
| scripts_state | pointer to central scripts state |
| void scripts_state_save | ( | struct t_scripts_state * | scripts_state, |
| bool | free_data | ||
| ) |
Saves in-memory states to disc. This is done on shutdown and on SIGHUP.
| scripts_state | pointer to central scripts state |
| free_data | true=free the struct, else not |
| void send_script_raw_error | ( | unsigned long | conn_id, |
| const char * | partition, | ||
| const char * | data | ||
| ) |
Sends the scripts raw error to the webserver queue
| conn_id | mongoose connection id |
| partition | MPD partition |
| data | raw http response to send |
| void send_script_raw_response | ( | unsigned long | conn_id, |
| const char * | partition, | ||
| sds | data | ||
| ) |
Sends the scripts raw response to the webserver queue
| conn_id | mongoose connection id |
| partition | MPD partition |
| data | raw http response to send |