diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2026-01-06 15:45:03 -0700 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2026-01-06 15:45:03 -0700 |
| commit | 09860c75bb129c70768692aaec3bd42d0b2735e3 (patch) | |
| tree | b0192d2779b26da22c169ac801b781362d10aacc /arken/src/plugin.c | |
| parent | 68dd63f6b3de774863051b66e609a0ca4f4ac2a1 (diff) | |
| download | montis-09860c75bb129c70768692aaec3bd42d0b2735e3.tar.gz montis-09860c75bb129c70768692aaec3bd42d0b2735e3.tar.bz2 montis-09860c75bb129c70768692aaec3bd42d0b2735e3.zip | |
[reorg] add "middleware" library called "liberebor"
Diffstat (limited to 'arken/src/plugin.c')
| -rw-r--r-- | arken/src/plugin.c | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/arken/src/plugin.c b/arken/src/plugin.c index 3edf486..ab02599 100644 --- a/arken/src/plugin.c +++ b/arken/src/plugin.c @@ -1,5 +1,4 @@ #include "plugin.h" -#include "wl.h" #include <ctype.h> #include <dlfcn.h> @@ -53,66 +52,6 @@ static void lock(plugin_t *plugin) { pthread_mutex_lock(&plugin->lock); }; static void unlock(plugin_t *plugin) { pthread_mutex_unlock(&plugin->lock); }; -static int plugin_hot_reload_same_state_action_(plugin_t *plugin, void *ignore) -{ - return plugin_hot_reload_same_state(plugin); -} - -void montis_do_request_hot_reload(void *plugv) -{ - plugin_t *plugin = plugv; - - size_t n = plugin->n_requested_actions++; - if (n < 8) { - plugin->requested_actions[n].action = plugin_hot_reload_same_state_action_; - plugin->requested_actions[n].arg_dtor = NULL; - } -} - -static int plugin_do_log(plugin_t *plugin, void *chrs) -{ - char *str = chrs; - puts(str); - return 0; -} - -void montis_do_request_log(void *plugv, const char *str) -{ - plugin_t *plugin = plugv; - - size_t n = plugin->n_requested_actions++; - if (n < 8) { - plugin->requested_actions[n].action = plugin_do_log; - plugin->requested_actions[n].str_arg = strdup(str); - plugin->requested_actions[n].arg_dtor = free; - } -} - -static int montis_plugin_do_exit(void *plugv, int ec) -{ - exit(ec); - return 0; -} - -void montis_do_request_exit(void *plugv, int ec) -{ - plugin_t *plugin = plugv; - - size_t n = plugin->n_requested_actions++; - if (n < 8) { - plugin->requested_actions[n].action = - (int (*)(plugin_t *, void *))montis_plugin_do_exit; - plugin->requested_actions[n].int_arg = ec; - plugin->requested_actions[n].arg_dtor = NULL; - } -} - -void *montis_plugin_get_seat(void *ctx) -{ - struct montis_server *server = wl_container_of(ctx, server, plugin); - return server->seat; -} - static int load_plugin_from_file_(int argc, char **argv, const char *filename, plugin_t *plugin) { |