+ // Ruby script for syntax highlighting.
+ FILE *child = popen("./highlight", "w");
+ if (child == NULL) {
+ printf("child is null: %s", strerror(errno));
+ exit(1);
+ }
+ // Give filename:
+ fprintf(child, "%s\n", filename);
+ // Give code to highlight:
+ int lc;
+ size_t i;
+ for (i = 0; *s && i < len; s++, i++) {
+ if (*s == '\n') lc++;
+ fprintf(child, "%c", *s);
+ }
+
+ // Write returned HTML to the HTML file.
+ char c;
+ while ((c = fgetc(child)) != EOF)
+ fprintf(fp, "%c", c);
+
+ pclose(child);
+ return lc;
+}
+
+int
+writeblobhtml(const char *filename, FILE *fp, const git_blob *blob)
+{
+ int lc = 0;