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

Lua interface helpers. More...

#include "src/lib/list.h"
#include "src/lib/mpdclient.h"
#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>
#include <stdbool.h>
Include dependency graph for interface.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct t_configget_lua_global_config (lua_State *lua_vm)
 
void populate_lua_table (lua_State *lua_vm, struct t_list *lua_mympd_state)
 
void populate_lua_table_field_mpd_song (lua_State *lua_vm, const char *key, const struct mpd_song *song)
 
void populate_lua_table_field_p (lua_State *lua_vm, const char *key, const char *value)
 
void populate_lua_table_field_i (lua_State *lua_vm, const char *key, int64_t value)
 
void populate_lua_table_field_f (lua_State *lua_vm, const char *key, double value)
 
void populate_lua_table_field_b (lua_State *lua_vm, const char *key, bool value)
 

Detailed Description

Lua interface helpers.

Function Documentation

◆ get_lua_global_config()

struct t_config * get_lua_global_config ( lua_State *  lua_vm)

Gets the config struct from lua userdata

Parameters
lua_vmlua instance
Returns
pointer to mympd config struct

◆ populate_lua_table()

void populate_lua_table ( lua_State *  lua_vm,
struct t_list lua_mympd_state 
)

Populates the lua table from the lua_mympd_state struct

Parameters
lua_vmlua instance
lua_mympd_state

◆ populate_lua_table_field_b()

void populate_lua_table_field_b ( lua_State *  lua_vm,
const char *  key,
bool  value 
)

Helper functions to push a lua table

Parameters
lua_vmlua instance
keythe key
valuebool value

◆ populate_lua_table_field_f()

void populate_lua_table_field_f ( lua_State *  lua_vm,
const char *  key,
double  value 
)

Helper functions to push a lua table

Parameters
lua_vmlua instance
keythe key
valuedouble value (lua number)

◆ populate_lua_table_field_i()

void populate_lua_table_field_i ( lua_State *  lua_vm,
const char *  key,
int64_t  value 
)

Helper functions to push a lua table

Parameters
lua_vmlua instance
keythe key
valueint64_t value (lua integer)

◆ populate_lua_table_field_mpd_song()

void populate_lua_table_field_mpd_song ( lua_State *  lua_vm,
const char *  key,
const struct mpd_song *  song 
)

Creates a lua sub table from a mpd song

Parameters
lua_vmlua instance
keythe key
songMPD song

◆ populate_lua_table_field_p()

void populate_lua_table_field_p ( lua_State *  lua_vm,
const char *  key,
const char *  value 
)

Helper functions to push a lua table

Parameters
lua_vmlua instance
keythe key
valuestring value