X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=includes%2Fsignal.h;h=7123b4afb201a0f3c712d1ff1df13dbea2c3b1fb;hb=bce3bbfa01d267e2bf7f76750cc7936907bab491;hp=36b073e012ebab90e6c012ff51f292541bb26b0d;hpb=ad2651a3d8a2e2ae70a5ad882518ef346ab1bc7b;p=pdclib diff --git a/includes/signal.h b/includes/signal.h index 36b073e..7123b4a 100644 --- a/includes/signal.h +++ b/includes/signal.h @@ -1,37 +1,39 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// TODO -// ---------------------------------------------------------------------------- - -#ifndef __SIGNAL_H -#define __SIGNAL_H __SIGNAL_H - -// ---------------------------------------------------------------------------- -// MACROS - -#define SIGABRT // TODO -#define SIGFPE // TODO -#define SIGILL // TODO -#define SIGINT // TODO -#define SIGSEGV // TODO -#define SIGTERM // TODO -#define SIG_DFL // TODO -#define SIG_ERR // TODO -#define SIG_IGN // TODO - -// ---------------------------------------------------------------------------- -// TYPEDEFS - -typedef sig_atomic_t; // TODO - -// ---------------------------------------------------------------------------- -// FUNCTIONS - -int raise( int sig ); // TODO -void ( * signal( int sig, void ( *func )( int ) ) ) ( int ); // TODO - -#endif // __SIGNAL_H +/* $Id$ */ + +/* Signal handling + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#ifndef _PDCLIB_SIGNAL_H +#define _PDCLIB_SIGNAL_H _PDCLIB_SIGNAL_H + +#ifndef _PDCLIB_CONFIG_H +#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H +#include <_PDCLIB_config.h> +#endif + +typedef _PDCLIB_sig_atomic sig_atomic_t; + +#define SIG_DFL _PDCLIB_SIG_DFL +#define SIG_ERR _PDCLIB_SIG_ERR +#define SIG_IGN _PDCLIB_SIG_IGN + +#define SIGABRT _PDCLIB_SIGABRT +#define SIGFPE _PDCLIB_SIGFPE +#define SIGILL _PDCLIB_SIGILL +#define SIGINT _PDCLIB_SIGINT +#define SIGSEGV _PDCLIB_SIGSEGV +#define SIGTERM _PDCLIB_SIGTERM + +/* Returns the value of func for the most recent successful call to signal() + for the signal sig. Returns SIG_ERR and sets errno to a positive value + otherwise. +*/ +void (*signal( int sig, void (*func)( int ) ) )( int ); + +/* Returns zero if successful, nonzero otherwise. */ +int raise( int sig ); + +#endif