summaryrefslogtreecommitdiff
path: root/src/common/HPM.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-03-11 04:19:59 +0100
committerHaru <haru@dotalux.com>2014-03-16 23:20:10 +0100
commitab878900afdb9c9caa58b7f84f0a12b6283edf2b (patch)
treea9670a60087de3f4a2f7f2356cb3bc4413e6db3e /src/common/HPM.c
parent8ed83b91c0984b251740d0cb62870bf4ca889853 (diff)
downloadhercules-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/HPM.c')
-rw-r--r--src/common/HPM.c9
1 files changed, 7 insertions, 2 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