hwi_find_item()

unsigned hwi_find_item(unsigned start, ...);
Note: Although the hwi_find_item() function resides in the C library (proto in <hw/sysinfo.h>), the function is still usable from startup programs.

Search for a given item in the hwinfo section of the system page. If start is HWI_NULL_OFF, the search begins at the start of the hwinfo section. If not, it starts from the item after the offset of the one passed in (this allows people to find multiple tags of the same type; it works just like the find_startup_info() function). The var args portion is a list of character pointers, giving item names; the list is terminated with a NULL. The order of the item names gives ownership information. For example:

item = hwi_find_item(HWI_NULL_OFF, "foobar", NULL);

searches for an item name called "foobar." The following:

item = hwi_find_item(HWI_NULL_OFF, "mumblyshwartz",
                     "foobar", NULL);

also searches for "foobar," but this time it has to be owned by an item called "mumblyshwartz."

If the item can't be found, HWI_NULL_OFF is returned; otherwise, the byte offset within the hwinfo section is returned.