NeoMutt  2024-02-01-23-g345d7b
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
signal2.h
Go to the documentation of this file.
1
23#ifndef MUTT_MUTT_SIGNAL2_H
24#define MUTT_MUTT_SIGNAL2_H
25
26#include "config.h"
27#include <signal.h>
28#include <stdbool.h>
29
30extern volatile sig_atomic_t SigInt;
31extern volatile sig_atomic_t SigWinch;
32
40typedef void (*sig_handler_t)(int sig);
41
42void mutt_sig_allow_interrupt(bool allow);
43void mutt_sig_block(void);
44void mutt_sig_block_system(void);
45void mutt_sig_empty_handler(int sig);
46void mutt_sig_exit_handler(int sig);
47void mutt_sig_init(sig_handler_t sig_fn, sig_handler_t exit_fn, sig_handler_t segv_fn);
48void mutt_sig_unblock(void);
49void mutt_sig_unblock_system(bool restore);
50
51#endif /* MUTT_MUTT_SIGNAL2_H */
void mutt_sig_init(sig_handler_t sig_fn, sig_handler_t exit_fn, sig_handler_t segv_fn)
Initialise the signal handling.
Definition: signal.c:104
volatile sig_atomic_t SigWinch
true after SIGWINCH is received
Definition: signal.c:64
void mutt_sig_empty_handler(int sig)
Dummy signal handler.
Definition: signal.c:73
void(* sig_handler_t)(int sig)
Definition: signal2.h:40
volatile sig_atomic_t SigInt
true after SIGINT is received
Definition: signal.c:63
void mutt_sig_block_system(void)
Block signals before calling exec()
Definition: signal.c:199
void mutt_sig_block(void)
Block signals during critical operations.
Definition: signal.c:166
void mutt_sig_unblock(void)
Restore previously blocked signals.
Definition: signal.c:184
void mutt_sig_unblock_system(bool restore)
Restore previously blocked signals.
Definition: signal.c:223
void mutt_sig_allow_interrupt(bool allow)
Allow/disallow Ctrl-C (SIGINT)
Definition: signal.c:254
void mutt_sig_exit_handler(int sig)
Notify the user and shutdown gracefully.
Definition: signal.c:81