Initial LinuxCNC WebAssembly workspace snapshot
This commit is contained in:
34
wasm-core/include/sim_api.h
Normal file
34
wasm-core/include/sim_api.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef LINUXCNC_WEB_WASM_SIM_API_H
|
||||
#define LINUXCNC_WEB_WASM_SIM_API_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum sim_result {
|
||||
SIM_OK = 0,
|
||||
SIM_ERR_INVALID_ARGUMENT = -1,
|
||||
SIM_ERR_NOT_CREATED = -2,
|
||||
SIM_ERR_BUFFER_TOO_SMALL = -3,
|
||||
SIM_ERR_INVALID_STATE = -4,
|
||||
SIM_ERR_UNSUPPORTED = -5,
|
||||
};
|
||||
|
||||
/* Bootstrap ABI only. LinuxCNC behavior is added behind this stable boundary. */
|
||||
int32_t sim_create(const uint8_t *config, uint32_t config_len);
|
||||
int32_t sim_load_workspace(const char *root_path);
|
||||
int32_t sim_command(const uint8_t *command, uint32_t command_len);
|
||||
int32_t sim_step(uint32_t cycles);
|
||||
uint32_t sim_read_snapshot(uint8_t *out, uint32_t capacity);
|
||||
uint32_t sim_read_event(uint8_t *out, uint32_t capacity);
|
||||
int32_t sim_export_state(uint8_t *out, uint32_t capacity);
|
||||
int32_t sim_import_state(const uint8_t *data, uint32_t len);
|
||||
void sim_destroy(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user