|
Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
Fixed-width types and the caller-owned-storage handle pattern. More...
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 |
Fixed-width types and the caller-owned-storage handle pattern.
| #define SAFEAPI_STORAGE_ALIGN 8U |
Alignment (bytes) guaranteed for every opaque storage block.
Definition at line 36 of file sapi_types.h.
| #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.
| n | Requested alignment in bytes. |
Definition at line 58 of file sapi_types.h.
| #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.
Usage: SAFEAPI_DECLARE_STORAGE(sapi_timer_storage_t, 64U);
Definition at line 69 of file sapi_types.h.
| typedef uint32_t sapi_duration_ms_t |
Milliseconds, used by all timer/deadline related APIs.
Definition at line 27 of file sapi_types.h.
| typedef uint64_t sapi_timestamp_ms_t |
Monotonic timestamp in milliseconds since an arbitrary epoch.
Definition at line 30 of file sapi_types.h.