X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2Fmodules.c;h=d024c3e186f3abb39bdf80534cf77aa3f16f2d8d;hp=adbe37df4a4cd16432e45ed90e636b67a9401b51;hb=406c308308e4d131475a692cd425cb156e0776f1;hpb=7d9422966272d2d0998280521a8347d42bd8e1cb diff --git a/src/modules.c b/src/modules.c index adbe37d..d024c3e 100644 --- a/src/modules.c +++ b/src/modules.c @@ -44,6 +44,7 @@ /* 170-180 */ #include "UserNode.h" /* 181-183 */ #include "WHOHandler.h" /* 184-188 */ #include "version.h" +/* 189 */ /* modules.h */ #define Function void * @@ -247,7 +248,8 @@ void *global_functions[] = { /* 185 */ (Function) get_creation, /* 186 */ (Function) get_revision, /* 187 */ (Function) get_codelines, -/* 188 */ (Function) get_patchlevel +/* 188 */ (Function) get_patchlevel, +/* 189 */ (Function) get_module_name }; static int module_id_counter = 1; @@ -471,3 +473,13 @@ int module_loaded(int module_id) { } return 0; } + +char *get_module_name(int module_id) { + if(!module_id) return NULL; + struct ModuleInfo *modinfo; + for(modinfo = modules; modinfo; modinfo = modinfo->next) { + if(modinfo->module_id == module_id) + return modinfo->name; + } + return NULL; +}