From: Sebastian Harl Date: Tue, 1 Jul 2014 19:55:16 +0000 (+0200) Subject: plugin: Make sdb_plugin_info_t public. X-Git-Tag: sysdb-0.2.0~7 X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=commitdiff_plain;h=56b97a180a53aecbfe9f7162b8ece3faae973cf9 plugin: Make sdb_plugin_info_t public. --- diff --git a/src/core/plugin.c b/src/core/plugin.c index 36f80f6..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; diff --git a/src/include/core/plugin.h b/src/include/core/plugin.h index 3d93880..e6ea757 100644 --- a/src/include/core/plugin.h +++ b/src/include/core/plugin.h @@ -45,8 +45,22 @@ typedef struct { } sdb_plugin_ctx_t; #define SDB_PLUGIN_CTX_INIT { 0 } -struct sdb_plugin_info; -typedef struct sdb_plugin_info sdb_plugin_info_t; +typedef struct { + char *plugin_name; + char *filename; + + /* public attributes */ + char *description; + char *copyright; + char *license; + + int version; + int plugin_version; +} sdb_plugin_info_t; +#define SDB_PLUGIN_INFO_INIT { \ + /* plugin_name */ NULL, /* filename */ NULL, /* desc */ NULL, \ + /* copyright */ NULL, /* license */ NULL, \ + /* version */ -1, /* plugin_version */ -1 } /* this should be used in the header of a plugin to avoid * missing prototype warnings/errors for the plugin init