Safe API Framework
0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Toggle main menu visibility
Loading...
Searching...
No Matches
rte_safety_violation.c
Go to the documentation of this file.
1
6
#include "
rte/utils/safestate/rte_safety_violation.h
"
7
8
static
rte_safety_violation_handler_t
s_handler = NULL;
9
10
rte_status_t
rte_safety_violation_register_handler
(
rte_safety_violation_handler_t
handler)
11
{
12
if
(handler == NULL)
13
{
14
return
RTE_STATUS_INVALID_PARAM
;
15
}
16
s_handler = handler;
17
return
RTE_STATUS_OK
;
18
}
19
20
void
rte_safety_violation_report
(
rte_safety_violation_kind_t
kind,
21
const
char
*file,
22
int32_t line,
23
const
char
*message)
24
{
25
if
(s_handler == NULL)
26
{
27
return
;
28
}
29
s_handler(kind, file, line, message);
30
}
rte_safety_violation_handler_t
void(*) rte_safety_violation_handler_t(rte_safety_violation_kind_t kind, const char *file, int32_t line, const char *message)
Handler invoked by rte_safety_violation_report().
Definition
rte_safety_violation.h:99
rte_safety_violation_kind_t
rte_safety_violation_kind_t
Which safety primitive detected the violation.
Definition
rte_safety_violation.h:66
rte_safety_violation_report
void rte_safety_violation_report(rte_safety_violation_kind_t kind, const char *file, int32_t line, const char *message)
Reports one violation to the registered handler, if any.
Definition
rte_safety_violation.c:20
rte_safety_violation_register_handler
rte_status_t rte_safety_violation_register_handler(rte_safety_violation_handler_t handler)
Registers the single handler invoked by rte_safety_violation_report(). Registering again replaces the...
Definition
rte_safety_violation.c:10
rte_status_t
rte_status_t
Common result/status codes.
Definition
rte_status.h:27
RTE_STATUS_OK
@ RTE_STATUS_OK
Definition
rte_status.h:28
RTE_STATUS_INVALID_PARAM
@ RTE_STATUS_INVALID_PARAM
Definition
rte_status.h:29
rte_safety_violation.h
Opt-in notification hook for the three new safety primitives (safe pointer, checked integer arithmeti...
src
utils
safestate
rte_safety_violation.c
Generated by
1.18.0