Esempio n. 1
0
/*
 * Set up the display to start a new search command.
 */
static void
mca_search(void)
{
	if (search_type & SRCH_FILTER)
		mca = A_FILTER;
	else if (search_type & SRCH_FORW)
		mca = A_F_SEARCH;
	else
		mca = A_B_SEARCH;

	clear_bot();
	clear_cmd();

	if (search_type & SRCH_NO_MATCH)
		cmd_putstr("Non-match ");
	if (search_type & SRCH_FIRST_FILE)
		cmd_putstr("First-file ");
	if (search_type & SRCH_PAST_EOF)
		cmd_putstr("EOF-ignore ");
	if (search_type & SRCH_NO_MOVE)
		cmd_putstr("Keep-pos ");
	if (search_type & SRCH_NO_REGEX)
		cmd_putstr("Regex-off ");

	if (search_type & SRCH_FILTER)
		cmd_putstr("&/");
	else if (search_type & SRCH_FORW)
		cmd_putstr("/");
	else
		cmd_putstr("?");
	set_mlist(ml_search, 0);
}
Esempio n. 2
0
/*
 * Set up the display to start a new toggle-option command.
 */
static void
mca_opt_toggle(void)
{
	int no_prompt;
	int flag;
	char *dash;

	no_prompt = (optflag & OPT_NO_PROMPT);
	flag = (optflag & ~OPT_NO_PROMPT);
	dash = (flag == OPT_NO_TOGGLE) ? "_" : "-";

	mca = A_OPT_TOGGLE;
	clear_bot();
	clear_cmd();
	cmd_putstr(dash);
	if (optgetname)
		cmd_putstr(dash);
	if (no_prompt)
		cmd_putstr("(P)");
	switch (flag) {
	case OPT_UNSET:
		cmd_putstr("+");
		break;
	case OPT_SET:
		cmd_putstr("!");
		break;
	}
	set_mlist(NULL, 0);
}
Esempio n. 3
0
/*
 *	This routine is the command level response the mortgage command.
 * it gets the list of mortgageable property and asks which are to
 * be mortgaged.
 */
mortgage() {

	reg int	prop;

	for (;;) {
		if (set_mlist() == 0) {
			if (got_houses)
				printf("You can't mortgage property with houses on it.\n");
			else
				printf("You don't have any un-mortgaged property.\n");
			return;
		}
		if (num_good == 1) {
			printf("Your only mortageable property is %s\n",names[0]);
			if (getyn("Do you want to mortgage it? ") == 0)
				m(square[0]);
			return;
		}
		prop = getinp("Which property do you want to mortgage? ",names);
		if (prop == num_good)
			return;
		m(square[prop]);
		notify(cur_p);
	}
}
Esempio n. 4
0
/*
 * Set up the display to start a new multi-character command.
 */
static void
start_mca(int action, const char *prompt, void *mlist, int cmdflags)
{
	mca = action;
	clear_bot();
	clear_cmd();
	cmd_putstr((char *)prompt);
	set_mlist(mlist, cmdflags);
}