瀏覽代碼

Having forced __table() to natural structure alignment, it now seems

that we *can* place arrays in tables, which means we can force the
order within a table without having to resort to explicitly numbered
sections on everything.
tags/v0.9.3
Michael Brown 17 年之前
父節點
當前提交
77bb7b13a7
共有 1 個檔案被更改,包括 43 行新增41 行删除
  1. 43
    41
      src/core/settings.c

+ 43
- 41
src/core/settings.c 查看文件

@@ -357,45 +357,47 @@ struct config_setting_type config_setting_type_int8 __config_setting_type = {
357 357
 };
358 358
 
359 359
 /** Some basic setting definitions */
360
-struct config_setting ip_config_setting __config_setting = {
361
-	.name = "ip",
362
-	.description = "IP address of this machine (e.g. 192.168.0.1)",
363
-	.tag = DHCP_EB_YIADDR,
364
-	.type = &config_setting_type_ipv4,
365
-};
366
-struct config_setting hostname_config_setting __config_setting = {
367
-	.name = "hostname",
368
-	.description = "Host name of this machine",
369
-	.tag = DHCP_HOST_NAME,
370
-	.type = &config_setting_type_string,
371
-};
372
-struct config_setting username_config_setting __config_setting = {
373
-	.name = "username",
374
-	.description = "User name for authentication to servers",
375
-	.tag = DHCP_EB_USERNAME,
376
-	.type = &config_setting_type_string,
377
-};
378
-struct config_setting password_config_setting __config_setting = {
379
-	.name = "password",
380
-	.description = "Password for authentication to servers",
381
-	.tag = DHCP_EB_PASSWORD,
382
-	.type = &config_setting_type_string,
383
-};
384
-struct config_setting root_path_config_setting __config_setting = {
385
-	.name = "root-path",
386
-	.description = "NFS/iSCSI root path",
387
-	.tag = DHCP_ROOT_PATH,
388
-	.type = &config_setting_type_string,
389
-};
390
-struct config_setting priority_config_setting __config_setting = {
391
-	.name = "priority",
392
-	.description = "Priority of these options",
393
-	.tag = DHCP_EB_PRIORITY,
394
-	.type = &config_setting_type_int8,
395
-};
396
-struct config_setting iscsi_initiator_setting __config_setting = {
397
-	.name = "initiator-iqn",
398
-	.description = "iSCSI qualified name of this machine",
399
-	.tag = DHCP_ISCSI_INITIATOR_IQN,
400
-	.type = &config_setting_type_string,
360
+struct config_setting basic_config_settings[] __config_setting = {
361
+	{
362
+		.name = "ip",
363
+		.description = "IP address of this machine (e.g. 192.168.0.1)",
364
+		.tag = DHCP_EB_YIADDR,
365
+		.type = &config_setting_type_ipv4,
366
+	},
367
+	{
368
+		.name = "hostname",
369
+		.description = "Host name of this machine",
370
+		.tag = DHCP_HOST_NAME,
371
+		.type = &config_setting_type_string,
372
+	},
373
+	{
374
+		.name = "username",
375
+		.description = "User name for authentication to servers",
376
+		.tag = DHCP_EB_USERNAME,
377
+		.type = &config_setting_type_string,
378
+	},
379
+	{
380
+		.name = "password",
381
+		.description = "Password for authentication to servers",
382
+		.tag = DHCP_EB_PASSWORD,
383
+		.type = &config_setting_type_string,
384
+	},
385
+	{
386
+		.name = "root-path",
387
+		.description = "NFS/iSCSI root path",
388
+		.tag = DHCP_ROOT_PATH,
389
+		.type = &config_setting_type_string,
390
+	},
391
+	{
392
+		.name = "priority",
393
+		.description = "Priority of these options",
394
+		.tag = DHCP_EB_PRIORITY,
395
+		.type = &config_setting_type_int8,
396
+	},
397
+	{
398
+		.name = "initiator-iqn",
399
+		.description = "iSCSI qualified name of this machine",
400
+		.tag = DHCP_ISCSI_INITIATOR_IQN,
401
+		.type = &config_setting_type_string,
402
+	}
401 403
 };

Loading…
取消
儲存