Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
rte_safety_violation.c
Go to the documentation of this file.
1
7
8static rte_safety_violation_handler_t s_handler = NULL;
9
11{
12 if (handler == NULL)
13 {
15 }
16 s_handler = handler;
17 return RTE_STATUS_OK;
18}
19
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}
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().
rte_safety_violation_kind_t
Which safety primitive detected the violation.
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.
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...
rte_status_t
Common result/status codes.
Definition rte_status.h:27
@ RTE_STATUS_OK
Definition rte_status.h:28
@ RTE_STATUS_INVALID_PARAM
Definition rte_status.h:29
Opt-in notification hook for the three new safety primitives (safe pointer, checked integer arithmeti...