![]() |
Boron 2.1.0
|
The Boron Interpreter. More...
Files | |
| file | boron.h |
| The Boron programmer interface. | |
Functions | |
| void | boron_reset (UThread *ut) |
| Reset thread after exception. | |
| char * | boron_cstr (UThread *ut, const UCell *strC, UBuffer *bin) |
| Make null terminated UTF-8 string in binary buffer. | |
| char * | boron_cpath (UThread *ut, const UCell *strC, UBuffer *bin) |
| Make null terminated UTF-8 string in binary buffer. | |
| UStatus | boron_throwWord (UThread *ut, UAtom atom, UIndex stackPos) |
| Throw named exception. | |
| int | boron_catchWord (UThread *ut, UAtom atom) |
| Check if named exception was thrown. | |
| UStatus | boron_defineCFunc (UThread *ut, UIndex ctxN, const BoronCFunc *funcTable, const char *spec, int slen) |
| Add C functions to context. | |
| UEnvParameters * | boron_envParam (UEnvParameters *par) |
| Initialize UEnvParameters structure to default Boron values. | |
| UThread * | boron_makeEnv (UEnvParameters *par) |
| Make Boron environment and initial thread. | |
| void | boron_freeEnv (UThread *ut) |
| Destroy Boron environment. | |
| UStatus | boron_load (UThread *ut, const char *file, UCell *res) |
| Load block! from file and give it default bindings. | |
| void | boron_setAccessFunc (UThread *ut, int(*func)(UThread *, const char *)) |
| Set the callback function that will request security access from the user. | |
| UStatus | boron_requestAccess (UThread *ut, const char *msg,...) |
| Request user permission to access a resource. | |
| void | boron_randomSeed (UThread *ut, uint32_t seed) |
| Seed the thread RNG. | |
| uint32_t | boron_random (UThread *ut) |
| Get the next number from the thread RNG. | |
The Boron Interpreter.
| int boron_catchWord | ( | UThread * | ut, |
| UAtom | atom ) |
Check if named exception was thrown.
| atom | Exception name. |
Make null terminated UTF-8 string in binary buffer.
Any trailing slash or backslash is removed.
| strC | Valid UT_STRING or UT_FILE cell. |
| bin | Binary buffer to use. If zero, then the temporary thread binary will be used. |
Make null terminated UTF-8 string in binary buffer.
| strC | Valid UT_STRING or UT_FILE cell. |
| bin | Binary buffer to use. If zero, then the temporary thread binary will be used. |
| UStatus boron_defineCFunc | ( | UThread * | ut, |
| UIndex | ctxN, | ||
| const BoronCFunc * | funcTable, | ||
| const char * | spec, | ||
| int | slen ) |
Add C functions to context.
C Function Rules:
| ctxN | Context to add UT_CFUNC values to. |
| funcs | Table of BoronCFunc pointers. |
| spec | Function specifications starting with name, one function per line. |
| slen | Specification string length. |
| void boron_freeEnv | ( | UThread * | ut | ) |
Destroy Boron environment.
| ut | Initial thread created by boron_makeEnvP(). |
Load block! from file and give it default bindings.
| file | UTF-8 filename of Boron script or serialized data. |
| res | The result cell for the new block value. |
| UThread * boron_makeEnv | ( | UEnvParameters * | par | ) |
Make Boron environment and initial thread.
| par | Environment parameters initialized with boron_envParam(). |
| uint32_t boron_random | ( | UThread * | ut | ) |
Get the next number from the thread RNG.
Request user permission to access a resource.
| msg | Printf style format string. |
| void boron_reset | ( | UThread * | ut | ) |
Reset thread after exception.
Clears all stacks and exceptions.
Set the callback function that will request security access from the user.
If this function is not set then boron_requestAccess() will always return UR_OK.
| func | Callback function that must return a UserAccess value. |