Skip to content

Commit

Permalink
add a flag to mark defaults platform specific
Browse files Browse the repository at this point in the history
this flag helps when automatically generating documentation.
  • Loading branch information
joergsteffens authored and Marco van Wieringen committed Oct 7, 2014
1 parent 4250b4b commit 971659e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dird/dird_conf.c
Expand Up @@ -95,14 +95,14 @@ static RES_ITEM dir_items[] = {
{ "diraddress", CFG_TYPE_ADDRESSES_ADDRESS, ITEM(res_dir.DIRaddrs), 0, CFG_ITEM_DEFAULT, DIR_DEFAULT_PORT },
{ "diraddresses", CFG_TYPE_ADDRESSES, ITEM(res_dir.DIRaddrs), 0, CFG_ITEM_DEFAULT, DIR_DEFAULT_PORT },
{ "dirsourceaddress", CFG_TYPE_ADDRESSES_ADDRESS, ITEM(res_dir.DIRsrc_addr), 0, CFG_ITEM_DEFAULT, "0" },
{ "queryfile", CFG_TYPE_DIR, ITEM(res_dir.query_file), 0, CFG_ITEM_REQUIRED, NULL },
{ "workingdirectory", CFG_TYPE_DIR, ITEM(res_dir.working_directory), 0, CFG_ITEM_DEFAULT, _PATH_BAREOS_WORKINGDIR },
{ "piddirectory", CFG_TYPE_DIR, ITEM(res_dir.pid_directory), 0, CFG_ITEM_DEFAULT, _PATH_BAREOS_PIDDIR },
{ "QueryFile", CFG_TYPE_DIR, ITEM(res_dir.query_file), 0, CFG_ITEM_REQUIRED, NULL },
{ "workingdirectory", CFG_TYPE_DIR, ITEM(res_dir.working_directory), 0, CFG_ITEM_DEFAULT | CFG_ITEM_PLATFORM_SPECIFIC, _PATH_BAREOS_WORKINGDIR },
{ "piddirectory", CFG_TYPE_DIR, ITEM(res_dir.pid_directory), 0, CFG_ITEM_DEFAULT | CFG_ITEM_PLATFORM_SPECIFIC, _PATH_BAREOS_PIDDIR },
{ "plugindirectory", CFG_TYPE_DIR, ITEM(res_dir.plugin_directory), 0, 0, NULL },
{ "pluginnames", CFG_TYPE_PLUGIN_NAMES, ITEM(res_dir.plugin_names), 0, 0, NULL },
{ "scriptsdirectory", CFG_TYPE_DIR, ITEM(res_dir.scripts_directory), 0, 0, NULL },
#if defined(HAVE_DYNAMIC_CATS_BACKENDS)
{ "backenddirectory", CFG_TYPE_ALIST_DIR, ITEM(res_dir.backend_directories), 0, CFG_ITEM_DEFAULT, _PATH_BAREOS_BACKENDDIR },
{ "backenddirectory", CFG_TYPE_ALIST_DIR, ITEM(res_dir.backend_directories), 0, CFG_ITEM_DEFAULT | CFG_ITEM_PLATFORM_SPECIFIC, _PATH_BAREOS_BACKENDDIR },
#endif
{ "subscriptions", CFG_TYPE_PINT32, ITEM(res_dir.subscriptions), 0, CFG_ITEM_DEFAULT, "0" },
{ "subsysdirectory", CFG_TYPE_DIR, ITEM(res_dir.subsys_directory), 0, 0, NULL },
Expand Down
6 changes: 6 additions & 0 deletions src/lib/parse_conf.h
Expand Up @@ -145,6 +145,12 @@ struct RES_TABLE {
#define CFG_ITEM_DEPRECATED 0x8 /* Deprecated config option */
#define CFG_ITEM_ALIAS 0x10 /* Item is an alias for an other */

/*
* CFG_ITEM_DEFAULT_PLATFORM_SPECIFIC: the value may differ between different
* platforms (or configure settings). This information is used for the documentation.
*/
#define CFG_ITEM_PLATFORM_SPECIFIC 0x20

enum {
/*
* Standard resource types. handlers in res.c
Expand Down
3 changes: 3 additions & 0 deletions src/lib/res.c
Expand Up @@ -1861,6 +1861,9 @@ bool print_res_item_schema_json(POOL_MEM &buff, int level, RES_ITEM *item)
if (item->flags & CFG_ITEM_DEFAULT) {
add_json_pair(buff, level + 1, "default_value", item->default_value);
}
if (item->flags & CFG_ITEM_PLATFORM_SPECIFIC) {
add_json_pair(buff, level + 1, "platform_specific", "true");
}
if (item->flags & CFG_ITEM_DEPRECATED) {
add_json_pair_plain(buff, level + 1, "deprecated", "true");
}
Expand Down

0 comments on commit 971659e

Please sign in to comment.