+void scan_projects(const char *path, const char *projectsfile, repo_config_fn fn)
+{
+ struct strbuf line = STRBUF_INIT;
+ FILE *projects;
+ int err;
+
+ projects = fopen(projectsfile, "r");
+ if (!projects) {
+ fprintf(stderr, "Error opening projectsfile %s: %s (%d)\n",
+ projectsfile, strerror(errno), errno);
+ return;
+ }
+ while (strbuf_getline(&line, projects, '\n') != EOF) {
+ if (!line.len)
+ continue;
+ strbuf_insert(&line, 0, "/", 1);
+ strbuf_insert(&line, 0, path, strlen(path));
+ scan_path(path, line.buf, fn);
+ }
+ if ((err = ferror(projects))) {
+ fprintf(stderr, "Error reading from projectsfile %s: %s (%d)\n",
+ projectsfile, strerror(err), err);
+ }
+ fclose(projects);
+ strbuf_release(&line);
+}
+
+void scan_tree(const char *path, repo_config_fn fn)