Add resource_list_add_next() which returns the RID for the resource added.

This commit is contained in:
Matthew N. Dodd 2002-03-29 06:42:54 +00:00
parent 9954794b0c
commit 32bc1098b2
2 changed files with 17 additions and 0 deletions

View File

@ -1136,6 +1136,19 @@ resource_list_free(struct resource_list *rl)
}
}
int
resource_list_add_next(struct resource_list *rl, int type,
u_long start, u_long end, u_long count)
{
int rid;
rid = 0;
while (resource_list_find(rl, type, rid)) rid++;
resource_list_add(rl, type, rid, start, end, count);
return (rid);
}
void
resource_list_add(struct resource_list *rl, int type, int rid,
u_long start, u_long end, u_long count)

View File

@ -143,6 +143,10 @@ void resource_list_free(struct resource_list *rl);
void resource_list_add(struct resource_list *rl,
int type, int rid,
u_long start, u_long end, u_long count);
int resource_list_add_next(struct resource_list *rl,
int type,
u_long start, u_long end, u_long count);
/*
* Find a resource entry by type and rid.