Example #1
0
File: pager.c Project: tamentis/mdp
/*
 * 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();
}
Example #2
0
File: main.c Project: pbleser/mdp
void
cleanup(void)
{
	debug("atexit_cleanup");

	if (tmp_path[0] != '\0' && unlink(tmp_path) != 0)
		err(1, "WARNING: unable to remove '%s'", tmp_path);

	lock_unset();

	/* Just in case we error'd out somewhere during the pager. */
	shutdown_curses();
}
Example #3
0
File: pager.c Project: wujiang/mdp
/*
 * 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;
}