26#define BORON_VERSION_STR "2.1.0"
27#define BORON_VERSION 0x020100
32 UT_FUNC = UT_BI_COUNT,
57#define CFUNC(name) static UStatus name( UThread* ut, UCell* a1, UCell* res )
58#define CFUNC_PUB(name) UStatus name( UThread* ut, UCell* a1, UCell* res )
59#define CFUNC_OPTIONS a1[-1].id.ext
60#define CFUNC_OPT_ARG(opt) (a1 + ((uint8_t*)a1)[-opt])
61#define CFUNC_REFRAMED 2
72#define boron_evalPos(a1) ((UCellCFuncEval*) a1)->pos
73#define boron_evalAvail(a1) ((UCellCFuncEval*) a1)->avail
109#define UR_PORT_HANDLE 0x7fffffff
123 int (*waitFD)(
UBuffer*,
void** );
139 const char* spec,
int slen );
140void boron_overrideCFunc(
UThread*,
const char* name, BoronCFunc func );
int boron_reframeDoBlock(UThread *, UIndex blkN, UCell *res, int flags)
Reuse the current CFUNC call frame for a EOP_DO_BLOCK operation.
Definition: eval.c:962
UCell * boron_evalUtf8(UThread *, const char *script, int len)
Run script and put result in the last stack cell.
Definition: eval.c:2033
void boron_addPortDevice(UThread *, const UPortDevice *, UAtom name)
Register port device.
Definition: boron_types.c:313
void boron_bindDefault(UThread *, UIndex blkN)
Bind block in thread dataStore to default contexts.
Definition: eval.c:1995
UStatus boron_badArg(UThread *, UIndex atom, int argN)
Throw a standardized error for an unexpected function argument.
Definition: eval.c:694
UIndex boron_evalRecurse(UThread *, UCell *res)
Begin a section where boron_evalBlock() can be recursively called.
Definition: eval.c:760
UserAccess
Definition: boron.h:77
void boron_evalSetTop(UThread *, UIndex top)
Reset evaluator operation stack position.
Definition: eval.c:780
PortForm
Definition: boron.h:85
@ UR_PORT_SIMPLE
Denotes that UBuffer::ptr is the UPortDevice pointer.
Definition: boron.h:86
@ UR_PORT_EXT
Denotes that UBuffer::ptr points to extension data and that the first member is the UPortDevice point...
Definition: boron.h:87
UBuffer * boron_makePort(UThread *, const UPortDevice *, void *ext, UCell *res)
Create port buffer.
Definition: boron_types.c:350
UStatus boron_throwWord(UThread *, UAtom atom, UIndex stackPos)
Throw named exception.
Definition: boron.c:300
uint32_t boron_random(UThread *)
Get the next number from the thread RNG.
Definition: random.c:56
int boron_catchWord(UThread *, UAtom atom)
Check if named exception was thrown.
Definition: boron.c:320
UThread * boron_makeEnv(UEnvParameters *)
Make Boron environment and initial thread.
Definition: boron.c:721
UStatus boron_defineCFunc(UThread *, UIndex ctxN, const BoronCFunc *funcs, const char *spec, int slen)
Add C functions to context.
Definition: boron.c:388
void boron_randomSeed(UThread *, uint32_t)
Seed the thread RNG.
Definition: random.c:44
void boron_freeEnv(UThread *)
Destroy Boron environment.
Definition: boron.c:865
UStatus boron_load(UThread *, const char *file, UCell *res)
Load block! from file and give it default bindings.
Definition: boron.c:889
void boron_reset(UThread *)
Reset thread after exception.
Definition: boron.c:214
void boron_setAccessFunc(UThread *, int(*func)(UThread *, const char *))
Set the callback function that will request security access from the user.
Definition: boron.c:933
char * boron_cstr(UThread *, const UCell *strC, UBuffer *bin)
Make null terminated UTF-8 string in binary buffer.
Definition: boron.c:236
@ UR_ACCESS_ALWAYS
Grant access to the resource and allow all future requests.
Definition: boron.h:80
@ UR_ACCESS_DENY
Forbid access to the resource.
Definition: boron.h:78
@ UR_ACCESS_ALLOW
Grant access to the resource.
Definition: boron.h:79
UStatus boron_requestAccess(UThread *, const char *msg,...)
Request user permission to access a resource.
Definition: boron.c:948
UEnvParameters * boron_envParam(UEnvParameters *)
Initialize UEnvParameters structure to default Boron values.
Definition: boron.c:706
char * boron_cpath(UThread *, const UCell *strC, UBuffer *bin)
Make null terminated UTF-8 string in binary buffer.
Definition: boron.c:252
The UBuffer struct holds information about a resource, usually a chuck of memory.
Definition: urlan.h:266
Structure of CFUNC a1 argument when boron_defineCFunc() signature is ":eval".
Definition: boron.h:65
const UCell * pos
Block program counter.
Definition: boron.h:68
UIndex avail
Number of valid cells following pos.
Definition: boron.h:67
Basic type identification.
Definition: urlan.h:158
The UEnvParameters struct allows the user to override default buffer and structure sizes.
Definition: urlan.h:488
The UPortDevice struct holds methods for a class of input/ouput device.
Definition: boron.h:115
int defaultReadLen
Number of bytes to read if script does not specify a length.
Definition: boron.h:127
int(* open)(UThread *, const UPortDevice *, const UCell *from, int opt, UCell *res)
Create and open a new port.
Definition: boron.h:116
void(* close)(UBuffer *)
Close port.
Definition: boron.h:118
int(* write)(UThread *, UBuffer *, const UCell *)
Write data to port.
Definition: boron.h:120
int(* seek)(UThread *, UBuffer *, UCell *, int where)
Seek to position.
Definition: boron.h:121
int(* read)(UThread *, UBuffer *, UCell *, int len)
Read data from port.
Definition: boron.h:119
The UThread struct stores the data specific to a thread of execution.
Definition: urlan.h:309
A cell holds a single value of a simple type or a reference (often to a UBuffer) for a complex type.
Definition: urlan.h:248
The Urlan programmer interface.
UStatus
Definition: urlan.h:119
@ UR_BIND_USER
Start of user defined bindings.
Definition: urlan.h:96