Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
sapi_types.h File Reference

Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see ADR-001, section 3.4). More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for sapi_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SAFEAPI_STORAGE_ALIGN   8U
 Alignment (bytes) guaranteed for every opaque storage block.
#define SAFEAPI_ALIGNED_(n)
 Portable alignment specifier used ahead of a storage byte array (e.g. in SAFEAPI_DECLARE_STORAGE) so its address is suitable for the backend's internal struct layout. Expands to the best available mechanism for the compiler (C11 _Alignas, MSVC declspec, or GCC/Clang __attribute); expands to nothing on compilers with no portable alignment control.
#define SAFEAPI_DECLARE_STORAGE(type_name, byte_size)
 Declares an opaque, fixed-size, aligned storage type for a service's handle. The real internal layout is private to the backend implementation; callers only reserve the bytes.

Typedefs

typedef uint32_t sapi_duration_ms_t
typedef uint64_t sapi_timestamp_ms_t

Detailed Description

Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see ADR-001, section 3.4).

No dynamic memory allocation is used by the framework after initialization (REQ-OAL-COMMON-010). Every stateful object is created from storage supplied by the caller, typically a statically allocated struct.

Definition in file sapi_types.h.