Lines Matching +full:line +full:- +full:name
1 // SPDX-License-Identifier: MIT
14 "// SPDX-License-Identifier: MIT\n" \
33 fprintf(f, "usage: %s <input-rule-file> <generated-c-source-file> <generated-c-header-file>\n", in print_usage()
37 static void print_parse_error(const char *err_msg, const char *line, in print_parse_error() argument
41 err_msg, lineno, line); in print_parse_error()
44 static char *strip(char *line, size_t linelen) in strip() argument
46 while (isspace(*(line + linelen))) in strip()
47 linelen--; in strip()
49 line[linelen - 1] = '\0'; in strip()
51 return line + strspn(line, " \f\n\r\t\v"); in strip()
57 char line[MAX_LINE_LEN + 1]; in parse() local
58 char *name, *prev_name = NULL, *rules; in parse() local
61 while (fgets(line, sizeof(line), input)) { in parse()
65 if (line[0] == '\0' || line[0] == '#' || line[0] == '\n') { in parse()
70 linelen = strlen(line); in parse()
72 print_parse_error("line too long", line, lineno); in parse()
73 return -EINVAL; in parse()
76 is_continuation = isspace(line[0]); in parse()
77 name = strip(line, linelen); in parse()
80 name = strtok(name, " \t"); in parse()
85 line, lineno); in parse()
86 return -EINVAL; in parse()
89 rules = name; in parse()
90 name = NULL; in parse()
94 print_parse_error("invalid empty rule\n", line, lineno); in parse()
95 return -EINVAL; in parse()
98 if (name) { in parse()
99 fprintf(cheader, "\tXE_WA_OOB_%s = %u,\n", name, idx); in parse()
106 name, rules); in parse()
114 prev_name = name; in parse()