|
myMPD
Internal API documentation
|
Script thread utility functions. More...
#include "dist/rax/rax.h"#include "dist/sds/sds.h"#include "src/lib/list.h"#include "src/scripts/events.h"#include <lauxlib.h>#include <lua.h>#include <lualib.h>

Go to the source code of this file.
Data Structures | |
| struct | t_scripts_state |
| struct | t_script_list_data |
| struct | t_script_thread_arg |
Functions | |
| void | list_free_cb_script_list_user_data (struct t_list_node *current) |
| 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 | scripts_state_free (struct t_scripts_state *scripts_state) |
| 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) |
| sds | script_get_result (lua_State *lua_vm, int rc) |
| void | free_t_script_thread_arg (struct t_script_thread_arg *script_thread_arg) |
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 |
| 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 |