00001 /* 00002 ** Copyright (C) 2005 by Kevin L. Mitchell <klmitch@mit.edu> 00003 ** 00004 ** This program is free software; you can redistribute it and/or modify 00005 ** it under the terms of the GNU General Public License as published by 00006 ** the Free Software Foundation; either version 2 of the License, or 00007 ** (at your option) any later version. 00008 ** 00009 ** This program is distributed in the hope that it will be useful, 00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 ** GNU General Public License for more details. 00013 ** 00014 ** You should have received a copy of the GNU General Public License 00015 ** along with this program; if not, write to the Free Software 00016 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 ** 00018 ** @(#)$Id: sig.h,v 1.9 2005/12/29 04:33:58 klmitch Exp $ 00019 */ 00020 #ifndef __include_event_sig_h__ 00021 #define __include_event_sig_h__ 00022 00041 #ifndef __EVENT_LIBRARY__ 00042 # include <event/event.h> 00043 #endif /* __EVENT_LIBRARY__ */ 00044 00045 #include <signal.h> /* struct sigaction needed */ 00046 00047 EV_BEGIN_C_DECLS 00048 00053 typedef struct _ev_sig_s ev_sig_t; 00054 00060 struct _ev_sig_s { 00061 ev_genhdr_t si_hdr; 00062 struct sigaction si_oact; 00063 int si_signal; 00064 }; 00065 00070 #define EV_SIG_MAGIC 0x241dbfbd 00071 00084 #define si_verify(sig) eg_verify((sig), EV_SIG_MAGIC) 00085 00095 #define si_signal(sig) ((sig)->si_signal) 00096 00123 extern ev_err_t signal_create(ev_ctx_t *ctx, int signal, ev_call_t call, 00124 void *data, ev_sig_t **sig_p) 00125 _gca_nonnull((1)); 00126 00139 extern ev_err_t signal_destroy(ev_ctx_t *ctx, ev_sig_t *sig) 00140 _gca_nonnull((1, 2)); 00141 00142 EV_END_C_DECLS 00143 00146 #endif /* __include_event_sig_h */