2 * This program `ol2' is a converter
3 * from a text for outline-mode of GNU Emacs to normal text.
4 * This is a filter. So, input is `stdin', output is `stdout'.
6 * Copyright 1992, Timtia Software.
8 * This program is Copyfree.
15 unsigned char depth=0, offset=1;
19 unsigned short section[255];
24 if(fgets(str, sizeof(str), stdin)==NULL) break;
26 for(d=0, cp=str; ;d++){
45 code=0xa3b0+section[0]+offset;
46 printf("%c%c %s\n", code>>8,code&0xff, cp);
50 for(i=0; i<depth-1; i++){
51 printf("%d.", section[i]+offset);
53 printf("%d %s\n", section[i]+offset, cp);
56 for(i=0; i<depth; i++){
57 printf("%d.", section[i]+offset);
61 printf("%d.", section[i]+offset);
64 printf("%d %s\n", section[i]+offset, cp);
70 for(i=0; i<depth-1; i++){
71 printf("%d.", section[i]+offset);
73 printf("%d %s\n", section[i]+offset, cp);