MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / getValueForBootKey

Function getValueForBootKey

Trash/stringTable.c:273–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273BOOL getValueForBootKey(char *line, char *match, char **matchval, INTN *len)
274{
275 char *key, *value;
276 INTN key_len, value_len;
277
278 while (*line) {
279 /* look for keyword or argument */
280 while (isspace(*line)) line++;
281
282 /* now look for '=' or whitespace */
283 line = getToken(line, &key, &key_len);
284 /* line now points to '=' or space */
285 if (!isspace(*line++)) {
286 line = getToken(line, &value, &value_len);
287 if ((strlen(match) == key_len)
288 && strncmp(match, key, key_len) == 0) {
289 *matchval = value;
290 *len = value_len;
291 return YES;
292 }
293 }
294 }
295 return NO;
296}
297
298BOOL getBoolForKey(
299 char *key

Callers 1

getValueForKeyFunction · 0.85

Calls 4

getTokenFunction · 0.85
strncmpFunction · 0.85
isspaceFunction · 0.70
strlenFunction · 0.50

Tested by

no test coverage detected