aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/lua.h
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-03-23 00:15:00 +0100
committercbdev <cb@cbcdn.com>2020-03-23 00:15:00 +0100
commit37e712edf23a49be5387f945ab9ea57cc0b57f22 (patch)
tree5037b14bdbd08baa8f104f7e4946aa5643281a94 /backends/lua.h
parent666aec036f9bf0de82c435bd7eace271613cee1e (diff)
parentaa02ccf3abf183207b24fcbb9460cbd904a698e2 (diff)
downloadmidimonster-37e712edf23a49be5387f945ab9ea57cc0b57f22.tar.gz
midimonster-37e712edf23a49be5387f945ab9ea57cc0b57f22.tar.bz2
midimonster-37e712edf23a49be5387f945ab9ea57cc0b57f22.zip
Merge current master
Diffstat (limited to 'backends/lua.h')
-rw-r--r--backends/lua.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/backends/lua.h b/backends/lua.h
index 75f03c4..4583dfe 100644
--- a/backends/lua.h
+++ b/backends/lua.h
@@ -12,7 +12,7 @@
MM_PLUGIN_API int init();
static int lua_configure(char* option, char* value);
static int lua_configure_instance(instance* inst, char* option, char* value);
-static instance* lua_instance();
+static int lua_instance(instance* inst);
static channel* lua_channel(instance* inst, char* spec, uint8_t flags);
static int lua_set(instance* inst, size_t num, channel** c, channel_value* v);
static int lua_handle(size_t num, managed_fd* fds);
@@ -22,13 +22,20 @@ static int lua_shutdown(size_t n, instance** inst);
static uint32_t lua_interval();
#endif
+typedef struct /*_lua_channel*/ {
+ char* name;
+ int reference;
+ double in;
+ double out;
+ uint8_t mark;
+} lua_channel_data;
+
typedef struct /*_lua_instance_data*/ {
size_t channels;
- char** channel_name;
- int* reference;
- double* input;
- double* output;
+ lua_channel_data* channel;
+
lua_State* interpreter;
+ char* default_handler;
} lua_instance_data;
typedef struct /*_lua_interval_callback*/ {
@@ -37,3 +44,10 @@ typedef struct /*_lua_interval_callback*/ {
lua_State* interpreter;
int reference;
} lua_timer;
+
+typedef struct /*_lua_coroutine*/ {
+ instance* instance;
+ lua_State* thread;
+ int reference;
+ uint64_t timeout;
+} lua_thread;