Lines Matching refs:line
44 static int parse_header(const char* line, const mapinfo* prev, mapinfo** mi) {
51 if (sscanf(line, "%lx-%lx %*s %*x %*x:%*x %*d%n", &start, &end, &name_pos) != 2) {
56 while (isspace(line[name_pos])) {
60 if (line[name_pos]) {
61 strlcpy(name, line + name_pos, sizeof(name));
91 static int parse_field(mapinfo* mi, const char* line) {
95 if (sscanf(line, "%63s %n", field, &len) == 1
98 if (sscanf(line + len, "%d kB", &size) == 1) {
177 char line[1024];
189 while (fgets(line, sizeof(line), fp) != 0) {
190 len = strlen(line);
191 if (line[len - 1] == '\n') {
192 line[--len] = 0;
195 if (current != NULL && !parse_field(current, line)) {
200 if (!parse_header(line, current, &next)) {
206 fprintf(stderr, "warning: could not parse map info line: %s\n", line);