ch01/more01.c
void do_more(FILE *fp) {
    char line[LINELEN];
    int num_of_lines = 0;
    int reply;
    while (fgets(line, LINELEN, fp)) {
	if (num_of_lines == PAGELEN) {
	    reply = see_more();
	    if (reply == 0) break;
	    num_of_lines -= reply;
	}
	if (fputs(line, stdout) == EOF) exit(1);
	num_of_lines++;
    }
}
/**
 * read PAGELEN lines, then call see_more() for further instructions
 *
 * */
read PAGELEN lines, then call see_more() for further instructions
read PAGELEN lines then call see_more () for further instructions
void do_more(FILE *fp) {
    char line[LINELEN];
    int num_of_lines = 0;
    int reply;
    while (fgets(line, LINELEN, fp)) {
	if (num_of_lines == PAGELEN) {
	    reply = see_more();
	    if (reply == 0) break;
	    num_of_lines -= reply;
	}
	if (fputs(line, stdout) == EOF) exit(1);
	num_of_lines++;
    }
}
void do_more ( FILE * fp ) { char line [ LINELEN ] ; int num_of_lines = 0 ; int reply ; while ( fgets ( line , LINELEN , fp ) ) { if ( num_of_lines == PAGELEN ) { reply = see_more ( ) ; if ( reply == 0 ) break ; num_of_lines -= reply ; } if ( fputs ( line , stdout ) == EOF ) exit ( 1 ) ; num_of_lines ++ ; } }
read PAGELEN lines, then call see_more() for further instructions
read PAGELEN lines then call see_more () for further instructions