/**************************************************************** * Module name : view.c * * Purpose : Like TYPE but scrolls both ways * * Created : ??-??-89 * * Last edited : 24-08-89 Version 1.0 * * Copyright : G R Buckeridge * ****************************************************************/ #include stdio.h #include gb.h #define PAGE_LEN 30 #define MAXINT 32767 main(argc,argv) int argc; char *argv[]; { FAST char argv_buffer[MAXARGS * 2 +132]; FILE *in; FAST char ln[100],ll[100],*p,last; int count,i,s,f,k,c,THIS_PAGE; count=0; cpm_cmd_line (&argc,&argv,argv_buffer); /* for reading command line */ if (argc<2 || argc>3) { help(); exit(0); } in=fopen(argv[1],"r"); if (in == NULL) { printf("Can't open file %s\n",argv[1]); exit(0); } THIS_PAGE=PAGE_LEN; if (!(c=strcmp(argv[2],"P"))) { pron(); THIS_PAGE=MAXINT; } loop: s=1; f=strcmp(argv[2],"C") ? THIS_PAGE : MAXINT; for (i=s;i>0 ) fprintf(LST,"\n"); proff(); } fclose(in); } void help() { printf("\nVIEW.COM - Like TYPE but scrolls in both directions\n\n"); printf(" VIEW lists to vdu with prompts\n"); printf(" VIEW C lists to vdu continuously\n"); printf(" VIEW P lists to printer\n\n"); printf(" ctrl_S and ctrl_Q have their normal effect\n"); printf(" Press any key to abort in 'C' or 'P' mode.\n"); } #include ?gb.lib #include ?cpm.lib #include ?stdio.lib  prin