david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[settings] Allow settings blocks to specify a sibling ordering

Allow settings blocks to provide an explicit default ordering between
siblings, with lower precedence than the existing ${priority} setting.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2016-07-19 16:44:18 +01:00
parent 1fdc7da435
commit f5cf4f706e
2 changed files with 4 additions and 0 deletions

View File

@ -452,6 +452,8 @@ static void reprioritise_settings ( struct settings *settings ) {
tmp_priority = fetch_intz_setting ( tmp, &priority_setting );
if ( priority > tmp_priority )
break;
if ( settings->order > tmp->order )
break;
}
list_add_tail ( &settings->siblings, &tmp->siblings );

View File

@ -144,6 +144,8 @@ struct settings {
struct settings_operations *op;
/** Default scope for numerical settings constructed for this block */
const struct settings_scope *default_scope;
/** Sibling ordering */
int order;
};
/**