NAH
2.0.16
Native Application Host - Library API Reference
Loading...
Searching...
No Matches
nah.h
Go to the documentation of this file.
1
/*
2
* NAH - Native Application Host
3
*
4
* Complete host library for composing and executing launch contracts.
5
*
6
* This header includes everything:
7
* - nah_core.h : Pure computation (types, composition, validation)
8
* - nah_json.h : JSON parsing (requires nlohmann/json)
9
* - nah_fs.h : Filesystem operations
10
* - nah_exec.h : Contract execution
11
* - nah_overrides.h: NAH_OVERRIDE_* environment variable handling
12
* - nah_host.h : High-level NahHost class
13
*
14
* For pure/embeddable usage, include only nah_core.h.
15
*
16
* ============================================================================
17
* QUICK START
18
* ============================================================================
19
*
20
* #define NAH_HOST_IMPLEMENTATION
21
* #include <nah/nah.h>
22
*
23
* auto host = nah::host::NahHost::create();
24
* int exit_code = host->executeApplication("com.example.app");
25
*
26
* Or with more control:
27
*
28
* #include <nah/nah.h>
29
*
30
* // Read inputs from files
31
* auto app_json = nah::fs::read_file("nah.json");
32
* auto host_json = nah::fs::read_file("/nah/host/host.json");
33
* auto install_json = nah::fs::read_file("/nah/registry/apps/myapp.json");
34
*
35
* // Parse
36
* auto app = nah::json::parse_app_declaration(*app_json);
37
* auto host_env = nah::json::parse_host_environment(*host_json);
38
* auto install = nah::json::parse_install_record(*install_json);
39
*
40
* // Load inventory
41
* auto inventory = nah::fs::load_inventory_from_directory("/nah/registry/naks");
42
*
43
* // Compose
44
* auto result = nah::core::nah_compose(
45
* app.value, host_env.value, install.value, inventory);
46
*
47
* // Execute
48
* if (result.ok) {
49
* nah::exec::execute(result.contract);
50
* }
51
*
52
* ============================================================================
53
* SPDX-License-Identifier: Apache-2.0
54
* ============================================================================
55
*/
56
57
#ifndef NAH_H
58
#define NAH_H
59
60
// Core: Pure computation (no dependencies)
61
#include "
nah_core.h
"
62
63
// Semver: Semantic versioning support
64
#include "
nah_semver.h
"
65
66
// JSON: Parsing and serialization (requires nlohmann/json)
67
#include "
nah_json.h
"
68
69
// Overrides: NAH_OVERRIDE_* parsing and application (requires nlohmann/json)
70
#include "
nah_overrides.h
"
71
72
// Filesystem: File operations (requires C++17 <filesystem>)
73
#include "
nah_fs.h
"
74
75
// Execution: Process spawning (platform-specific)
76
#include "
nah_exec.h
"
77
78
// Host: High-level API for managing a NAH root
79
#include "
nah_host.h
"
80
81
#endif
// NAH_H
nah_core.h
nah_exec.h
nah_fs.h
nah_host.h
nah_json.h
nah_overrides.h
nah_semver.h
include
nah
nah.h
Generated by
1.9.8