26#define BORON_VERSION_STR "2.96.0"
27#define BORON_VERSION 0x0209600
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
73#define boron_evalPos(a1) ((UCellCFuncEval*) a1)->pos
74#define boron_evalAvail(a1) ((UCellCFuncEval*) a1)->avail
110#define UR_PORT_HANDLE 0x7fffffff
124 int (*waitFD)(
UBuffer*,
void** );
138 uint16_t evalStack );
142 const char* spec,
int slen );
143void 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:964
UCell * boron_evalUtf8(UThread *, const char *script, int len)
Run script and put result in the last stack cell.
Definition eval.c:2127
void boron_addPortDevice(UThread *, const UPortDevice *, UAtom name)
Register port device.
Definition boron_types.c:321
void boron_bindDefault(UThread *, UIndex blkN)
Bind block in thread dataStore to default contexts.
Definition eval.c:2042
UStatus boron_badArg(UThread *, UIndex atom, int argN)
Throw a standardized error for an unexpected function argument.
Definition eval.c:696
UIndex boron_evalRecurse(UThread *, UCell *res)
Begin a section where boron_evalBlock() can be recursively called.
Definition eval.c:762
UserAccess
Definition boron.h:78
void boron_evalSetTop(UThread *, UIndex top)
Reset evaluator operation stack position.
Definition eval.c:782
PortForm
Definition boron.h:86
@ UR_PORT_SIMPLE
Denotes that UBuffer::ptr is the UPortDevice pointer.
Definition boron.h:87
@ UR_PORT_EXT
Denotes that UBuffer::ptr points to extension data and that the first member is the UPortDevice point...
Definition boron.h:88
UBuffer * boron_makePort(UThread *, const UPortDevice *, void *ext, UCell *res)
Create port buffer.
Definition boron_types.c:358
UStatus boron_throwWord(UThread *, UAtom atom, UIndex stackPos)
Throw named exception.
Definition boron.c:308
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:328
UThread * boron_makeEnv(UEnvParameters *)
Make Boron environment and initial thread.
Definition boron.c:748
UStatus boron_defineCFunc(UThread *, UIndex ctxN, const BoronCFunc *funcs, const char *spec, int slen)
Add C functions to context.
Definition boron.c:396
void boron_randomSeed(UThread *, uint32_t)
Seed the thread RNG.
Definition random.c:44
void boron_freeEnv(UThread *)
Destroy Boron environment.
Definition boron.c:894
UStatus boron_load(UThread *, const char *file, UCell *res)
Load block! from file and give it default bindings.
Definition boron.c:918
void boron_reset(UThread *)
Reset thread after exception.
Definition boron.c:222
void boron_setAccessFunc(UThread *, int(*func)(UThread *, const char *))
Set the callback function that will request security access from the user.
Definition boron.c:973
char * boron_cstr(UThread *, const UCell *strC, UBuffer *bin)
Make null terminated UTF-8 string in binary buffer.
Definition boron.c:244
@ UR_ACCESS_ALWAYS
Grant access to the resource and allow all future requests.
Definition boron.h:81
@ UR_ACCESS_DENY
Forbid access to the resource.
Definition boron.h:79
@ UR_ACCESS_ALLOW
Grant access to the resource.
Definition boron.h:80
UStatus boron_requestAccess(UThread *, const char *msg,...)
Request user permission to access a resource.
Definition boron.c:988
UEnvParameters * boron_envParam(UEnvParameters *)
Initialize UEnvParameters structure to default Boron values.
Definition boron.c:714
char * boron_cpath(UThread *, const UCell *strC, UBuffer *bin)
Make null terminated UTF-8 string in binary buffer.
Definition boron.c:260
The UBuffer struct holds information about a resource, usually a chunk of memory.
Definition urlan.h:266
Structure of CFUNC a1 argument when boron_defineCFunc() signature is ":eval".
Definition boron.h:66
const UCell * pos
Block program counter.
Definition boron.h:69
UIndex avail
Number of valid cells following pos.
Definition boron.h:68
Basic type identification.
Definition urlan.h:155
The UEnvParameters struct allows the user to override default buffer and structure sizes.
Definition urlan.h:497
The UPortDevice struct holds methods for a class of input/ouput device.
Definition boron.h:116
int(* seek)(UThread *, UBuffer *, UCell *, int where)
Seek to position.
Definition boron.h:122
int defaultReadLen
Number of bytes to read if script does not specify a length.
Definition boron.h:128
void(* close)(UBuffer *)
Close port.
Definition boron.h:119
int(* read)(UThread *, UBuffer *, UCell *, int len)
Read data from port.
Definition boron.h:120
int(* open)(UThread *, const UPortDevice *, const UCell *from, int opt, UCell *res)
Create and open a new port.
Definition boron.h:117
int(* write)(UThread *, UBuffer *, const UCell *)
Write data to port.
Definition boron.h:121
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:116
@ UR_BIND_USER
Start of user defined bindings.
Definition urlan.h:93
int32_t UIndex
This is an index into an array.
Definition urlan.h:150