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

Function resource_find

freebsd/kern/subr_hints.c:305–334  ·  view source on GitHub ↗

* Search all the data sources for matches to our query. We look for * dynamic hints first as overrides for static or fallback hints. */

Source from the content-addressed store, hash-verified

303 * dynamic hints first as overrides for static or fallback hints.
304 */
305static int
306resource_find(int *line, int *startln,
307 const char *name, int *unit, const char *resname, const char *value,
308 const char **ret_name, int *ret_namelen, int *ret_unit,
309 const char **ret_resname, int *ret_resnamelen, const char **ret_value)
310{
311 int i;
312 int un;
313 char *hintp;
314
315 *line = 0;
316 hintp = NULL;
317
318 /* Search for exact unit matches first */
319 i = res_find(&hintp, line, startln, name, unit, resname, value,
320 ret_name, ret_namelen, ret_unit, ret_resname, ret_resnamelen,
321 ret_value);
322 if (i == 0)
323 return 0;
324 if (unit == NULL)
325 return ENOENT;
326 /* If we are still here, search for wildcard matches */
327 un = -1;
328 i = res_find(&hintp, line, startln, name, &un, resname, value,
329 ret_name, ret_namelen, ret_unit, ret_resname, ret_resnamelen,
330 ret_value);
331 if (i == 0)
332 return 0;
333 return ENOENT;
334}
335
336int
337resource_int_value(const char *name, int unit, const char *resname, int *result)

Callers 6

resource_int_valueFunction · 0.70
resource_long_valueFunction · 0.70
resource_string_valueFunction · 0.70
resource_find_matchFunction · 0.70
resource_find_devFunction · 0.70
resource_unset_valueFunction · 0.70

Calls 1

res_findFunction · 0.85

Tested by

no test coverage detected