Browse Source

[settings] Clarify usage of the term "named setting"

There are currently two conflicting usages of the term "named setting"
within iPXE: one refers to predefined settings (such as show up in the
"config" UI), the other refers to settings identified by a name (such
as "net0.dhcp/ip").

Split these usages into the term "predefined setting" and "named
setting" to avoid ambiguity.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 years ago
parent
commit
063645118c

+ 3
- 4
src/arch/i386/interface/vmware/guestinfo.c View File

58
 		      strlen ( parent_name ) + 1 /* "." */ +
58
 		      strlen ( parent_name ) + 1 /* "." */ +
59
 		      strlen ( setting->name ) + 1 /* "." */ +
59
 		      strlen ( setting->name ) + 1 /* "." */ +
60
 		      ( type ? strlen ( type->name ) : 0 ) + 1 /* NUL */ ];
60
 		      ( type ? strlen ( type->name ) : 0 ) + 1 /* NUL */ ];
61
-	struct setting *named_setting;
61
+	struct setting *predefined;
62
 	char *info;
62
 	char *info;
63
 	int info_len;
63
 	int info_len;
64
 	int check_len;
64
 	int check_len;
82
 
82
 
83
 	/* Determine default type if necessary */
83
 	/* Determine default type if necessary */
84
 	if ( ! type ) {
84
 	if ( ! type ) {
85
-		named_setting = find_setting ( setting->name );
86
-		type = ( named_setting ?
87
-			 named_setting->type : &setting_type_string );
85
+		predefined = find_setting ( setting->name );
86
+		type = ( predefined ? predefined->type : &setting_type_string );
88
 	}
87
 	}
89
 	assert ( type != NULL );
88
 	assert ( type != NULL );
90
 
89
 

+ 10
- 10
src/core/settings.c View File

262
 }
262
 }
263
 
263
 
264
 /**
264
 /**
265
- * Find child named settings block
265
+ * Find child settings block
266
  *
266
  *
267
  * @v parent		Parent settings block
267
  * @v parent		Parent settings block
268
  * @v name		Name within this parent
268
  * @v name		Name within this parent
289
 }
289
 }
290
 
290
 
291
 /**
291
 /**
292
- * Find or create child named settings block
292
+ * Find or create child settings block
293
  *
293
  *
294
  * @v parent		Parent settings block
294
  * @v parent		Parent settings block
295
  * @v name		Name within this parent
295
  * @v name		Name within this parent
383
 }
383
 }
384
 
384
 
385
 /**
385
 /**
386
- * Find named settings block
386
+ * Find settings block
387
  *
387
  *
388
  * @v name		Name
388
  * @v name		Name
389
  * @ret settings	Settings block, or NULL
389
  * @ret settings	Settings block, or NULL
1113
  */
1113
  */
1114
 
1114
 
1115
 /**
1115
 /**
1116
- * Find named setting
1116
+ * Find predefined setting
1117
  *
1117
  *
1118
  * @v name		Name
1118
  * @v name		Name
1119
- * @ret setting		Named setting, or NULL
1119
+ * @ret setting		Setting, or NULL
1120
  */
1120
  */
1121
 struct setting * find_setting ( const char *name ) {
1121
 struct setting * find_setting ( const char *name ) {
1122
 	struct setting *setting;
1122
 	struct setting *setting;
1192
 	char *settings_name;
1192
 	char *settings_name;
1193
 	char *setting_name;
1193
 	char *setting_name;
1194
 	char *type_name;
1194
 	char *type_name;
1195
-	struct setting *named_setting;
1195
+	struct setting *predefined;
1196
 
1196
 
1197
 	/* Set defaults */
1197
 	/* Set defaults */
1198
 	*settings = &settings_root;
1198
 	*settings = &settings_root;
1226
 	setting->tag = parse_setting_tag ( setting_name );
1226
 	setting->tag = parse_setting_tag ( setting_name );
1227
 	setting->scope = (*settings)->default_scope;
1227
 	setting->scope = (*settings)->default_scope;
1228
 	setting->name = setting_name;
1228
 	setting->name = setting_name;
1229
-	for_each_table_entry ( named_setting, SETTINGS ) {
1230
-		/* Matches a defined named setting; use that setting */
1231
-		if ( setting_cmp ( named_setting, setting ) == 0 ) {
1232
-			memcpy ( setting, named_setting, sizeof ( *setting ) );
1229
+	for_each_table_entry ( predefined, SETTINGS ) {
1230
+		/* Matches a predefined setting; use that setting */
1231
+		if ( setting_cmp ( predefined, setting ) == 0 ) {
1232
+			memcpy ( setting, predefined, sizeof ( *setting ) );
1233
 			break;
1233
 			break;
1234
 		}
1234
 		}
1235
 	}
1235
 	}

+ 2
- 2
src/interface/smbios/smbios_settings.c View File

197
 	.scope = &smbios_settings_scope,
197
 	.scope = &smbios_settings_scope,
198
 };
198
 };
199
 
199
 
200
-/** Other SMBIOS named settings */
201
-struct setting smbios_named_settings[] __setting ( SETTING_HOST_EXTRA ) = {
200
+/** Other SMBIOS predefined settings */
201
+struct setting smbios_predefined_settings[] __setting ( SETTING_HOST_EXTRA ) = {
202
 	{
202
 	{
203
 		.name = "manufacturer",
203
 		.name = "manufacturer",
204
 		.description = "Manufacturer",
204
 		.description = "Manufacturer",

+ 1
- 1
src/net/netdev_settings.c View File

35
  *
35
  *
36
  */
36
  */
37
 
37
 
38
-/** Network device named settings */
38
+/** Network device predefined settings */
39
 struct setting mac_setting __setting ( SETTING_NETDEV ) = {
39
 struct setting mac_setting __setting ( SETTING_NETDEV ) = {
40
 	.name = "mac",
40
 	.name = "mac",
41
 	.description = "MAC address",
41
 	.description = "MAC address",

Loading…
Cancel
Save