GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
signal-wrappers.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2016-2024 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_signal_wrappers_h)
27 #define octave_signal_wrappers_h 1
28 
29 #if ! defined (__cplusplus)
30 # include <stdbool.h>
31 #endif
32 
33 #include <sys/types.h>
34 
35 #if defined __cplusplus
36 extern "C" {
37 #endif
38 
39 typedef void octave_sig_handler (int);
40 
41 extern OCTAVE_API int octave_kill_wrapper (pid_t pid, int signum);
42 
43 extern OCTAVE_API char * octave_strsignal_wrapper (int signum);
44 
45 extern OCTAVE_API bool octave_have_kill (void);
46 
47 extern OCTAVE_API bool octave_get_sig_number (const char *signame, int *signum);
48 
51  bool restart_syscalls);
52 
54 octave_set_signal_handler_by_name (const char *signame,
55  octave_sig_handler *handler,
56  bool restart_syscalls);
57 
60 
62 octave_set_default_signal_handler_by_name (const char *signame);
63 
64 extern OCTAVE_API int octave_num_signals (void);
65 
66 extern OCTAVE_API void * octave_block_child (void);
67 
68 extern OCTAVE_API void octave_unblock_child (void *context);
69 
70 extern OCTAVE_API void octave_block_interrupt_signal (void);
71 
73 
74 extern OCTAVE_API void octave_block_signal_by_name (const char *signame);
75 
76 extern OCTAVE_API void octave_unblock_signal_by_name (const char *signame);
77 
78 extern OCTAVE_API void octave_save_signal_mask (void);
79 
80 extern OCTAVE_API void octave_restore_signal_mask (void);
81 
82 extern OCTAVE_API void * octave_alloc_signal_mask (void);
83 
84 extern OCTAVE_API void octave_free_signal_mask (void *mask);
85 
86 extern OCTAVE_API void octave_get_signal_mask (void *mask);
87 
88 extern OCTAVE_API void octave_set_signal_mask (void *mask);
89 
90 extern OCTAVE_API int octave_raise_wrapper (int signum);
91 
92 // This function can be useful for debugging.
93 
94 extern OCTAVE_API void octave_show_sigmask (const char *);
95 
96 // The next three functions are defined in cxx-signal-helpers.cc.
97 
98 extern OCTAVE_API void
100 
101 extern OCTAVE_API void octave_block_async_signals (void);
102 
103 extern OCTAVE_API void octave_unblock_async_signals (void);
104 
105 #if defined __cplusplus
106 }
107 #endif
108 
109 #endif
double signum(double x)
Definition: lo-mappers.h:229
#define OCTAVE_API
Definition: main.cc:55
void octave_save_signal_mask(void)
void octave_block_interrupt_signal(void)
void octave_create_interrupt_watcher_thread(octave_sig_handler *handler)
octave_sig_handler * octave_set_default_signal_handler(int sig)
int octave_num_signals(void)
void octave_block_signal_by_name(const char *signame)
void * octave_block_child(void)
void octave_unblock_signal_by_name(const char *signame)
char * octave_strsignal_wrapper(int signum)
void octave_set_signal_mask(void *mask)
void octave_free_signal_mask(void *mask)
bool octave_get_sig_number(const char *signame, int *signum)
void octave_get_signal_mask(void *mask)
int octave_kill_wrapper(pid_t pid, int signum)
octave_sig_handler * octave_set_default_signal_handler_by_name(const char *signame)
void octave_unblock_async_signals(void)
void octave_sig_handler(int)
void octave_restore_signal_mask(void)
void octave_unblock_interrupt_signal(void)
void octave_show_sigmask(const char *)
void octave_unblock_child(void *context)
void octave_block_async_signals(void)
bool octave_have_kill(void)
int octave_raise_wrapper(int signum)
octave_sig_handler * octave_set_signal_handler_by_name(const char *signame, octave_sig_handler *handler, bool restart_syscalls)
octave_sig_handler * octave_set_signal_handler_internal(int sig, octave_sig_handler *handler, bool restart_syscalls)
void * octave_alloc_signal_mask(void)