home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_100
/
119_01
/
mlist.c
< prev
next >
Wrap
Text File
|
1984-07-13
|
768b
|
41 lines
#include bdscio.h
#define DEL1 0x1f /* C-<underbar> */
#define DEL2 0x1e /* C-<caret> */
main(argc,argv)
char **argv;
{
char ibuf[BUFSIZ];
char line[132];
int ifd, on, lcount, i;
on = i = lcount = 0;
if (argc != 2) {
printf("Usage:\nMlist infile outfile");
exit();
}
if (fopen(argv[1],ibuf) == -1){
printf ("File open error on %s",argv[1]);
exit();
}
printf ("%s",argv[1]);
while (fgets(line,ibuf) != 0){
lcount++;
if (DEL2 == line[0]){
if (on) do {
lcount++;
fputs(" \n",2);
}while (lcount <= 12);
on = 0;
}else if (DEL1 == line[0]) {
on = 1;
lcount = 0;
}else if (on){
fputs(line,2);
}
}
fclose (ibuf);
}
èMOORE at USC-ISIBèèDave SmithèèRequest: May 4 1981èDW