🦄 refactor(plugin manager): Updating interface definitions

This commit is contained in:
yangwei
2022-07-27 14:11:29 +08:00
parent 717f52e4c1
commit 4735a8073a
6 changed files with 42 additions and 41 deletions

View File

@@ -1,35 +1,20 @@
#pragma once
#include <sys/queue.h>
#include <time.h>
#include "sdk/include/session.h"
#include "sdk/include/plugin.h"
struct stellar_plugin_ctx
{
void *call_back_arg;
const struct timeval timeout;
fn_session_event_callback call_back;
TAILQ_ENTRY(stellar_plugin_ctx) tqe;
};
TAILQ_HEAD(stellar_plugin_ctx_list, stellar_plugin_ctx);
struct plugin_manager;
struct plugin_manager *plugin_manager_init();
struct stellar_plugin_data
{
stellar_plugin_ctx_list plugin_ctx_list;
};
struct plugin_manager_handle;
struct plugin_manager_handle *plugin_manager_init();
int plugin_manager_event_register(struct plugin_manager_handle *h,
int plugin_manager_event_register(struct plugin_manager *h,
const char *session_type_name,
fn_session_event_callback call_back,
const struct timeval *timeout);
int plugin_manager_load(const char *plugin_conf_path);
void plugin_manager_dispatch(struct plugin_manager_handle *h, struct stellar_event *ev);
void plugin_manager_dispatch(struct plugin_manager *h, struct stellar_event *ev);