Lines Matching refs:cp
60 static char *skip_over_blank(char *cp)
62 while (*cp && isspace(*cp))
63 cp++;
64 return cp;
67 static char *skip_over_word(char *cp)
71 while ((ch = *cp)) {
74 cp++;
75 if (*cp == '\0')
77 cp++;
82 cp++;
84 return cp;
137 static int parse_start(char **cp)
141 p = strip_line(*cp);
153 *cp = p;
164 static int parse_end(char **cp)
166 *cp = skip_over_blank(*cp);
168 if (!strncmp(*cp, "</device>", 9)) {
169 DBG(DEBUG_READ, printf("found device trailer %9s\n", *cp));
170 *cp += 9;
183 static int parse_dev(blkid_cache cache, blkid_dev *dev, char **cp)
188 if ((ret = parse_start(cp)) <= 0)
191 start = tmp = strchr(*cp, '>');
194 printf("blkid: short line parsing dev: %s\n", *cp));
203 if (**cp == '>')
204 *cp = end;
206 (*cp)++;
217 DBG(DEBUG_READ, printf("blkid: empty device name: %s\n", *cp));
239 static int parse_token(char **name, char **value, char **cp)
243 if (!name || !value || !cp)
246 if (!(*value = strchr(*cp, '=')))
250 *name = strip_line(*cp);
258 *cp = *value;
271 *cp = end;
280 static int parse_xml(char **name, char **value, char **cp)
284 if (!name || !value || !cp)
287 *name = strip_line(*cp);
303 static int parse_tag(blkid_cache cache, blkid_dev dev, char **cp)
312 if ((ret = parse_token(&name, &value, cp)) <= 0 /* &&
313 (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) {