mirror of
https://github.com/holub/mame
synced 2025-05-21 21:29:15 +03:00
Added device_find_child_by_tag helper function.
This commit is contained in:
parent
a5c60e89b2
commit
d14a2d2c32
@ -360,6 +360,27 @@ const device_config *device_list_find_by_tag(const device_config *listhead, cons
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
device_find_child_by_tag - retrieve a child
|
||||
device configuration based on a tag
|
||||
-------------------------------------------------*/
|
||||
|
||||
const device_config *device_find_child_by_tag(const device_config *owner, const char *tag)
|
||||
{
|
||||
astring *tempstring;
|
||||
const device_config *child;
|
||||
|
||||
assert(owner != NULL);
|
||||
assert(tag != NULL);
|
||||
|
||||
tempstring = astring_alloc();
|
||||
child = device_list_find_by_tag(owner->machine->config->devicelist, device_build_tag(tempstring, owner, tag));
|
||||
astring_free(tempstring);
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
device_list_index - return the index of a
|
||||
device based on its type and tag;
|
||||
|
@ -367,6 +367,9 @@ const device_config *device_list_next(const device_config *prevdevice, device_ty
|
||||
/* retrieve a device configuration based on a tag */
|
||||
const device_config *device_list_find_by_tag(const device_config *listhead, const char *tag);
|
||||
|
||||
/* retrieve a child device configuration based on a tag */
|
||||
const device_config *device_find_child_by_tag(const device_config *owner, const char *tag);
|
||||
|
||||
/* return the index of a device based on its type and tag; DEVICE_TYPE_WILDCARD is allowed */
|
||||
int device_list_index(const device_config *listhead, device_type type, const char *tag);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user