MCPcopy Create free account
hub / github.com/coreboot/coreboot / is_valid_entry

Function is_valid_entry

util/amdfwtool/data_parse.c:424–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424static int is_valid_entry(char *oneline, regmatch_t match[N_MATCHES])
425{
426 int retval, index;
427
428 for (index = 0; index < N_MATCHES; index++) {
429 match[index].rm_so = -1;
430 match[index].rm_eo = -1;
431 }
432 if (regexec(&entries_line_expr, oneline, N_MATCHES, match, 0) == 0) {
433 /* match[1]: FW type
434 match[2]: FW filename
435 match[4]: Optional directory level to be dropped
436 match[6]: Optional hash table ID to put the hash for the entry
437 */
438 if (match[FW_TYPE].rm_eo != -1)
439 oneline[match[FW_TYPE].rm_eo] = '\0';
440 if (match[FW_FILE].rm_eo != -1)
441 oneline[match[FW_FILE].rm_eo] = '\0';
442 if (match[OPT_LEVEL].rm_eo != -1)
443 oneline[match[OPT_LEVEL].rm_eo] = '\0';
444 if (match[OPT_HASH_TABLE_ID].rm_eo != -1)
445 oneline[match[OPT_HASH_TABLE_ID].rm_eo] = '\0';
446 if (match[OPT_FWID_TYPE].rm_eo != -1)
447 oneline[match[OPT_FWID_TYPE].rm_eo] = '\0';
448 retval = 1;
449 } else {
450 retval = 0;
451 }
452
453 return retval;
454}
455
456static int skip_comment_blank_line(char *oneline)
457{

Callers 1

process_configFunction · 0.85

Calls 1

regexecFunction · 0.85

Tested by

no test coverage detected