Files | |
file | boron.h |
The Boron programmer interface. | |
Functions | |
int | boron_doBlock (UThread *ut, const UCell *blkC, UCell *res) |
Evaluate block and get result. | |
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. | |
int | boron_throwWord (UThread *ut, UAtom atom) |
Append word cell to ur_errorBlock(). | |
void | boron_addCFunc (UThread *ut, BoronCFunc func, const char *sig) |
Add C function to the thread context. | |
UThread * | boron_makeEnv (UDatatype **dtTable, unsigned int dtCount) |
Make Boron environment and initial thread. | |
void | boron_freeEnv (UThread *ut) |
Destroy Boron environment. | |
void | boron_bindDefault (UThread *ut, UIndex blkN) |
Bind block in thread dataStore to default contexts. | |
int | boron_doBlockN (UThread *ut, UIndex blkN, UCell *res) |
Evaluate block and get result. | |
int | boron_doCStr (UThread *ut, const char *cmd, int len) |
Evaluate C string. | |
UCell * | boron_result (UThread *ut) |
Get result of last boron_doCStr() call. | |
UCell * | boron_exception (UThread *ut) |
Get most recent exception. | |
int | boron_requestAccess (UThread *ut, const char *msg,...) |
Request user permission to access a resource. |
void boron_addCFunc | ( | UThread * | ut, | |
BoronCFunc | func, | |||
const char * | sig | |||
) |
Add C function to the thread context.
C Function Rules:
func | Function. This must return UR_OK/UR_THROW. | |
sig | ASCII string describing the calling signature. |
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. |
Evaluate block and get result.
blkC and res may point to the same cell.
blkC | Block to do. This buffer must be held. | |
res | Result. This cell must be in a held block. |
Evaluate block and get result.
blkN | Index of block to do. This buffer must be held. | |
res | Result. This cell must be in a held block. |
int boron_doCStr | ( | UThread * | ut, | |
const char * | cmd, | |||
int | len | |||
) |
Evaluate C string.
cmd | String to evaluate. | |
len | Length of cmd string. May be -1 if cmd is null terminated. |
Get most recent exception.
void boron_freeEnv | ( | UThread * | ut | ) |
Destroy Boron environment.
ut | Initial thread created by boron_makeEnv(). |
Make Boron environment and initial thread.
dtTable | Array of pointers to user defined datatypes. Pass zero if dtCount is zero. | |
dtCount | Number of datatypes in dtTable. |
int boron_requestAccess | ( | UThread * | ut, | |
const char * | msg, | |||
... | ||||
) |
Request user permission to access a resource.
void boron_reset | ( | UThread * | ut | ) |
Reset thread after exception.
Clears all stacks and exceptions.
int boron_throwWord | ( | UThread * | ut, | |
UAtom | atom | |||
) |