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