alow a plugin to require other plugin

This commit is contained in:
lxsang 2020-01-03 10:14:04 +01:00
parent 876f60c9a2
commit cb98562585
4 changed files with 16 additions and 0 deletions

Binary file not shown.

View File

@ -70,6 +70,12 @@ static const char* S_511 = "Network Authentication Required";
static const char* S_UNOF = "Unofficial Status";
int require_plugin(const char* name)
{
UNUSED(name);
return 0;
}
const char* get_status_str(int stat)
{
switch(stat)

View File

@ -101,6 +101,10 @@ typedef struct {
int raw_body;
} plugin_header_t;
int __attribute__((weak)) require_plugin(const char*);
void set_nonblock(int socket);
//void set_block(int socket);

View File

@ -18,6 +18,12 @@ struct plugin_entry *plugin_lookup(char *s)
return NULL; /* not found */
}
int require_plugin(const char* name)
{
struct plugin_entry* ptr = plugin_load((char*)name);
return ptr != NULL;
}
/**
* Load a plugin to the plugin table
* Only load when not available in the plugin table