+ url = resolve_path(ctx, *filename, ctx->device->device_path);
+ if (!url)
+ continue;
+
+ path = load_file(ctx, url, &tempfile);
+
+ if (!path)
+ continue;
+
+ rc = read_file(ctx, path, &buf, &len);
+ if (!rc) {
+ parser->parse(ctx, buf, len);
+ talloc_free(buf);
+ }
+
+ if (tempfile)
+ unlink(path);
+
+ }
+
+}
+
+void iterate_parsers(struct discover_context *ctx)
+{
+ int i;
+
+ pb_log("trying parsers for %s\n", ctx->device->device->id);
+
+ for (i = 0; parsers[i]; i++) {
+ pb_log("\ttrying parser '%s'\n", parsers[i]->name);
+ iterate_parser_files(ctx, parsers[i]);
+ }