Shared application_settings.ini discovery with module-owned extra keys. More...


Go to the source code of this file.
Data Structures | |
| struct | inference_settings |
| Per-application configuration; all resolved paths belong to this caller-owned value. More... | |
Macros | |
| #define | INFERENCE_PATH_CAPACITY 4096U |
Enumerations | |
| enum | inference_backend { INFERENCE_NATIVE , INFERENCE_ONNX , INFERENCE_IMX500 , INFERENCE_AUTO } |
| Backend selection; AUTO resolves the model suffix, never an execution error. More... | |
| enum | inference_source { INFERENCE_LIVE , INFERENCE_IMAGE , INFERENCE_FAKE } |
| Acquisition choice, deliberately independent of the inference backend. More... | |
Functions | |
| void | inference_settings_init (struct inference_settings *settings, enum inference_backend backend) |
| Reset storage and select conservative thread/timeout defaults. | |
| int | inference_settings_field (struct inference_settings *settings, const char *key, const char *value) |
| Parse one common key without consuming module-specific keys. | |
| bool | inference_settings_read (struct inference_settings *settings, const char *filename, ini_field_handler extra, void *context, char *error, size_t capacity) |
| Parse one flat INI, delegate application keys and resolve paths against the selected file. | |
| bool | inference_settings_find (const char *application, const char *module, char *filename, size_t capacity) |
| Discover application_settings.ini in adjacent, development-module, then installed-share order. | |
| bool | inference_resolve_path (const char *base_file, const char *value, char *destination, size_t capacity) |
| Resolve an INI-relative path without requiring its destination to exist yet. | |
Detailed Description
Shared application_settings.ini discovery with module-owned extra keys.
Definition in file inference_settings.h.
Macro Definition Documentation
◆ INFERENCE_PATH_CAPACITY
| #define INFERENCE_PATH_CAPACITY 4096U |
Definition at line 31 of file inference_settings.h.
Enumeration Type Documentation
◆ inference_backend
| enum inference_backend |
Backend selection; AUTO resolves the model suffix, never an execution error.
| Enumerator | |
|---|---|
| INFERENCE_NATIVE | |
| INFERENCE_ONNX | |
| INFERENCE_IMX500 | |
| INFERENCE_AUTO | |
Definition at line 34 of file inference_settings.h.
◆ inference_source
| enum inference_source |
Acquisition choice, deliberately independent of the inference backend.
| Enumerator | |
|---|---|
| INFERENCE_LIVE | |
| INFERENCE_IMAGE | |
| INFERENCE_FAKE | |
Definition at line 36 of file inference_settings.h.
Function Documentation
◆ inference_resolve_path()
| bool inference_resolve_path | ( | const char * | base_file, |
| const char * | value, | ||
| char * | destination, | ||
| size_t | capacity ) |
Resolve an INI-relative path without requiring its destination to exist yet.
- Parameters
-
base_file Settings filename whose parent supplies the relative base. value Absolute or relative path; control characters are rejected. destination Writable normalized absolute path, distinct from the inputs. capacity Destination capacity including its terminator.
- Returns
- True for a complete, nontruncated path. This is lexical normalization, not symlink resolution.
Definition at line 93 of file inference_settings.c.
◆ inference_settings_field()
| int inference_settings_field | ( | struct inference_settings * | settings, |
| const char * | key, | ||
| const char * | value ) |
Parse one common key without consuming module-specific keys.
- Parameters
-
settings Initialized destination; its seen mask rejects duplicates. key Flat key emitted by the bounded INI parser. value Nonempty parsed value; no pointer into it is retained.
- Returns
- One if accepted, zero if unknown, minus one if invalid/duplicate.
Definition at line 53 of file inference_settings.c.
◆ inference_settings_find()
| bool inference_settings_find | ( | const char * | application, |
| const char * | module, | ||
| char * | filename, | ||
| size_t | capacity ) |
Discover application_settings.ini in adjacent, development-module, then installed-share order.
Supports both bin/ application executables and the root-level USHER owner, without consulting the caller's current directory.
- Parameters
-
application Lowercase executable name without an architecture suffix. module Lowercase module directory name, such as spotter_cam. filename Destination path; meaningful only on success. capacity Available bytes in filename.
- Returns
- True after finding a regular file, never a current-directory fallback.
Definition at line 202 of file inference_settings.c.
◆ inference_settings_init()
| void inference_settings_init | ( | struct inference_settings * | settings, |
| enum inference_backend | backend ) |
Reset storage and select conservative thread/timeout defaults.
- Parameters
-
settings Writable owner, or NULL to do nothing. backend Application default used when the INI omits the backend.
Definition at line 28 of file inference_settings.c.
◆ inference_settings_read()
| bool inference_settings_read | ( | struct inference_settings * | settings, |
| const char * | filename, | ||
| ini_field_handler | extra, | ||
| void * | context, | ||
| char * | error, | ||
| size_t | capacity ) |
Parse one flat INI, delegate application keys and resolve paths against the selected file.
- Parameters
-
settings Initialized destination; discard partially parsed values on failure. filename Selected settings file, independent of the caller's current directory. extra Optional handler for application-specific fields. context Borrowed extra-handler state, used only during this call. error Writable failure diagnostic, cleared on success. capacity Available bytes in error.
- Returns
- True for valid bounded syntax, accepted fields and resolvable lexical paths.
AUTO resolves .onnx/.rpk suffixes and an omitted ONNX descriptor to the same-name .ini. It does not test availability or fall back after errors.
Definition at line 158 of file inference_settings.c.