2 * Read a Wiki history file.
3 * It's a title line then a sequence of Wiki files separated by headers.
21 Brdwline(void *vb, int sep)
28 if(p = Brdline(b, sep))
29 p[Blinelen(b)-1] = '\0';
40 int i, current, conflict, c, n;
41 char *author, *comment, *p, *title;
46 if((p = Brdline(b, '\n')) == nil){
47 werrstr("short read: %r");
51 p[Blinelen(b)-1] = '\0';
52 p = strcondense(p, 1);
62 while((c = Bgetc(b)) != Beof){
67 p[Blinelen(b)-1] = '\0';
71 t = strtoul(p, 0, 10);
87 w = erealloc(w, (n+8)*sizeof(w[0]));
90 w[n].comment = comment;
93 w[n].wtxt = Brdpage(Brdwline, b);
94 w[n].conflict = conflict;
109 h = emalloc(sizeof *h);
113 h->current = current;
115 setmalloctag(h, getcallerpc(&b));