Esempio n. 1
0
void tb_shutdown(void)
{
	memstream_puts(&write_buffer, funcs[T_SHOW_CURSOR]);
	memstream_puts(&write_buffer, funcs[T_SGR0]);
	memstream_puts(&write_buffer, funcs[T_CLEAR_SCREEN]);
	memstream_puts(&write_buffer, funcs[T_EXIT_CA]);
	memstream_puts(&write_buffer, funcs[T_EXIT_KEYPAD]);
	memstream_flush(&write_buffer);
	tcsetattr(out_fileno, TCSAFLUSH, &orig_tios);

	close(out);
	fclose(in);
	close(winch_fds[0]);
	close(winch_fds[1]);

	cellbuf_free(&back_buffer);
	cellbuf_free(&front_buffer);
	free_ringbuffer(&inbuf);
}
Esempio n. 2
0
void tb_shutdown()
{
	fputs(funcs[T_SHOW_CURSOR], out);
	fputs(funcs[T_SGR0], out);
	fputs(funcs[T_CLEAR_SCREEN], out);
	fputs(funcs[T_EXIT_CA], out);
	fputs(funcs[T_EXIT_KEYPAD], out);
	fflush(out);
	tcsetattr(out_fileno, TCSAFLUSH, &orig_tios);

	fclose(out);
	fclose(in);
	close(winch_fds[0]);
	close(winch_fds[1]);

	cellbuf_free(&back_buffer);
	cellbuf_free(&front_buffer);
	free_ringbuffer(&inbuf);
}