2 * Screen output handling
11 #include <sys/types.h>
16 #include <libcitadel.h>
18 #include "citadel_ipc.h"
19 #include "citadel_decls.h"
25 extern int screenheight;
26 extern int screenwidth;
27 extern int rc_ansi_color;
28 extern void check_screen_dims(void);
30 void do_keepalive(void);
34 * Initialize the screen
46 * Kill the screen completely (used at exit). It is safe to call this
47 * function more than once.
49 void screen_delete(void)
59 void ctdl_beep(void) {
66 * Set screen/IO parameters, e.g. at start of program or return from external
76 * Reset screen/IO parameters, e.g. at exit or fork of external program.
78 int screen_reset(void)
85 * scr_printf() outputs to the terminal
87 int scr_printf(char *fmt, ...)
92 retval = vprintf(fmt, ap);
99 * Read one character from the terminal
101 int scr_getc(int delay)
105 if (!read (0, &buf, 1))
111 * Output one character to the terminal
115 if (putc(c, stdout) == EOF)
127 static volatile int caught_sigwinch = 0;
130 * this is not supposed to be called from a signal handler.
132 int scr_set_windowsize(CtdlIPC* ipc)
138 * scr_winch() handles window size changes from SIGWINCH
139 * resizes all our windows for us
141 RETSIGTYPE scr_winch(int signum)
143 /* if we receive this signal, we must be running
144 * in a terminal that supports resizing.
149 signal(SIGWINCH, scr_winch);