Boron 0.1.0

Boron Interpreter

The Boron Interpreter. More...


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.
UThreadboron_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.
UCellboron_result (UThread *ut)
 Get result of last boron_doCStr() call.
UCellboron_exception (UThread *ut)
 Get most recent exception.
int boron_requestAccess (UThread *ut, const char *msg,...)
 Request user permission to access a resource.

Detailed Description

The Boron Interpreter.


Function Documentation

void boron_addCFunc ( UThread ut,
BoronCFunc  func,
const char *  sig 
)

Add C function to the thread context.

C Function Rules:

Parameters:
func Function. This must return UR_OK/UR_THROW.
sig ASCII string describing the calling signature.
Examples:
boron_mini.c.

char* boron_cpath ( UThread ut,
const UCell strC,
UBuffer bin 
)

Make null terminated UTF-8 string in binary buffer.

Any trailing slash or backslash is removed.

Parameters:
strC Valid UT_STRING or UT_FILE cell.
bin Binary buffer to use. If zero, then the temporary thread binary will be used.
Returns:
Pointer to C string in bin.

char* boron_cstr ( UThread ut,
const UCell strC,
UBuffer bin 
)

Make null terminated UTF-8 string in binary buffer.

Parameters:
strC Valid UT_STRING or UT_FILE cell.
bin Binary buffer to use. If zero, then the temporary thread binary will be used.
Returns:
Pointer to C string in bin.

int boron_doBlock ( UThread ut,
const UCell blkC,
UCell res 
)

Evaluate block and get result.

blkC and res may point to the same cell.

Parameters:
blkC Block to do. This buffer must be held.
res Result. This cell must be in a held block.
Returns:
UR_OK/UR_THROW.

int boron_doBlockN ( UThread ut,
UIndex  blkN,
UCell res 
)

Evaluate block and get result.

Parameters:
blkN Index of block to do. This buffer must be held.
res Result. This cell must be in a held block.
Returns:
UR_OK/UR_THROW.

int boron_doCStr ( UThread ut,
const char *  cmd,
int  len 
)

Evaluate C string.

Parameters:
cmd String to evaluate.
len Length of cmd string. May be -1 if cmd is null terminated.
Returns:
UR_OK/UR_THROW.
Examples:
boron_mini.c.

UCell* boron_exception ( UThread ut  ) 

Get most recent exception.

Returns:
Pointer to top cell on ur_errorBlock(), or zero if there are no exceptions.

void boron_freeEnv ( UThread ut  ) 

Destroy Boron environment.

Parameters:
ut Initial thread created by boron_makeEnv().
Examples:
boron_mini.c.

UThread* boron_makeEnv ( UDatatype **  dtTable,
unsigned int  dtCount 
)

Make Boron environment and initial thread.

Parameters:
dtTable Array of pointers to user defined datatypes. Pass zero if dtCount is zero.
dtCount Number of datatypes in dtTable.
Examples:
boron_mini.c.

int boron_requestAccess ( UThread ut,
const char *  msg,
  ... 
)

Request user permission to access a resource.

Returns:
UR_OK/UR_THROW.

void boron_reset ( UThread ut  ) 

Reset thread after exception.

Clears all stacks and exceptions.

int boron_throwWord ( UThread ut,
UAtom  atom 
)

Append word cell to ur_errorBlock().

Returns:
UR_THROW


Generated on 27 Jan 2012 by Doxygen 1.5.1