-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathomnimcode.h
More file actions
68 lines (53 loc) · 2.05 KB
/
omnimcode.h
File metadata and controls
68 lines (53 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// omnimcode.h - C FFI Header for OMNIcode
// Generated from omnimcode-ffi Rust library
// Version: 1.0.0
#ifndef OMNIMCODE_H
#define OMNIMCODE_H
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
// ===== Types =====
/// Opaque handle to a Circuit
/// Use omnicode_circuit_new to create, omnicode_circuit_free to destroy
typedef struct OmnimcodeCircuit OmnimcodeCircuit;
/// Opaque handle to an Evolver
/// Use omnicode_evolver_new to create, omnicode_evolver_free to destroy
typedef struct OmnimcodeEvolver OmnimcodeEvolver;
// ===== Functions =====
/// Create a new circuit with given number of inputs
/// @param inputs Number of boolean inputs to the circuit
/// @return Pointer to new circuit, or NULL on error
/// @note Must be freed with omnicode_circuit_free
OmnimcodeCircuit* omnicode_circuit_new(uint32_t inputs);
/// Evaluate a circuit with given boolean inputs
/// @param circuit Valid circuit pointer
/// @param inputs Array of boolean inputs
/// @param input_count Length of inputs array
/// @return Boolean output of the circuit
bool omnicode_circuit_eval(
OmnimcodeCircuit* circuit,
const bool* inputs,
uintptr_t input_count
);
/// Free a circuit and release associated resources
/// @param circuit Pointer to circuit created with omnicode_circuit_new
/// @note After this call, circuit pointer is invalid
void omnicode_circuit_free(OmnimcodeCircuit* circuit);
/// Create a new evolver
/// @param population_size Number of circuits to evolve simultaneously
/// @return Pointer to new evolver, or NULL on error
/// @note Must be freed with omnicode_evolver_free
OmnimcodeEvolver* omnicode_evolver_new(uint32_t population_size);
/// Free an evolver and release associated resources
/// @param evolver Pointer to evolver created with omnicode_evolver_new
/// @note After this call, evolver pointer is invalid
void omnicode_evolver_free(OmnimcodeEvolver* evolver);
/// Get version string
/// @return Pointer to version string (e.g., "1.0.0")
const char* omnicode_version(void);
#ifdef __cplusplus
}
#endif
#endif // OMNIMCODE_H