Module loadere (ugly)
FossilOrigin-Name: bc7f59e8b41f31ac0d74d5295eebb7a261d8b65f98b9e176e9b0cb44445f8c30
This commit is contained in:
parent
756457f2f2
commit
f3e471174d
9
src/mod/Makefile
Normal file
9
src/mod/Makefile
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
all:
|
||||
$(MAKE) -C capwap
|
||||
$(MAKE) -C cipwap
|
||||
cc -c modload_ac.c -I../
|
||||
|
||||
clean:
|
||||
$(MAKE) -C capwap clean
|
||||
$(MAKE) -C cipwap clean
|
5
src/mod/modload.h
Normal file
5
src/mod/modload.h
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
#include "capwap/mod.h"
|
||||
|
||||
struct mod_ac * modload_ac(const char *name);
|
||||
|
22
src/mod/modload_ac.c
Normal file
22
src/mod/modload_ac.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include "../capwap/mod.h"
|
||||
|
||||
|
||||
#include "cipwap/mod_cipwap.h"
|
||||
#include "capwap/mod_capwap.h"
|
||||
|
||||
#define MODS_AC { mod_capwap_ac,mod_cipwap_ac,NULL }
|
||||
|
||||
|
||||
struct mod_ac *(*mods_ac[])() = MODS_AC;
|
||||
|
||||
struct mod_ac * modload_ac(const char *name)
|
||||
{
|
||||
int i;
|
||||
for (i=0; mods_ac[i];i++){
|
||||
|
||||
struct mod_ac * m = mods_ac[i]();
|
||||
if (strcmp(m->name,name)==0)
|
||||
return m;
|
||||
}
|
||||
return NULL;
|
||||
}
|
Loading…
Reference in New Issue
Block a user