1 /* $MirOS: contrib/code/jupp/termidx.c,v 1.5 2014/03/04 23:04:12 tg Exp $ */
3 * Program to generate termcap index file
5 * (C) 1992 Joseph H. Allen
7 * This file is part of JOE (Joe's Own Editor)
15 static void gen(unsigned char *s, FILE *fd)
18 off_t addr = 0, oaddr;
21 while (c = getc(fd), c == ' ' || c == '\t' || c == '#')
24 } while (!(c == -1 || c == '\n'));
31 addr = ftello(fd) - 1;
40 if (c == -1 || c == '\n') {
41 if (x != 0 && s[x - 1] == '\\')
50 for (y = z; s[y] && s[y] != '|' && s[y] != ':'; ++y) ;
53 if (strlen((char *)(s + z)) > 2 && !strchr((char *)(s + z), ' ') && !strchr((char *)(s + z), '\t')) {
56 fputs((char *)(s + z), stdout);
61 } while (c && c != ':');
64 (unsigned long)(addr - oaddr));
74 int main(int argc, char *argv[])
76 unsigned char array[65536];