Interface to define custom atoms implemented with C.
More...
|
| struct | exec_error_t |
| | Represents a status used to communicate between Grounded Atom execution and the MeTTa interpreter. More...
|
| struct | gnd_api_t |
| | A table of callback functions to implement a Grounded Atom with behavior defined in C. More...
|
| struct | gnd_t |
| | A struct header that must preface a buffer used as a backing object for a Grounded Atom. More...
|
Interface to define custom atoms implemented with C.
Providing the functions in gnd_api_t allows custom atom behaviors to be implemented using C.
◆ exec_error_free()
◆ exec_error_incorrect_argument()
Creates a new exec_error_t representing a "Incorrect Argument" status, telling the MeTTa interpreter that argument was not recognized by the function implementation.
- Returns
- The newly created exec_error_t
- Note
- The caller must take ownership responsibility for the returned exec_error_t, and ultimately free it with exec_error_free() or return it from an execute function
◆ exec_error_no_err()
Creates a new exec_error_t representing a "No Error" status. This is the default interpreter status.
- Returns
- The newly created exec_error_t
- Note
- The caller must take ownership responsibility for the returned exec_error_t, and ultimately free it with exec_error_free() or return it from an execute function
◆ exec_error_no_reduce()
Creates a new exec_error_t representing a "Don't Reduce" status, telling the MeTTa interpreter to process the atoms as they are.
- Returns
- The newly created exec_error_t
- Note
- The caller must take ownership responsibility for the returned exec_error_t, and ultimately free it with exec_error_free() or return it from an execute function
◆ exec_error_runtime()
| struct exec_error_t exec_error_runtime |
( |
const char * | message | ) |
|
Creates a new exec_error_t representing a runtime error that will halt the MeTTa interpreter.
- Parameters
-
| [in] | message | A human-readable error message, for the interpreter to propagate to the user |
- Returns
- The newly created exec_error_t
- Note
- The caller must take ownership responsibility for the returned exec_error_t, and ultimately free it with exec_error_free() or return it from an execute function
◆ throw_panic_with_message()
| void throw_panic_with_message |
( |
const char * | message | ) |
|
Used to throw panic from C Api with message to prevent panics without any info.
- Parameters
-
| [in] | message | A human-readable error message which will be used to throw a panic |
- Returns
- ()