gbasys

view src/signal.h @ 2:e3dc7705ad9c

communications stuff
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 07 Mar 2012 06:11:51 +0200
parents 875ef6085efc
children 06726f0b8cd3
line source
1 /*
2 Copyright 2004 John Tsiombikas <nuclear@siggraph.org>
4 This file is part of libgba, a library for GameBoy Advance development.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
21 typedef void (*sighandler_t)(int);
23 #define SIG_ERR ((sighandler_t)-1) /* Error return. */
24 #define SIG_DFL ((sighandler_t)0) /* Default action. */
25 #define SIG_IGN ((sighandler_t)1) /* Ignore signal. */
27 /* Signals. */
28 #define SIGHUP 1 /* Hangup (POSIX). */
29 #define SIGINT 2 /* Interrupt (ANSI). */
30 #define SIGQUIT 3 /* Quit (POSIX). */
31 #define SIGILL 4 /* Illegal instruction (ANSI). */
32 #define SIGTRAP 5 /* Trace trap (POSIX). */
33 #define SIGABRT 6 /* Abort (ANSI). */
34 #define SIGIOT 6 /* IOT trap (4.2 BSD). */
35 #define SIGBUS 7 /* BUS error (4.2 BSD). */
36 #define SIGFPE 8 /* Floating-point exception (ANSI). */
37 #define SIGKILL 9 /* Kill, unblockable (POSIX). */
38 #define SIGUSR1 10 /* User-defined signal 1 (POSIX). */
39 #define SIGSEGV 11 /* Segmentation violation (ANSI). */
40 #define SIGUSR2 12 /* User-defined signal 2 (POSIX). */
41 #define SIGPIPE 13 /* Broken pipe (POSIX). */
42 #define SIGALRM 14 /* Alarm clock (POSIX). */
43 #define SIGTERM 15 /* Termination (ANSI). */
44 #define SIGSTKFLT 16 /* Stack fault. */
45 #define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
46 #define SIGCHLD 17 /* Child status has changed (POSIX). */
47 #define SIGCONT 18 /* Continue (POSIX). */
48 #define SIGSTOP 19 /* Stop, unblockable (POSIX). */
49 #define SIGTSTP 20 /* Keyboard stop (POSIX). */
50 #define SIGTTIN 21 /* Background read from tty (POSIX). */
51 #define SIGTTOU 22 /* Background write to tty (POSIX). */
52 #define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */
53 #define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */
54 #define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */
55 #define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */
56 #define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */
57 #define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */
58 #define SIGPOLL SIGIO /* Pollable event occurred (System V). */
59 #define SIGIO 29 /* I/O now possible (4.2 BSD). */
60 #define SIGPWR 30 /* Power failure restart (System V). */
61 #define SIGSYS 31 /* Bad system call. */
62 #define SIGUNUSED 31
64 #define SIG_MAX 32
66 sighandler_t signal(int signum, sighandler_t handler);
67 int raise(int signum);
68 int pause(void);
70 void save_signal(int signum);
71 void restore_signal(int signum);
72 sighandler_t signal_func(int signum);