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>
Go to the source code of this file.
|
| struct t_config * | get_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) |
| |
◆ get_lua_global_config()
| struct t_config * get_lua_global_config |
( |
lua_State * |
lua_vm | ) |
|
Gets the config struct from lua userdata
- Parameters
-
- 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_vm | lua 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_vm | lua instance |
| key | the key |
| value | bool 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_vm | lua instance |
| key | the key |
| value | double 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_vm | lua instance |
| key | the key |
| value | int64_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_vm | lua instance |
| key | the key |
| song | MPD 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_vm | lua instance |
| key | the key |
| value | string value |