gbasys
diff src/signal.h @ 0:875ef6085efc
gbasys mercurial repository
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 04 Mar 2012 04:04:25 +0200 |
parents | |
children | e3dc7705ad9c |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/signal.h Sun Mar 04 04:04:25 2012 +0200 1.3 @@ -0,0 +1,71 @@ 1.4 +/* 1.5 +Copyright 2004 John Tsiombikas <nuclear@siggraph.org> 1.6 + 1.7 +This file is part of libgba, a library for GameBoy Advance development. 1.8 + 1.9 +This program is free software; you can redistribute it and/or modify 1.10 +it under the terms of the GNU General Public License as published by 1.11 +the Free Software Foundation; either version 2 of the License, or 1.12 +(at your option) any later version. 1.13 + 1.14 +This program is distributed in the hope that it will be useful, 1.15 +but WITHOUT ANY WARRANTY; without even the implied warranty of 1.16 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1.17 +GNU General Public License for more details. 1.18 + 1.19 +You should have received a copy of the GNU General Public License 1.20 +along with this program; if not, write to the Free Software 1.21 +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 1.22 +*/ 1.23 + 1.24 +typedef void (*sighandler_t)(int); 1.25 + 1.26 +#define SIG_ERR ((sighandler_t)-1) /* Error return. */ 1.27 +#define SIG_DFL ((sighandler_t)0) /* Default action. */ 1.28 +#define SIG_IGN ((sighandler_t)1) /* Ignore signal. */ 1.29 + 1.30 +/* Signals. */ 1.31 +#define SIGHUP 1 /* Hangup (POSIX). */ 1.32 +#define SIGINT 2 /* Interrupt (ANSI). */ 1.33 +#define SIGQUIT 3 /* Quit (POSIX). */ 1.34 +#define SIGILL 4 /* Illegal instruction (ANSI). */ 1.35 +#define SIGTRAP 5 /* Trace trap (POSIX). */ 1.36 +#define SIGABRT 6 /* Abort (ANSI). */ 1.37 +#define SIGIOT 6 /* IOT trap (4.2 BSD). */ 1.38 +#define SIGBUS 7 /* BUS error (4.2 BSD). */ 1.39 +#define SIGFPE 8 /* Floating-point exception (ANSI). */ 1.40 +#define SIGKILL 9 /* Kill, unblockable (POSIX). */ 1.41 +#define SIGUSR1 10 /* User-defined signal 1 (POSIX). */ 1.42 +#define SIGSEGV 11 /* Segmentation violation (ANSI). */ 1.43 +#define SIGUSR2 12 /* User-defined signal 2 (POSIX). */ 1.44 +#define SIGPIPE 13 /* Broken pipe (POSIX). */ 1.45 +#define SIGALRM 14 /* Alarm clock (POSIX). */ 1.46 +#define SIGTERM 15 /* Termination (ANSI). */ 1.47 +#define SIGSTKFLT 16 /* Stack fault. */ 1.48 +#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ 1.49 +#define SIGCHLD 17 /* Child status has changed (POSIX). */ 1.50 +#define SIGCONT 18 /* Continue (POSIX). */ 1.51 +#define SIGSTOP 19 /* Stop, unblockable (POSIX). */ 1.52 +#define SIGTSTP 20 /* Keyboard stop (POSIX). */ 1.53 +#define SIGTTIN 21 /* Background read from tty (POSIX). */ 1.54 +#define SIGTTOU 22 /* Background write to tty (POSIX). */ 1.55 +#define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */ 1.56 +#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ 1.57 +#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ 1.58 +#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ 1.59 +#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ 1.60 +#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ 1.61 +#define SIGPOLL SIGIO /* Pollable event occurred (System V). */ 1.62 +#define SIGIO 29 /* I/O now possible (4.2 BSD). */ 1.63 +#define SIGPWR 30 /* Power failure restart (System V). */ 1.64 +#define SIGSYS 31 /* Bad system call. */ 1.65 +#define SIGUNUSED 31 1.66 + 1.67 +#define SIG_MAX 32 1.68 + 1.69 +sighandler_t signal(int signum, sighandler_t handler); 1.70 +int raise(int signum); 1.71 +int pause(void); 1.72 + 1.73 +void save_signal(int signum); 1.74 +void restore_signal(int signum);