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

Lua script functions. More...

#include "src/scripts/util.h"
#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>
Include dependency graph for scripts_lua.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool script_start (struct t_scripts_state *scripts_state, sds scriptname, struct t_list *arguments, const char *partition, bool localscript, enum script_start_events start_event, unsigned request_id, unsigned long conn_id, sds *error)
 
bool script_validate (struct t_config *config, sds scriptname, sds script, sds *error)
 

Detailed Description

Lua script functions.

Function Documentation

◆ script_start()

bool script_start ( struct t_scripts_state scripts_state,
sds  scriptname,
struct t_list arguments,
const char *  partition,
bool  localscript,
enum script_start_events  start_event,
unsigned  request_id,
unsigned long  conn_id,
sds *  error 
)

Executes the script in a new thread.

Parameters
scripts_statePointer to script_state
scriptnameScript name to execute
argumentsScript arguments
partitionMPD Partition
localscriptScript is saved locally?
start_eventEvent starting the script
request_idJsonrpc ID
conn_idMongoose request id
errorPointer to already allocated sds string for the error message
Returns
true on success, else false

◆ script_validate()

bool script_validate ( struct t_config config,
sds  scriptname,
sds  script,
sds *  error 
)

Validates (compiles) a lua script

Parameters
configPointer to config
scriptnamename of the script
scriptthe script itself
erroralready allocated sds string to hold the error message
Returns
true on success, else false