You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/api.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -292,3 +292,33 @@ UMKA_API int umkaGetDynArrayLen(const void *array);
292
292
293
293
Returns the length of the dynamic `array` (treated as a pointer to `UmkaDynArray(T)`).
294
294
295
+
## Accessing Umka API dynamically
296
+
297
+
Using the Umka API functions generally requires linking against the Umka interpreter library. This dependency is undesirable when implementing UMIs. In such cases, the same Umka API functions can be accessed dynamically, through the Umka interpreter instance passed to UMI functions.
298
+
299
+
### Types
300
+
301
+
```
302
+
typedef struct
303
+
{
304
+
// Function pointers
305
+
} UmkaAPI;
306
+
```
307
+
308
+
A set of pointers to all Umka API functions. For any function `umkaXXXX()`, there is a corresponding field `umkaXXXX` in `UmkaAPI`.
309
+
310
+
### Functions
311
+
312
+
```
313
+
static inline UmkaAPI *umkaGetAPI(void *umka);
314
+
315
+
```
316
+
Returns Umka API function pointers. Here, `umka` is the interpreter instance handle previously initialized by calling `umkaInit()`.
0 commit comments