FreeBSD/sys/ddb/db_output.c
/*
 * A simple paging callout function.  It supports several simple more(1)-like
 * commands as well as a quit command that sets db_pager_quit which db
 * commands can poll to see if they should terminate early.
 */
A simple paging callout function.  It supports several simple more(1)-like
commands as well as a quit command that sets db_pager_quit which db
commands can poll to see if they should terminate early.
A simple paging callout function . It supports several simple more ( 1 ) - like commands as well as a quit command that sets db_pager_quit which db commands can poll to see if they should terminate early .
void
db_pager(void)
{
	int c, done;
	db_capture_enterpager();
	db_printf("--More--\r");
	done = 0;
	while (!done) {
		c = cngetc();
		switch (c) {
		case 'e':
		case 'j':
		case '\n':
			db_maxlines = 1;
			done++;
			break;
		case 'd':
			db_maxlines = db_lines_per_page / 2;
			done++;
			break;
		case 'f':
		case ' ':
			db_maxlines = db_lines_per_page;
			done++;
			break;
		case 'q':
		case 'Q':
		case 'x':
		case 'X':
			db_maxlines = 0;
			db_pager_quit = 1;
			done++;
			break;
#if 0
		default:
			cnputc('\007');
#endif
		}
	}
	db_printf("        ");
	db_force_whitespace();
	db_printf("\r");
	db_newlines = 0;
	db_capture_exitpager();
}
void db_pager ( void ) { int c , done ; db_capture_enterpager ( ) ; db_printf ( " \r " ) ; done = 0 ; while ( ! done ) { c = cngetc ( ) ; switch ( c ) { case ' ' : case ' ' : case ' \n ' : db_maxlines = 1 ; done ++ ; break ; case ' ' : db_maxlines = db_lines_per_page / 2 ; done ++ ; break ; case ' ' : case ' ' : db_maxlines = db_lines_per_page ; done ++ ; break ; case ' ' : case ' ' : case ' ' : case ' ' : db_maxlines = 0 ; db_pager_quit = 1 ; done ++ ; break ; #if 0 default : cnputc ( ' \007 ' ) ; #endif } } db_printf ( " " ) ; db_force_whitespace ( ) ; db_printf ( " \r " ) ; db_newlines = 0 ; db_capture_exitpager ( ) ; }
A simple paging callout function.
A simple paging callout function .
/* Just one more line. */ /* Half a page. */ /* Another page. */ /* Quit */ /* FALLTHROUGH */