#include "config.h"#include <stdio.h>#include <signal.h>#include <slang.h>Go to the source code of this file.
Functions | |
| static void | demolib_exit (int sig) |
| static void | init_signals (void) |
| static void | exit_error_hook (char *fmt, va_list ap) |
| static int | demolib_init_terminal (int tty, int smg) |
|
|
Definition at line 12 of file demolib.c. References SLang_reset_tty(), and SLsmg_reset_smg(). Referenced by main(), main_loop(), and quit(). 00013 { 00014 SLang_reset_tty (); 00015 SLsmg_reset_smg (); 00016 00017 if (sig) 00018 { 00019 fprintf (stderr, "Exiting on signal %d\n", sig); 00020 exit (1); 00021 } 00022 exit (sig); 00023 }
|
|
||||||||||||
|
Definition at line 61 of file demolib.c. References exit_error_hook(), init_signals(), SLang_Exit_Error_Hook, SLang_init_tty(), SLkp_init(), SLsig_block_signals(), SLsig_unblock_signals(), SLsmg_init_smg(), SLtt_get_terminfo(), SLtty_set_suspend_state(), and SLutf8_enable(). Referenced by main(). 00062 { 00063 SLang_Exit_Error_Hook = exit_error_hook; 00064 00065 /* It is wise to block the occurance of display related signals while we are 00066 * initializing. 00067 */ 00068 SLsig_block_signals (); 00069 00070 SLtt_get_terminfo (); 00071 00072 /* SLkp_init assumes that SLtt_get_terminfo has been called. */ 00073 if (tty && (-1 == SLkp_init ())) 00074 { 00075 SLsig_unblock_signals (); 00076 return -1; 00077 } 00078 00079 init_signals (); 00080 00081 if (tty) SLang_init_tty (-1, 0, 1); 00082 #ifdef REAL_UNIX_SYSTEM 00083 if (tty) SLtty_set_suspend_state (1); 00084 #endif 00085 if (smg) 00086 { 00087 (void) SLutf8_enable (-1); 00088 00089 if (-1 == SLsmg_init_smg ()) 00090 { 00091 SLsig_unblock_signals (); 00092 return -1; 00093 } 00094 } 00095 00096 00097 SLsig_unblock_signals (); 00098 00099 return 0; 00100 }
|
|
||||||||||||
|
Definition at line 49 of file demolib.c. References SLang_reset_tty(), and SLsmg_reset_smg(). Referenced by demolib_init_terminal(). 00050 { 00051 SLang_reset_tty (); 00052 SLsmg_reset_smg (); 00053 00054 vfprintf (stderr, fmt, ap); 00055 fputc ('\n', stderr); 00056 exit (1); 00057 }
|
|
|
Definition at line 39 of file demolib.c. References SLsignal(). Referenced by demolib_init_terminal(). 00040 { 00041 #ifdef SIGTSTP 00042 SLsignal (SIGTSTP, sigtstp_handler); 00043 #endif 00044 #ifdef SIGINT 00045 SLsignal (SIGINT, sigint_handler); 00046 #endif 00047 }
|