X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Fcore%2Fplugin.c;h=f10a904169f5d3993dc89894535e6a7b4ca01513;hp=0e87ce5a9f51f5a719031e36b0dc83460729bb83;hb=56b97a180a53aecbfe9f7162b8ece3faae973cf9;hpb=0d6312e285f39dd133eaab049e96cb073f754566 diff --git a/src/core/plugin.c b/src/core/plugin.c index 0e87ce5..f10a904 100644 --- a/src/core/plugin.c +++ b/src/core/plugin.c @@ -50,29 +50,14 @@ #include +/* helper to access info attributes */ +#define INFO_GET(i, attr) \ + ((i)->attr ? (i)->attr : #attr" not set") + /* * private data types */ -struct sdb_plugin_info { - char *plugin_name; - char *filename; - - /* public attributes */ - char *description; - char *copyright; - char *license; - - int version; - int plugin_version; -}; -#define SDB_PLUGIN_INFO_INIT { \ - /* plugin_name */ NULL, /* filename */ NULL, /* desc */ NULL, \ - /* copyright */ NULL, /* license */ NULL, \ - /* version */ -1, /* plugin_version */ -1 } -#define INFO_GET(i, attr) \ - ((i)->attr ? (i)->attr : #attr" not set") - typedef struct { sdb_object_t super; sdb_plugin_ctx_t public; @@ -520,9 +505,11 @@ module_load(const char *basedir, const char *name, sdb_llist_append(all_plugins, SDB_OBJ(ctx)); sdb_log(SDB_LOG_INFO, "core: Successfully loaded " - "plugin '%s' v%i (%s)\n\t%s\n\tLicense: %s", - ctx->info.plugin_name, ctx->info.plugin_version, - INFO_GET(&ctx->info, description), + "plugin %s v%i (%s)", ctx->info.plugin_name, + ctx->info.plugin_version, + INFO_GET(&ctx->info, description)); + sdb_log(SDB_LOG_INFO, "core: Plugin %s: %s, License: %s", + ctx->info.plugin_name, INFO_GET(&ctx->info, copyright), INFO_GET(&ctx->info, license));