|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
MRTKLIB Context — runtime context for processing, trace, and error handling. More...
#include <stdint.h>#include <stdio.h>Go to the source code of this file.
Classes | |
| struct | mrtk_ctx_t |
| Runtime context for MRTKLIB processing. More... | |
Typedefs | |
| typedef void(* | mrtk_showmsg_cb_t) (const char *msg) |
| Message display callback (for GUI/app-level status messages). | |
Enumerations | |
| enum | mrtk_err_t { MRTK_OK = 0 , MRTK_ERR_VALUE = -1 , MRTK_ERR_IO = -2 , MRTK_ERR_MEMORY = -3 , MRTK_ERR_FORMAT = -4 , MRTK_ERR_CANCEL = -5 } |
| Error code enumeration for MRTKLIB functions. More... | |
Functions | |
| mrtk_ctx_t * | mrtk_ctx_create (void) |
| Create a new runtime context. | |
| void | mrtk_ctx_destroy (mrtk_ctx_t *ctx) |
| Destroy a runtime context. | |
Variables | |
| mrtk_ctx_t * | g_mrtk_ctx |
| Global context pointer for transitional migration. | |
MRTKLIB Context — runtime context for processing, trace, and error handling.
This header defines the non-opaque runtime context structure that replaces global variables for trace output, error state, and processing control. All trace functions and major processing pipeline functions accept a pointer to this context as their first argument.
Definition in file mrtk_context.h.
| typedef void(* mrtk_showmsg_cb_t) (const char *msg) |
Message display callback (for GUI/app-level status messages).
| [in] | msg | Null-terminated message string |
Definition at line 59 of file mrtk_context.h.
| enum mrtk_err_t |
Error code enumeration for MRTKLIB functions.
Definition at line 42 of file mrtk_context.h.
| mrtk_ctx_t * mrtk_ctx_create | ( | void | ) |
Create a new runtime context.
Allocates and zero-initialises a context. Default settings:
Definition at line 31 of file mrtk_context.c.
References calloc, mrtk_ctx_t::cancel_requested, mrtk_ctx_t::cb_showmsg, mrtk_ctx_t::is_running, mrtk_ctx_t::last_err_code, mrtk_ctx_t::last_err_msg, MRTK_OK, mrtk_ctx_t::tick_trace, mrtk_ctx_t::trace_fp, mrtk_ctx_t::trace_level, and mrtk_ctx_t::user_data.
| void mrtk_ctx_destroy | ( | mrtk_ctx_t * | ctx | ) |
Destroy a runtime context.
Closes the trace file (unless stdout/stderr) and frees memory. Safe to call with NULL.
| [in] | ctx | Context to destroy, or NULL (no-op) |
Definition at line 50 of file mrtk_context.c.
References free, and mrtk_ctx_t::trace_fp.
|
extern |
Global context pointer for transitional migration.
Functions that have not yet received an explicit ctx parameter use this global as a fallback. Applications should set this at startup and clear it at shutdown.
Definition at line 25 of file mrtk_context.c.
Referenced by rtksvrstart().