MCPcopy Create free account
hub / github.com/F-Stack/f-stack / resource_find_match

Function resource_find_match

freebsd/kern/subr_hints.c:431–450  ·  view source on GitHub ↗

* err = resource_find_match(&anchor, &name, &unit, resname, value) * Iteratively fetch a list of devices wired "at" something * res and value are restrictions. eg: "at", "scbus0". * For practical purposes, res = required, value = optional. * *name and *unit are set. * set *anchor to zero before starting. */

Source from the content-addressed store, hash-verified

429 * set *anchor to zero before starting.
430 */
431int
432resource_find_match(int *anchor, const char **name, int *unit,
433 const char *resname, const char *value)
434{
435 const char *found_name;
436 int found_namelen;
437 int found_unit;
438 int ret;
439 int newln;
440
441 newln = *anchor;
442 ret = resource_find(anchor, &newln, NULL, NULL, resname, value,
443 &found_name, &found_namelen, &found_unit, NULL, NULL, NULL);
444 if (ret == 0) {
445 *name = resource_string_copy(found_name, found_namelen);
446 *unit = found_unit;
447 }
448 *anchor = newln;
449 return ret;
450}
451
452/*
453 * err = resource_find_dev(&anchor, name, &unit, res, value);

Callers 1

Calls 2

resource_string_copyFunction · 0.85
resource_findFunction · 0.70

Tested by

no test coverage detected