9 a state machine for interpreting gb.
12 gbproc(int c, Rune **r, long input_loc)
14 static enum { state0, state1 } state = state0;
20 case state0: /* idle state */
31 case state1: /* seen a font spec */
33 n = (lastc-0xA0)*100 + (c-0xA0);
37 warn("bad gb glyph %d (from 0x%x,0x%lx) near byte %ld in %s", c-0xA0, lastc, cold, input_loc, file);
47 warn("unknown gb %ld (from 0x%x,0x%lx) near byte %ld in %s", n, lastc, cold, input_loc, file);
57 gb_in(int fd, long *, struct convert *out)
68 while((n = read(fd, ibuf, sizeof ibuf)) > 0){
69 for(i = 0; i < n; i++){
70 gbproc(ibuf[i], &r, nin++);
88 gb_out(Rune *base, int n, long *)
97 for(i = 0; i < NRUNE; i++)
99 for(i = 0; i < GBMAX; i++)
105 for(i = 0; i < n; i++){
110 if(r < NRUNE && tab[r] != -1){
112 *p++ = 0xA0 + (r/100);
113 *p++ = 0xA0 + (r%100);
117 warn("rune 0x%x not in output cs", r);
126 write(1, obuf, p-obuf);