A "native" is a C function that can be called at runtime, each native may have an associated "intrinsic", which is a function that is called during compilation.
Both are stored in a unified hash map keyed by name.
- See also
- intrinsic
◆ REDUCT_NATIVE_MAP_INITIAL
| #define REDUCT_NATIVE_MAP_INITIAL 256 |
The initial size of the native map.
Definition at line 38 of file native.h.
◆ REDUCT_NATIVE_MAP_GROWTH
| #define REDUCT_NATIVE_MAP_GROWTH 2 |
The growth factor of the native map.
Definition at line 39 of file native.h.
◆ reduct_native_global_init()
Initialize a global native state.
- Parameters
-
| global | Pointer to the global native state to initialize. |
◆ reduct_native_global_deinit()
Deinitialize a global native state.
- Parameters
-
| global | Pointer to the global native state to deinitialize. |
◆ reduct_native_map_find()
Find a native entry in the map.
- Parameters
-
| reduct | Pointer to the Reduct structure. |
| hash | The hash of the name. |
| str | The name string. |
| len | The length of the name. |
- Returns
- A pointer to the native entry, or
NULL if not found.
◆ reduct_native_register()
Register native functions.
- Parameters
-
| reduct | Pointer to the Reduct structure. |
| array | An array of native function definitions. |
| count | The number of functions in the array. |