myMPD
Internal API documentation
Loading...
Searching...
No Matches
lua_mympd_state.c File Reference

myMPD state for Lua scripts More...

#include "compile_time.h"
#include "src/mympd_api/lua_mympd_state.h"
#include "src/lib/cache/cache_rax_album.h"
#include "src/lib/log.h"
#include "src/lib/mem.h"
#include "src/lib/sds_extras.h"
#include "src/lib/utility.h"
#include "src/mympd_api/status.h"
#include "src/mympd_client/errorhandler.h"
#include "src/mympd_client/shortcuts.h"
Include dependency graph for lua_mympd_state.c:

Functions

static void lua_mympd_state_free_user_data (struct t_list_node *current)
 
bool mympd_api_status_lua_mympd_state_set (struct t_list *lua_partition_state, struct t_mympd_state *mympd_state, struct t_partition_state *partition_state)
 
void lua_mympd_state_set_mpd_song (struct t_list *lua_mympd_state, const char *k, const struct mpd_song *song)
 
void lua_mympd_state_set_p (struct t_list *lua_mympd_state, const char *k, const char *v)
 
void lua_mympd_state_set_i (struct t_list *lua_mympd_state, const char *k, int64_t v)
 
void lua_mympd_state_set_f (struct t_list *lua_mympd_state, const char *k, double v)
 
void lua_mympd_state_set_u (struct t_list *lua_mympd_state, const char *k, unsigned v)
 
void lua_mympd_state_set_b (struct t_list *lua_mympd_state, const char *k, bool v)
 
void lua_mympd_state_free (struct t_list *lua_mympd_state)
 
void lua_mympd_state_free_void (void *lua_mympd_state)
 

Detailed Description

myMPD state for Lua scripts

Function Documentation

◆ lua_mympd_state_free()

void lua_mympd_state_free ( struct t_list lua_mympd_state)

Frees the lua_mympd_state list

Parameters
lua_mympd_statepointer to the list

◆ lua_mympd_state_free_user_data()

static void lua_mympd_state_free_user_data ( struct t_list_node current)
static

Private definitions

Private functions Callback for lua_mympd_state_free to free string values

Parameters
currentpointer to the list node

◆ lua_mympd_state_free_void()

void lua_mympd_state_free_void ( void *  lua_mympd_state)

Frees the lua_mympd_state list

Parameters
lua_mympd_statevoid pointer to lua_mympd_state

◆ lua_mympd_state_set_b()

void lua_mympd_state_set_b ( struct t_list lua_mympd_state,
const char *  k,
bool  v 
)

Pushes a bool value to the lua_mympd_state list

Parameters
lua_mympd_statepointer to a t_list struct
kvariable name
vvariable value

◆ lua_mympd_state_set_f()

void lua_mympd_state_set_f ( struct t_list lua_mympd_state,
const char *  k,
double  v 
)

Pushes a double value to the lua_mympd_state list

Parameters
lua_mympd_statepointer to a t_list struct
kvariable name
vvariable value

◆ lua_mympd_state_set_i()

void lua_mympd_state_set_i ( struct t_list lua_mympd_state,
const char *  k,
int64_t  v 
)

Pushes an int64_t value to the lua_mympd_state list

Parameters
lua_mympd_statepointer to a t_list struct
kvariable name
vvariable value

◆ lua_mympd_state_set_mpd_song()

void lua_mympd_state_set_mpd_song ( struct t_list lua_mympd_state,
const char *  k,
const struct mpd_song *  song 
)

Pushes a copy of a MPD song to the lua_mympd_state list

Parameters
lua_mympd_statepointer to a t_list struct
kvariable name
songPointer to MPD song struct

◆ lua_mympd_state_set_p()

void lua_mympd_state_set_p ( struct t_list lua_mympd_state,
const char *  k,
const char *  v 
)

Pushes a string to the lua_mympd_state list

Parameters
lua_mympd_statepointer to a t_list struct
kvariable name
vvariable value

◆ lua_mympd_state_set_u()

void lua_mympd_state_set_u ( struct t_list lua_mympd_state,
const char *  k,
unsigned  v 
)

Pushes a unsigned int value to the lua_mympd_state list

Parameters
lua_mympd_statepointer to a t_list struct
kvariable name
vvariable value

◆ mympd_api_status_lua_mympd_state_set()

bool mympd_api_status_lua_mympd_state_set ( struct t_list lua_partition_state,
struct t_mympd_state mympd_state,
struct t_partition_state partition_state 
)

Public functions Copies mpd and myMPD states to the lua_mympd_state struct

Parameters
lua_partition_statepointer to struct t_list
mympd_statepointer to mympd_state
partition_statepointer to partition state
Returns
true on success, else false