Remove prio_list.
* include/grub/list.h (grub_prio_list): Removed. (GRUB_PRIO_LIST_PRIO_MASK): Removed. All users switched to GRUB_COMMAND_PRIO_MASK. (GRUB_PRIO_LIST_FLAG_ACTIVE): Removed. All users switched to GRUB_COMMAND_FLAG_ACTIVE. (grub_prio_list_insert): Removed. (grub_prio_list_remove): Likewise. (GRUB_AS_PRIO_LIST): Likewise. (GRUB_AS_PRIO_LIST_P): Likewise. * include/grub/command.h (GRUB_COMMAND_PRIO_MASK): New define. (GRUB_COMMAND_FLAG_ACTIVE): Likewise. * grub-core/kern/list.c (grub_prio_list_insert): Remove. * grub-core/kern/command.c (grub_register_command_prio): Inline the prio_list code. (grub_unregister_command): Likewise.
This commit is contained in:
commit
eece3349ea
8 changed files with 61 additions and 83 deletions
|
@ -33,42 +33,6 @@ grub_named_list_find (grub_named_list_t head, const char *name)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
grub_prio_list_insert (grub_prio_list_t *head, grub_prio_list_t nitem)
|
||||
{
|
||||
int inactive = 0;
|
||||
|
||||
grub_prio_list_t *p, q;
|
||||
|
||||
for (p = head, q = *p; q; p = &(q->next), q = q->next)
|
||||
{
|
||||
int r;
|
||||
|
||||
r = grub_strcmp (nitem->name, q->name);
|
||||
if (r < 0)
|
||||
break;
|
||||
if (r > 0)
|
||||
continue;
|
||||
|
||||
if (nitem->prio >= (q->prio & GRUB_PRIO_LIST_PRIO_MASK))
|
||||
{
|
||||
q->prio &= ~GRUB_PRIO_LIST_FLAG_ACTIVE;
|
||||
break;
|
||||
}
|
||||
|
||||
inactive = 1;
|
||||
}
|
||||
|
||||
*p = nitem;
|
||||
nitem->next = q;
|
||||
if (q)
|
||||
q->prev = &nitem->next;
|
||||
nitem->prev = p;
|
||||
|
||||
if (! inactive)
|
||||
nitem->prio |= GRUB_PRIO_LIST_FLAG_ACTIVE;
|
||||
}
|
||||
|
||||
void
|
||||
grub_list_push (grub_list_t *head, grub_list_t item)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue