GRASS 8 Programmer's Manual
8.6.0dev(2026)-1d1e47ad9d
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 _WIN32
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 _WIN32
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
calc.h
NULL
#define NULL
Definition
ccmath.h:32
AMI_STREAM
Definition
ami_stream.h:153
AMI_STREAM::AMI_STREAM
AMI_STREAM()
Definition
ami_stream.h:227
UNUSED
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
Definition
gis.h:46
unistd.h
lib
calc
calc.c
Generated on Fri Apr 3 2026 06:59:51 for GRASS 8 Programmer's Manual by
1.9.8