mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-08 08:58:50 +03:00
refactor: rename struct cfg_def_item's 'unconfigured_path' to 'unconfigured_value'
It's not only path that can be used for setting's default value in unconfigured form as @something@.
This commit is contained in:
parent
d0c46c9ed5
commit
de6deec3b8
@ -65,11 +65,11 @@ struct config_source {
|
|||||||
* Map each ID to respective definition of the configuration item.
|
* Map each ID to respective definition of the configuration item.
|
||||||
*/
|
*/
|
||||||
static struct cfg_def_item _cfg_def_items[CFG_COUNT + 1] = {
|
static struct cfg_def_item _cfg_def_items[CFG_COUNT + 1] = {
|
||||||
#define cfg_section(id, name, parent, flags, since_version, unconfigured_path, comment) {id, parent, name, CFG_TYPE_SECTION, {0}, flags, since_version, unconfigured_path, comment},
|
#define cfg_section(id, name, parent, flags, since_version, unconfigured_value, comment) {id, parent, name, CFG_TYPE_SECTION, {0}, flags, since_version, unconfigured_value, comment},
|
||||||
#define cfg(id, name, parent, flags, type, default_value, since_version, unconfigured_path, comment) {id, parent, name, type, {.v_##type = default_value}, flags, since_version, unconfigured_path, comment},
|
#define cfg(id, name, parent, flags, type, default_value, since_version, unconfigured_value, comment) {id, parent, name, type, {.v_##type = default_value}, flags, since_version, unconfigured_value, comment},
|
||||||
#define cfg_runtime(id, name, parent, flags, type, since_version, unconfigured_path, comment) {id, parent, name, type, {.fn_##type = get_default_##id}, flags | CFG_DEFAULT_RUN_TIME, since_version, unconfigured_path, comment},
|
#define cfg_runtime(id, name, parent, flags, type, since_version, unconfigured_value, comment) {id, parent, name, type, {.fn_##type = get_default_##id}, flags | CFG_DEFAULT_RUN_TIME, since_version, unconfigured_value, comment},
|
||||||
#define cfg_array(id, name, parent, flags, types, default_value, since_version, unconfigured_path, comment) {id, parent, name, CFG_TYPE_ARRAY | types, {.v_CFG_TYPE_STRING = default_value}, flags, since_version, unconfigured_path, comment},
|
#define cfg_array(id, name, parent, flags, types, default_value, since_version, unconfigured_value, comment) {id, parent, name, CFG_TYPE_ARRAY | types, {.v_CFG_TYPE_STRING = default_value}, flags, since_version, unconfigured_value, comment},
|
||||||
#define cfg_array_runtime(id, name, parent, flags, types, since_version, unconfigured_path, comment) {id, parent, name, CFG_TYPE_ARRAY | types, {.fn_CFG_TYPE_STRING = get_default_##id}, flags | CFG_DEFAULT_RUN_TIME, since_version, unconfigured_path, comment},
|
#define cfg_array_runtime(id, name, parent, flags, types, since_version, unconfigured_value, comment) {id, parent, name, CFG_TYPE_ARRAY | types, {.fn_CFG_TYPE_STRING = get_default_##id}, flags | CFG_DEFAULT_RUN_TIME, since_version, unconfigured_value, comment},
|
||||||
#include "config_settings.h"
|
#include "config_settings.h"
|
||||||
#undef cfg_section
|
#undef cfg_section
|
||||||
#undef cfg
|
#undef cfg
|
||||||
@ -1698,8 +1698,8 @@ static struct dm_config_node *_add_def_node(struct dm_config_tree *cft,
|
|||||||
str = "";
|
str = "";
|
||||||
cn->v->v.str = str;
|
cn->v->v.str = str;
|
||||||
|
|
||||||
if (spec->unconfigured && def->unconfigured_path)
|
if (spec->unconfigured && def->unconfigured_value)
|
||||||
cn->v->v.str = def->unconfigured_path;
|
cn->v->v.str = def->unconfigured_value;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log_error(INTERNAL_ERROR "_add_def_node: unknown type");
|
log_error(INTERNAL_ERROR "_add_def_node: unknown type");
|
||||||
|
@ -121,7 +121,7 @@ typedef struct cfg_def_item {
|
|||||||
cfg_def_value_t default_value; /* default value (only for settings) */
|
cfg_def_value_t default_value; /* default value (only for settings) */
|
||||||
uint16_t flags; /* configuration item definition flags */
|
uint16_t flags; /* configuration item definition flags */
|
||||||
uint16_t since_version; /* version this item appeared in */
|
uint16_t since_version; /* version this item appeared in */
|
||||||
const char *unconfigured_path; /* path in terms of @FOO@, pre-configured */
|
const char *unconfigured_value; /* value in terms of @FOO@, pre-configured */
|
||||||
const char *comment; /* brief comment */
|
const char *comment; /* brief comment */
|
||||||
} cfg_def_item_t;
|
} cfg_def_item_t;
|
||||||
|
|
||||||
@ -165,11 +165,11 @@ struct config_def_tree_spec {
|
|||||||
* Register ID for each possible item in the configuration tree.
|
* Register ID for each possible item in the configuration tree.
|
||||||
*/
|
*/
|
||||||
enum {
|
enum {
|
||||||
#define cfg_section(id, name, parent, flags, since_version, unconfigured_path, comment) id,
|
#define cfg_section(id, name, parent, flags, since_version, unconfigured_value, comment) id,
|
||||||
#define cfg(id, name, parent, flags, type, default_value, since_version, unconfigured_path, comment) id,
|
#define cfg(id, name, parent, flags, type, default_value, since_version, unconfigured_value, comment) id,
|
||||||
#define cfg_runtime(id, name, parent, flags, type, since_version, unconfigured_path, comment) id,
|
#define cfg_runtime(id, name, parent, flags, type, since_version, unconfigured_value, comment) id,
|
||||||
#define cfg_array(id, name, parent, flags, types, default_value, since_version, unconfigured_path, comment) id,
|
#define cfg_array(id, name, parent, flags, types, default_value, since_version, unconfigured_value, comment) id,
|
||||||
#define cfg_array_runtime(id, name, parent, flags, types, since_version, unconfigured_path, comment) id,
|
#define cfg_array_runtime(id, name, parent, flags, types, since_version, unconfigured_value, comment) id,
|
||||||
#include "config_settings.h"
|
#include "config_settings.h"
|
||||||
#undef cfg_section
|
#undef cfg_section
|
||||||
#undef cfg
|
#undef cfg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user