Files
hakorune/include/nyrt.h

34 lines
838 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef NYRT_H
#define NYRT_H
#ifdef __cplusplus
extern "C" {
#endif
// Phase 20.36/20.37: CABI scaffold (PoC)
// Minimal kernel API for Rust runtime; subject to evolution.
// Initialize NyRT kernel. Returns 0 on success.
int nyrt_init(void);
// Tear down NyRT kernel.
void nyrt_teardown(void);
// Load MIR(JSON v1) text. Returns a handle (>=1) or 0 on error.
unsigned long nyrt_load_mir_json(const char* json_text);
// Execute main() of the loaded module. Returns processlike rc (0..255).
int nyrt_exec_main(unsigned long module_handle);
// Hostcall bridge (name = "env.*" / provider). Returns 0 on success.
int nyrt_hostcall(const char* name, const char* method,
const char* payload_json,
/*out*/ char* out_buf, unsigned int out_buf_len);
#ifdef __cplusplus
}
#endif
#endif // NYRT_H