aboutsummaryrefslogtreecommitdiffhomepage
path: root/signal.h
blob: 91bddc920939e7a7e9294ffca0aacd6dc6dd61cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/** \file signal.h

The library for various signal related issues

*/
#ifndef FISH_SIGNALH
#define FISH_SIGNALH

/**
   Get the integer signal value representing the specified signal, or
   -1 of no signal was found
*/
int wcs2sig( const wchar_t *str );

/**
   Get string representation of a signal
*/
const wchar_t *sig2wcs( int sig );

/**
   Returns a description of the specified signal.
*/
const wchar_t *signal_get_desc( int sig );

/**
   Set all signal handlers to SIG_DFL
*/
void signal_reset_handlers();

/**
   Set signal handlers to fish default handlers
*/
void signal_set_handlers();

/**
   Tell fish what to do on the specified signal.

   \param sig The signal to specify the action of
   \param do_handle If true fish will catch the specified signal and fire an event, otherwise the default action (SIG_DFL) will be set
*/
void signal_handle( int sig, int do_handle );

/**
  Block all signals
*/
void signal_block();

/**
   Unblock all signals
*/
void signal_unblock();

/**
   Returns true if signals are being blocked
*/
int signal_is_blocked();

#endif