diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-11-21 13:49:47 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-11-21 13:49:47 +1100 |
| commit | d70ec9bf447f7a46e347c3bc5ad58fd88aff46a2 (patch) | |
| tree | ab75c1663934d7408fad36d134a0cfd4f4cb089b /src/lua/lua_queue.cpp | |
| parent | f34b6405884c4073158c3f36158c6351fa135a0f (diff) | |
| download | tangara-fw-d70ec9bf447f7a46e347c3bc5ad58fd88aff46a2.tar.gz | |
Add lua functions to get database content
Diffstat (limited to 'src/lua/lua_queue.cpp')
| -rw-r--r-- | src/lua/lua_queue.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/lua/lua_queue.cpp b/src/lua/lua_queue.cpp new file mode 100644 index 00000000..500940a2 --- /dev/null +++ b/src/lua/lua_queue.cpp @@ -0,0 +1,46 @@ +/* + * Copyright 2023 jacqueline <me@jacqueline.id.au> + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#include "lua_database.hpp" + +#include <memory> +#include <string> + +#include "lua.hpp" + +#include "esp_log.h" +#include "lauxlib.h" +#include "lua.h" +#include "lvgl.h" + +#include "database.hpp" +#include "event_queue.hpp" +#include "index.hpp" +#include "property.hpp" +#include "service_locator.hpp" +#include "ui_events.hpp" + +namespace lua { + +[[maybe_unused]] static constexpr char kTag[] = "lua_queue"; + +static auto queue_add(lua_State* state) -> int { + return 0; +} + +static const struct luaL_Reg kQueueFuncs[] = {{"add", queue_add}, {NULL, NULL}}; + +static auto lua_queue(lua_State* state) -> int { + luaL_newlib(state, kQueueFuncs); + return 1; +} + +auto RegisterQueueModule(lua_State* s) -> void { + luaL_requiref(s, "queue", lua_queue, true); + lua_pop(s, 1); +} + +} // namespace lua
\ No newline at end of file |
