Esempio n. 1
0
/*
 * Read one character from the terminal
 */
int scr_getc(int delay)
{
	unsigned char buf;

	scr_flush();

	buf = '\0';
	if (!read (0, &buf, 1))
		logoff(NULL, 3);

	lines_printed = 0;
	return buf;
}
Esempio n. 2
0
void progress(CtdlIPC* ipc, unsigned long curr, unsigned long cmax)
{
	static char dots[] =
		"**************************************************";
	char dots_printed[51];
	char fmt[42];
	unsigned long a;

	if (curr >= cmax) {
		scr_printf("\r%79s\r","");
	} else {
		/* a will be range 0-50 rather than 0-100 */
		a=(curr * 50) / cmax;
		sprintf(fmt, "[%%s%%%lds] %%3ld%%%% %%10ld/%%10ld\r", 50 - a);
		strncpy(dots_printed, dots, a);
		dots_printed[a] = 0;
		scr_printf(fmt, dots_printed, "",
				curr * 100 / cmax, curr, cmax);
		scr_flush();
	}
}
Esempio n. 3
0
/*
 * Display a 3270-style "wait" indicator at the bottom of the screen
 */
void scr_wait_indicator(int state) {
	int sp = (screenwidth - 2);

	if (!enable_status_line) return;

	if (screenwidth > 0) {
		switch (state) {
			default:
			case 0:	 /* Idle */
				status_line[sp] = ' ';
				break;
			case 1:	 /* Waiting */
				status_line[sp] = 'X';
				break;
			case 2:	 /* Receiving */
				status_line[sp] = '<';
				break;
			case 3:	 /* Sending */
				status_line[sp] = '>';
				break;
		}
		scr_flush();
	}
}