1 /*
2  * Signal handling functions
3  *
4  * Copyright (C) 2011-2021, Joachim Metz <joachim.metz@gmail.com>
5  *
6  * Refer to AUTHORS for acknowledgements.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #if !defined( _EVTTOOLS_SIGNAL_H )
23 #define _EVTTOOLS_SIGNAL_H
24 
25 #include <common.h>
26 #include <types.h>
27 
28 #include "evttools_libcerror.h"
29 
30 #if defined( __cplusplus )
31 extern "C" {
32 #endif
33 
34 #if !defined( HAVE_SIGNAL_H ) && !defined( WINAPI )
35 #error missing signal functions
36 #endif
37 
38 #if defined( WINAPI )
39 typedef unsigned long evttools_signal_t;
40 
41 #else
42 typedef int evttools_signal_t;
43 
44 #endif /* defined( WINAPI ) */
45 
46 #if defined( WINAPI )
47 
48 BOOL WINAPI evttools_signal_handler(
49              evttools_signal_t signal );
50 
51 #if defined( _MSC_VER )
52 
53 void evttools_signal_initialize_memory_debug(
54       void );
55 
56 #endif /* defined( _MSC_VER ) */
57 
58 #endif /* defined( WINAPI ) */
59 
60 int evttools_signal_attach(
61      void (*signal_handler)( evttools_signal_t ),
62      libcerror_error_t **error );
63 
64 int evttools_signal_detach(
65      libcerror_error_t **error );
66 
67 #if defined( __cplusplus )
68 }
69 #endif
70 
71 #endif /* !defined( _EVTTOOLS_SIGNAL_H ) */
72 
73