Пример #1
0
/*
 * Take a finite amount of results and show them full-screen.
 *
 * If the number of results is greater than the available lines on screen,
 * display a prompt to refine the keywords.
 */
void
_pager(bool start_with_prompt)
{
	init_curses();

	for (;;) {
		clear();

		if (start_with_prompt) {
			start_with_prompt = false;
			keyword_prompt();
			filter_results();
			continue;
		}

		refresh_listing();

		/* Wait for any keystroke, a slash or a timeout. */
		if (getch() == '/') {
			keyword_prompt();
			filter_results();
			continue;
		}

		break;
	}

	shutdown_curses();
}
Пример #2
0
/*
 * Take a finite amount of results and show them full-screen.
 *
 * If the number of results is greater than the available lines on screen,
 * display a prompt to refine the keywords.
 */
int
pager()
{
	init_curses();

	while (1) {
		clear();
		refresh_listing();

		/* Wait for any keystroke, a slash or a timeout. */
		if (getch() == '/') {
			keyword_prompt();
			filter_results();
			continue;
		}

		break;
	}

	shutdown_curses();

	return MODE_EXIT;
}