GRASS GIS 8 Programmer's Manual 8.2.1(2023)-exported
calc.c
Go to the documentation of this file.
1
2#include <unistd.h>
3#include <signal.h>
4
5#include <grass/calc.h>
6
7/****************************************************************************/
8
11
13
14/****************************************************************************/
15
16static void handle_fpe(int n)
17{
20}
21
22void pre_exec(void)
23{
24#ifndef __MINGW32__
25#ifdef SIGFPE
26 struct sigaction act;
27
28 act.sa_handler = &handle_fpe;
29 act.sa_flags = 0;
30 sigemptyset(&act.sa_mask);
31
32 sigaction(SIGFPE, &act, NULL);
33#endif
34#endif
35
37}
38
39void post_exec(void)
40{
41#ifndef __MINGW32__
42#ifdef SIGFPE
43 struct sigaction act;
44
45 act.sa_handler = SIG_DFL;
46 act.sa_flags = 0;
47 sigemptyset(&act.sa_mask);
48
49 sigaction(SIGFPE, &act, NULL);
50#endif
51#endif
52}
53
54/****************************************************************************/
55
56void calc_init(int cols)
57{
58 columns = cols;
59}
60
61/****************************************************************************/
62
volatile int floating_point_exception
Definition: calc.c:9
int columns
Definition: calc.c:12
void pre_exec(void)
Definition: calc.c:22
void post_exec(void)
Definition: calc.c:39
void calc_init(int cols)
Definition: calc.c:56
volatile int floating_point_exception_occurred
Definition: calc.c:10
#define NULL
Definition: ccmath.h:32