diff options
author | Haru <haru@dotalux.com> | 2014-03-11 04:19:59 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-03-16 23:20:10 +0100 |
commit | ab878900afdb9c9caa58b7f84f0a12b6283edf2b (patch) | |
tree | a9670a60087de3f4a2f7f2356cb3bc4413e6db3e /src/common | |
parent | 8ed83b91c0984b251740d0cb62870bf4ca889853 (diff) | |
download | hercules-ab878900afdb9c9caa58b7f84f0a12b6283edf2b.tar.gz hercules-ab878900afdb9c9caa58b7f84f0a12b6283edf2b.tar.bz2 hercules-ab878900afdb9c9caa58b7f84f0a12b6283edf2b.tar.xz hercules-ab878900afdb9c9caa58b7f84f0a12b6283edf2b.zip |
Added --load-plugin commandline argument
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/HPM.c | 9 | ||||
-rw-r--r-- | src/common/HPM.h | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/common/HPM.c b/src/common/HPM.c index a25a17782..971eb83bd 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -269,11 +269,12 @@ void hplugin_unload(struct hplugin* plugin) { } } -void hplugins_config_read(void) { +void hplugins_config_read(const char * const *extra_plugins, int extra_plugins_count) { config_t plugins_conf; config_setting_t *plist = NULL; const char *config_filename = "conf/plugins.conf"; // FIXME hardcoded name FILE *fp; + int i; // uncomment once login/char support is wrapped up // if( !HPM->DataCheck ) { @@ -294,9 +295,13 @@ void hplugins_config_read(void) { HPM->symbol_defaults_sub(); plist = libconfig->lookup(&plugins_conf, "plugins_list"); + for (i = 0; i < extra_plugins_count; i++) { + config_setting_t *entry = libconfig->setting_add(plist, NULL, CONFIG_TYPE_STRING); + config_setting_set_string(entry, extra_plugins[i]); + } if (plist != NULL) { - int length = libconfig->setting_length(plist), i; + int length = libconfig->setting_length(plist); char filename[60]; for(i = 0; i < length; i++) { if( !strcmpi(libconfig->setting_get_string_elem(plist,i),"HPMHooking") ) {//must load it first diff --git a/src/common/HPM.h b/src/common/HPM.h index 52ad24a03..b466cb4f3 100644 --- a/src/common/HPM.h +++ b/src/common/HPM.h @@ -131,7 +131,7 @@ struct HPM_interface { void *(*import_symbol) (char *name, unsigned int pID); void (*share) (void *, char *); void (*symbol_defaults) (void); - void (*config_read) (void); + void (*config_read) (const char * const *extra_plugins, int extra_plugins_count); bool (*populate) (struct hplugin *plugin,const char *filename); void (*symbol_defaults_sub) (void);//TODO drop char *(*pid2name) (unsigned int pid); |