home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
SHOW.ZIP
/
SHOW.C
< prev
next >
Wrap
Text File
|
1991-06-24
|
2KB
|
65 lines
#include <stdio.h>
#include <string.h>
int fp=1,ix,iy,max;
FILE *fip;
char inbuf[80];
char fns[50][80];
int main(int argc, char *argv[])
{
if ( 2>argc ) return printf("please specify the file of file names\n");
for ( fp=max=1 ; argc>fp ; fp++ )
{
fip=fopen(argv[fp],"r");
if ( NULL==fip ) printf("input file %s failed to open\n",argv[fp]);
else
{
while ( fgets(inbuf,80,fip) )
{
for ( ix=0 ; ' '==inbuf[ix] ; ix++ )
;
for ( iy=0 ; inbuf[ix] ; ix++,iy++ )
{
if ( 'a'<=inbuf[ix] && 'z'>=inbuf[ix] ) inbuf[ix]&='\xdf';
if ( '\n'==inbuf[ix] )
{
fns[max][iy]='\0';
break;
}
fns[max][iy]=inbuf[ix];
}
if ( strlen(fns[max]) ) max++;
if ( 50==max )
{
printf("number of files exceeded, set to maximum (50) \n");
break;
}
}
fclose(fip);
}
}
for ( fp=1 ; fp ; )
{
fip=fopen(fns[fp],"r");
if ( NULL==fip ) printf("Input file %s failed to open\n",fns[fp]);
else
{
ix=0;
while ( fgets(inbuf,80,fip) )
{
printf("%s",inbuf);
ix++;
}
fclose(fip);
for ( ; ix<24 ; ix++ ) printf("\n");
}
fgets(inbuf,20,stdin);
if ( '+'==inbuf[0] && max>(fp+1) ) fp++;
if ( '-'==inbuf[0] && 1<fp ) fp--;
if ( 'Q'==inbuf[0] || 'q'==inbuf[0] ) fp=0;
}
return 0;
}