Home | History | Annotate | Download | only in blkid

Lines Matching refs:cp

61 static char *skip_over_blank(char *cp)
63 while (*cp && isspace(*cp))
64 cp++;
65 return cp;
68 static char *skip_over_word(char *cp)
72 while ((ch = *cp)) {
75 cp++;
76 if (*cp == '\0')
78 cp++;
83 cp++;
85 return cp;
138 static int parse_start(char **cp)
142 p = strip_line(*cp);
154 *cp = p;
165 static int parse_end(char **cp)
167 *cp = skip_over_blank(*cp);
169 if (!strncmp(*cp, "</device>", 9)) {
170 DBG(DEBUG_READ, printf("found device trailer %9s\n", *cp));
171 *cp += 9;
184 static int parse_dev(blkid_cache cache, blkid_dev *dev, char **cp)
189 if ((ret = parse_start(cp)) <= 0)
192 start = tmp = strchr(*cp, '>');
195 printf("blkid: short line parsing dev: %s\n", *cp));
204 if (**cp == '>')
205 *cp = end;
207 (*cp)++;
218 DBG(DEBUG_READ, printf("blkid: empty device name: %s\n", *cp));
240 static int parse_token(char **name, char **value, char **cp)
244 if (!name || !value || !cp)
247 if (!(*value = strchr(*cp, '=')))
251 *name = strip_line(*cp);
259 *cp = *value;
272 *cp = end;
281 static int parse_xml(char **name, char **value, char **cp)
285 if (!name || !value || !cp)
288 *name = strip_line(*cp);
304 static int parse_tag(blkid_cache cache, blkid_dev dev, char **cp)
313 if ((ret = parse_token(&name, &value, cp)) <= 0 /* &&
314 (ret = parse_xml(&name, &value, cp)) <= 0 */)
343 static int blkid_parse_line(blkid_cache cache, blkid_dev *dev_p, char *cp)
353 DBG(DEBUG_READ, printf("line: %s\n", cp));
355 if ((ret = parse_dev(cache, dev_p, &cp)) <= 0)
360 while ((ret = parse_tag(cache, dev, &cp)) > 0) {