diff options
author | Paul Oliver <contact@pauloliver.dev> | 2024-02-29 02:29:13 +0100 |
---|---|---|
committer | Paul Oliver <contact@pauloliver.dev> | 2024-02-29 02:29:13 +0100 |
commit | ca118555214a176728b9aab87849391344306d6d (patch) | |
tree | 833cffdd4066a7114b1d79d6eeaa2e0152408fc8 /include/salis.h |
Initial commit.
Diffstat (limited to 'include/salis.h')
-rw-r--r-- | include/salis.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/include/salis.h b/include/salis.h new file mode 100644 index 0000000..8b261b1 --- /dev/null +++ b/include/salis.h @@ -0,0 +1,67 @@ +/** +* @file salis.h +* @author Paul Oliver +* +* Main header file for the Salis library. Loading this header imports all API +* modules and functions. It may be loaded from C or C++. +*/ + +#ifndef SALIS_H +#define SALIS_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include <types.h> +#include <instset.h> +#include <memory.h> +#include <evolver.h> +#include <common.h> +#include <process.h> + +/** Initialize Salis simulation. +* @param order Order of memory (memory_size == 1 << order) +* @param pipe Desired path and file name of common pipe +*/ +SALIS_API void sal_main_init(uint32 order, string pipe); + +/** Free resources and quit Salis. +*/ +SALIS_API void sal_main_quit(void); + +/** Load existing Salis simulation from saved file. +* @param file_name Path of the save file to be loaded +* @param pipe Desired path and file name of common pipe +*/ +SALIS_API void sal_main_load(string file_name, string pipe); + +/** Save Salis simulation to a file. +* @param file_name Path of the save file to be created +*/ +SALIS_API void sal_main_save(string file_name); + +/** Check if Salis simulation has been correctly initialized. +* @return Salis has been correctly initialized +*/ +SALIS_API boolean sal_main_is_init(void); + +/** Get current simulation cycle. +* @return Current simulation cycle +*/ +SALIS_API uint32 sal_main_get_cycle(void); + +/** Get current simulation epoch. +* @return Current simulation epoch (1 epoch == 2^32 cycles) +*/ +SALIS_API uint32 sal_main_get_epoch(void); + +/** Update simulation once. This will cycle all Salis modules and processes. +*/ +SALIS_API void sal_main_cycle(void); + +#ifdef __cplusplus + } +#endif + +#endif |