Boron 0.1.0
Defines | Functions

boron.h File Reference

The Boron programmer interface. More...

#include "urlan.h"

Go to the source code of this file.

Defines

#define CFUNC(name)   static int name( UThread* ut, UCell* a1, UCell* res )
 Macro to define C functions.
#define CFUNC_OPTIONS   a1[-1].series.end
 Macro to get uint32_t option flags from inside a C function.

Functions

UThreadboron_makeEnv (UDatatype **dtTable, unsigned int dtCount)
 Make Boron environment and initial thread.
void boron_freeEnv (UThread *)
 Destroy Boron environment.
void boron_addCFunc (UThread *, int(*func)(UThread *, UCell *, UCell *), const char *sig)
 Add C function to the thread context.
void boron_addPortDevice (UThread *, UPortDevice *, UAtom name)
 Register port device.
int boron_requestAccess (UThread *, const char *msg,...)
 Request user permission to access a resource.
void boron_bindDefault (UThread *, UIndex blkN)
 Bind block in thread dataStore to default contexts.
int boron_doBlock (UThread *, const UCell *blkC, UCell *res)
 Evaluate block and get result.
int boron_doBlockN (UThread *, UIndex blkN, UCell *res)
 Evaluate block and get result.
int boron_doCStr (UThread *, const char *cmd, int len)
 Evaluate C string.
UCellboron_result (UThread *)
 Get result of last boron_doCStr() call.
UCellboron_exception (UThread *)
 Get most recent exception.
void boron_reset (UThread *)
 Reset thread after exception.
int boron_throwWord (UThread *, UAtom atom)
 Append word cell to ur_errorBlock().
char * boron_cstr (UThread *, const UCell *strC, UBuffer *bin)
 Make null terminated UTF-8 string in binary buffer.
char * boron_cpath (UThread *, const UCell *strC, UBuffer *bin)
 Make null terminated UTF-8 string in binary buffer.

Detailed Description

The Boron programmer interface.


Define Documentation

#define CFUNC (   name)    static int name( UThread* ut, UCell* a1, UCell* res )

Macro to define C functions.

If the function takes multiple arguments, just index off of a1. For instance, the third argument is (a1+2).

Parameters:
utThe ubiquitous thread pointer.
a1Pointer to argument cells.
resPointer to result cell.
Examples:
boron_mini.c.
#define CFUNC_OPTIONS   a1[-1].series.end

Macro to get uint32_t option flags from inside a C function.

Only use this if options were declared in the boron_addCFunc() sig.


Function Documentation

void boron_addPortDevice ( UThread ut,
UPortDevice *  dev,
UAtom  name 
)

Register port device.

A single device may be added multiple times with different names.

Parameters:
devPointer to UPortDevice.
nameName of device.
 All Data Structures Files Functions Variables Enumerations Enumerator Defines

Generated on Fri Apr 29 2011 by Doxygen 1.7.3