See Also
Quick Nav
Escript Native API
Components
Ejs | Ejsript Interperter Structure. |
EjsArray | Array class. |
EjsBoolean | Boolean class. |
EjsByteArray | ByteArray class. |
EjsDate | Date class. |
EjsFile | File class. |
EjsFileSystem | FileSystem class. |
EjsFunction | Function class. |
EjsGlobal | EjsGlobal cass. |
EjsIterator | Iterator Class. |
EjsName | Qualified name structure. |
EjsNamespace | Namespace Class. |
EjsNull | Null Class. |
EjsNumber | Number class. |
EjsPath | Path class. |
EjsRegExp | RegExp Class. |
EjsString | String Class. |
EjsTimer | Timer Class. |
EjsVoid | Void class. |
EjsWorker | Worker Class. |
EjsXML | XML class. |
Functions
int | ejsCopyToByteArray(Ejs *ejs, EjsByteArray *ap, int offset, char *data, int length) |
Copy data into a byte array. | |
Ejs* | ejsCreate(MprCtx ctx, struct Ejs *master, cchar *searchPath, int flags) |
Create an ejs interpreter. | |
EjsArray* | ejsCreateArray(Ejs *ejs, int size) |
Create an array. | |
EjsString* | ejsCreateBareString(Ejs *ejs, int len) |
Create an empty string object. | |
EjsBoolean* | ejsCreateBoolean(Ejs *ejs, int value) |
Create a boolean. | |
EjsByteArray* | ejsCreateByteArray(Ejs *ejs, int size) |
Create a byte array. | |
EjsDate* | ejsCreateDate(Ejs *ejs, MprTime value) |
Create a new date instance. | |
EjsFile* | ejsCreateFile(Ejs *ejs, cchar *filename) |
Create a File object. | |
EjsFileSystem* | ejsCreateFileSystem(Ejs *ejs, cchar *path) |
Create a FileSystem object. | |
EjsFunction* | ejsCreateFunction(Ejs *ejs, const uchar *code, int codeLen, int numArgs, int numExceptions, EjsType *returnType, int attributes, struct EjsConst *constants, EjsBlock *scope, int lang) |
Create a function object. | |
EjsHttp* | ejsCreateHttp(Ejs *ejs) |
Create a new Http object. | |
EjsVar* | ejsCreateInstance(Ejs *ejs, struct EjsType *type, int argc, EjsVar **argv) |
Create a new variable instance. | |
EjsIterator* | ejsCreateIterator(Ejs *ejs, EjsVar *target, EjsNativeFunction next, bool deep, EjsArray *namespaces) |
Create an iterator object. | |
EjsNamespace* | ejsCreateNamespace(Ejs *ejs, cchar *name, cchar *uri) |
Create a namespace object. | |
EjsNumber* | ejsCreateNumber(Ejs *ejs, MprNumber value) |
Create a number object. | |
EjsObject* | ejsCreateObject(Ejs *ejs, struct EjsType *type, int size) |
Create an object instance of the specified type. | |
EjsPath* | ejsCreatePath(Ejs *ejs, cchar *path) |
Create a Path object. | |
EjsRegExp* | ejsCreateRegExp(Ejs *ejs, cchar *pattern) |
Create a new regular expression object. | |
EjsService* | ejsCreateService(MprCtx ctx) |
Open the Ejscript service. | |
EjsObject* | ejsCreateSimpleObject(Ejs *ejs) |
Create a simple object. | |
EjsString* | ejsCreateString(Ejs *ejs, cchar *value) |
Create a string object. | |
EjsString* | ejsCreateStringAndFree(Ejs *ejs, char *value) |
Create a string object and free the argument. | |
EjsString* | ejsCreateStringWithLength(Ejs *ejs, cchar *value, int len) |
Create a string and reserve extra room. | |
EjsType* | ejsCreateType(Ejs *ejs, EjsName *name, struct EjsModule *up, EjsType *baseType, int size, int slotNum, int numTypeProp, int numInstanceProp, int attributes, void *data) |
Create a new type object. | |
EjsVar* | ejsCreateVar(Ejs *ejs, struct EjsType *type, int numSlots) |
Create a variable. | |
int | ejsDefineGlobalFunction(Ejs *ejs, cchar *name, EjsNativeFunction fn) |
Define a global function. | |
int | ejsDefineInstanceProperty(Ejs *ejs, EjsType *type, int slotNum, EjsName *name, EjsType *propType, int attributes, EjsVar *value) |
Define an instance property. | |
int | ejsDefineProperty(Ejs *ejs, EjsVar *vp, int slotNum, EjsName *qname, struct EjsType *type, int attributes, EjsVar *value) |
Define a property. | |
int | ejsDeleteProperty(Ejs *ejs, EjsVar *vp, int slotNum) |
Delete a property. | |
int | ejsDeletePropertyByName(Ejs *ejs, EjsVar *vp, EjsName *qname) |
Delete a property by name. | |
EjsVar* | ejsDeserialize(Ejs *ejs, struct EjsString *value) |
Deserialize a JSON string. | |
void | ejsDestroyVar(Ejs *ejs, EjsVar *vp) |
Destroy a variable. | |
EjsString* | ejsDupString(Ejs *ejs, EjsString *sp) |
Duplicate a string object. | |
int | ejsEvalFile(cchar *path) |
Evaluate a file. | |
int | ejsEvalModule(cchar *path) |
Evaluate a module. | |
int | ejsEvalScript(cchar *script) |
Evaluate a script. | |
void | ejsExit(Ejs *ejs, int status) |
Instruct the interpreter to exit. | |
char* | ejsFormatStack(Ejs *ejs, EjsError *error) |
Format the stack backtrace. | |
void | ejsFreeVar(Ejs *ejs, EjsVar *vp, int pool) |
Free a new variable. | |
bool | ejsGetBoolean(EjsVar *vp) |
Get the C boolean value from a boolean object. | |
int | ejsGetDouble(EjsVar *vp) |
Get the numeric value stored in a EjsNumber object. | |
char* | ejsGetErrorMsg(Ejs *ejs, int withStack) |
Get the interpreter error message. | |
void* | ejsGetHandle(Ejs *ejs) |
Get the hosting handle. | |
int | ejsGetInt(EjsVar *vp) |
Get the numeric value stored in a EjsNumber object. | |
MprNumber | ejsGetNumber(EjsVar *vp) |
Get the numeric value stored in a EjsNumber object. | |
EjsVar* | ejsGetProperty(Ejs *ejs, EjsVar *vp, int slotNum) |
Get a property. | |
EjsVar* | ejsGetPropertyByName(Ejs *ejs, EjsVar *vp, EjsName *qname) |
Get a property by name. | |
int | ejsGetPropertyCount(Ejs *ejs, EjsVar *vp) |
Get a count of properties in a variable. | |
EjsName | ejsGetPropertyName(Ejs *ejs, EjsVar *vp, int slotNum) |
Get a variable property's name. | |
struct EjsTrait* | ejsGetPropertyTrait(Ejs *ejs, EjsVar *vp, int slotNum) |
Get a property's traits. | |
EjsType* | ejsGetType(Ejs *ejs, int slotNum) |
Get a type. | |
EjsType* | ejsGetVarType(EjsVar *vp) |
Get a variables type. | |
int | ejsGrowObject(Ejs *ejs, EjsObject *obj, int size) |
Grow an object. | |
bool | ejsHasException(Ejs *ejs) |
Determine if an exception has been thrown. | |
EjsVar* | ejsInvokeOperator(Ejs *ejs, EjsVar *vp, int opCode, EjsVar *rhs) |
Invoke an opcode on a native type. | |
bool | ejsIsA(Ejs *ejs, EjsVar *target, EjsType *type) |
Test if an variable is an instance of a given type. | |
bool | ejsIsArray(EjsVar *vp) |
Determine if a variable is an array. | |
bool | ejsIsBlock(EjsVar *vp) |
Determine if a variable is a block. | |
bool | ejsIsBoolean(EjsVar *vp) |
Determine if a variable is a boolean. | |
bool | ejsIsByteArray(EjsVar *vp) |
Determine if a variable is a byte array. | |
bool | ejsIsDate(EjsVar *vp) |
Determine if a variable is a Date. | |
bool | ejsIsFile(EjsVar *vp) |
Determine if a variable is a File. | |
bool | ejsIsFileSystem(EjsVar *vp) |
Determine if a variable is a Path. | |
bool | ejsIsFunction(EjsVar *vp) |
Determine if a variable is a function. | |
bool | ejsIsInitializer(EjsVar *vp) |
Determine if the function is an initializer. | |
bool | ejsIsInstanceBlock(EjsVar *vp) |
Determine if a variable is an instance block. | |
bool | ejsIsNamespace(EjsVar *vp) extern EjsNamespace *ejsDefineReservedNamespace(Ejs *ejs |
Determine if a variable is a namespace. | |
bool | ejsIsNativeFunction(EjsVar *vp) |
Determine if the function is a native function. | |
bool | ejsIsNumber(EjsVar *vp) |
Determine if a variable is a number. | |
bool | ejsIsObject(EjsVar *vp) |
Determine if a variable is an EjsObject. | |
bool | ejsIsPath(EjsVar *vp) |
Determine if a variable is a Path. | |
bool | ejsIsRegExp(EjsVar *vp) |
Determine if the variable is a regular expression. | |
bool | ejsIsType(EjsVar *vp) |
Determine if a variable is an type. | |
bool | ejsIsTypeSubType(Ejs *ejs, EjsType *target, EjsType *baseType) |
Test if a type is a derived type of a given base type. | |
boolean | ejsIsXML(EjsVar *vp) |
Determine if a variable is an XML object. | |
int | ejsLookupProperty(Ejs *ejs, EjsVar *vp, EjsName *qname) |
Lookup a property by name. | |
void | ejsMarkObject(Ejs *ejs, EjsVar *parent, EjsObject *obj) |
Mark an object as currently in use. | |
void | ejsMarkVar(Ejs *ejs, EjsVar *parent, EjsVar *vp) |
Mark a variable as currently in use. | |
EjsName* | ejsName(struct EjsName *qname, cchar *space, cchar *name) |
Initialize a Qualified Name structure. | |
EjsVar* | ejsParseVar(Ejs *ejs, cchar *str, int prefType) |
Parse a string into a variable. | |
void | ejsReportError(Ejs *ejs, char *fmt, ...) |
Report an error message using the MprLog error channel. | |
int | ejsRun(Ejs *ejs) |
Run a script. | |
EjsVar* | ejsRunFunction(Ejs *ejs, EjsFunction *fn, EjsVar *obj, int argc, EjsVar **argv) |
Run a function. | |
EjsVar* | ejsRunFunctionBySlot(Ejs *ejs, EjsVar *obj, int slotNum, int argc, EjsVar **argv) |
Run a function by slot number. | |
EjsVar* | ejsRunInitializer(Ejs *ejs, struct EjsModule *module) |
Run the initializer for a module. | |
EjsVar* | ejsSerialize(Ejs *ejs, EjsVar *value, int maxDepth, bool showAll, bool showBase) |
Serialize a variable into JSON. | |
void | ejsSetByteArrayPositions(Ejs *ejs, EjsByteArray *ap, int readPosition, int writePosition) |
Set the I/O byte array positions. | |
int | ejsSetProperty(Ejs *ejs, EjsVar *vp, int slotNum, EjsVar *value) |
Set a property's value. | |
int | ejsSetPropertyByName(Ejs *ejs, EjsVar *vp, EjsName *qname, EjsVar *value) |
Set a property's value. | |
int | ejsSetPropertyName(Ejs *ejs, EjsVar *vp, int slotNum, EjsName *qname) |
Set a property's name. | |
int | ejsSetPropertyTrait(Ejs *ejs, EjsVar *vp, int slotNum, struct EjsType *type, int attributes) |
Set a property's traits. | |
void | ejsSetSearchPath(Ejs *ejs, cchar *ejsPath) |
Set the module search path. | |
EjsVar* | ejsThrowArgError(Ejs *ejs, cchar *fmt, ...) |
Throw an argument exception. | |
EjsVar* | ejsThrowArithmeticError(Ejs *ejs, cchar *fmt, ...) |
Throw an math exception. | |
EjsVar* | ejsThrowAssertError(Ejs *ejs, cchar *fmt, ...) |
Throw an assertion exception. | |
EjsVar* | ejsThrowError(Ejs *ejs, cchar *fmt, ...) |
Throw an general error exception. | |
struct EjsVar* | ejsThrowException(Ejs *ejs, struct EjsVar *error) |
Throw an exception. | |
EjsVar* | ejsThrowInstructionError(Ejs *ejs, cchar *fmt, ...) |
Throw an instruction code exception. | |
EjsVar* | ejsThrowInternalError(Ejs *ejs, cchar *fmt, ...) |
Throw an internal error exception. | |
EjsVar* | ejsThrowIOError(Ejs *ejs, cchar *fmt, ...) |
Throw an IO exception. | |
EjsVar* | ejsThrowMemoryError(Ejs *ejs) |
Throw an Memory depletion exception. | |
EjsVar* | ejsThrowOutOfBoundsError(Ejs *ejs, cchar *fmt, ...) |
Throw an out of bounds exception. | |
EjsVar* | ejsThrowReferenceError(Ejs *ejs, cchar *fmt, ...) |
Throw an reference exception. | |
EjsVar* | ejsThrowResourceError(Ejs *ejs, cchar *fmt, ...) |
Throw an resource exception. | |
EjsVar* | ejsThrowStateError(Ejs *ejs, cchar *fmt, ...) |
Throw an state exception. | |
EjsVar* | ejsThrowStopIteration(Ejs *ejs) |
Throw an stop iteration exception. | |
EjsVar* | ejsThrowSyntaxError(Ejs *ejs, cchar *fmt, ...) |
Throw an syntax error exception. | |
EjsVar* | ejsThrowTypeError(Ejs *ejs, cchar *fmt, ...) |
Throw an type error exception. | |
EjsBoolean* | ejsToBoolean(Ejs *ejs, EjsVar *vp) |
Cast a variable to a boolean. | |
struct EjsNumber* | ejsToNumber(Ejs *ejs, EjsVar *vp) |
Cast a variable to a number. | |
EjsString* | ejsToString(Ejs *ejs, EjsVar *vp) |
Cast a variable to a string. | |
void | ejsAppendSearchPath(Ejs *ejs, cchar *ejsPath) |
Append to the module search path. | |
Ejs* | ejsCreate(MprCtx ctx, struct Ejs *master, cchar *searchPath, int flags) |
Create an ejs interpreter. | |
EjsService* | ejsCreateService(MprCtx ctx) |
Open the Ejscript service. | |
int | ejsEvalFile(cchar *path) |
Evaluate a file. | |
int | ejsEvalModule(cchar *path) |
Evaluate a module. | |
int | ejsEvalScript(cchar *script) |
Evaluate a script. | |
void | ejsExit(Ejs *ejs, int status) |
Instruct the interpreter to exit. | |
void* | ejsGetHandle(Ejs *ejs) |
Get the hosting handle. | |
void | ejsReportError(Ejs *ejs, char *fmt, ...) |
Report an error message using the MprLog error channel. | |
void | ejsSetSearchPath(Ejs *ejs, cchar *ejsPath) |
Set the module search path. | |
struct EjsVar* | ejsThrowException(Ejs *ejs, struct EjsVar *error) |
Throw an exception. | |
EjsArray* | ejsCreateArray(Ejs *ejs, int size) |
Create an array. | |
bool | ejsIsArray(EjsVar *vp) |
Determine if a variable is an array. | |
EjsBoolean* | ejsCreateBoolean(Ejs *ejs, int value) |
Create a boolean. | |
bool | ejsGetBoolean(EjsVar *vp) |
Get the C boolean value from a boolean object. | |
bool | ejsIsBoolean(EjsVar *vp) |
Determine if a variable is a boolean. | |
EjsBoolean* | ejsToBoolean(Ejs *ejs, EjsVar *vp) |
Cast a variable to a boolean. | |
EjsByteArray* | ejsCreateByteArray(Ejs *ejs, int size) |
Create a byte array. | |
bool | ejsIsByteArray(EjsVar *vp) |
Determine if a variable is a byte array. | |
void | ejsSetByteArrayPositions(Ejs *ejs, EjsByteArray *ap, int readPosition, int writePosition) |
Set the I/O byte array positions. | |
EjsDate* | ejsCreateDate(Ejs *ejs, MprTime value) |
Create a new date instance. | |
bool | ejsIsDate(EjsVar *vp) |
Determine if a variable is a Date. | |
EjsFile* | ejsCreateFile(Ejs *ejs, cchar *filename) |
Create a File object. | |
EjsFileSystem* | ejsCreateFileSystem(Ejs *ejs, cchar *path) |
Create a FileSystem object. | |
bool | ejsIsFileSystem(EjsVar *vp) |
Determine if a variable is a Path. | |
EjsFunction* | ejsCreateFunction(Ejs *ejs, const uchar *code, int codeLen, int numArgs, int numExceptions, EjsType *returnType, int attributes, struct EjsConst *constants, EjsBlock *scope, int lang) |
Create a function object. | |
bool | ejsIsFunction(EjsVar *vp) |
Determine if a variable is a function. | |
bool | ejsIsInitializer(EjsVar *vp) |
Determine if the function is an initializer. | |
bool | ejsIsNativeFunction(EjsVar *vp) |
Determine if the function is a native function. | |
EjsVar* | ejsRunFunction(Ejs *ejs, EjsFunction *fn, EjsVar *obj, int argc, EjsVar **argv) |
Run a function. | |
EjsVar* | ejsRunFunctionBySlot(Ejs *ejs, EjsVar *obj, int slotNum, int argc, EjsVar **argv) |
Run a function by slot number. | |
EjsVar* | ejsRunInitializer(Ejs *ejs, struct EjsModule *module) |
Run the initializer for a module. | |
EjsIterator* | ejsCreateIterator(Ejs *ejs, EjsVar *target, EjsNativeFunction next, bool deep, EjsArray *namespaces) |
Create an iterator object. | |
EjsName* | ejsAllocName(MprCtx ctx, cchar *space, cchar *name) |
Allocate and Initialize a Qualified Name structure. | |
EjsName* | ejsName(struct EjsName *qname, cchar *space, cchar *name) |
Initialize a Qualified Name structure. | |
EjsNamespace* | ejsCreateNamespace(Ejs *ejs, cchar *name, cchar *uri) |
Create a namespace object. | |
bool | ejsIsNamespace(EjsVar *vp) extern EjsNamespace *ejsDefineReservedNamespace(Ejs *ejs |
Determine if a variable is a namespace. | |
EjsNumber* | ejsCreateNumber(Ejs *ejs, MprNumber value) |
Create a number object. | |
int | ejsGetDouble(EjsVar *vp) |
Get the numeric value stored in a EjsNumber object. | |
int | ejsGetInt(EjsVar *vp) |
Get the numeric value stored in a EjsNumber object. | |
MprNumber | ejsGetNumber(EjsVar *vp) |
Get the numeric value stored in a EjsNumber object. | |
bool | ejsIsNumber(EjsVar *vp) |
Determine if a variable is a number. | |
struct EjsNumber* | ejsToNumber(Ejs *ejs, EjsVar *vp) |
Cast a variable to a number. | |
EjsPath* | ejsCreatePath(Ejs *ejs, cchar *path) |
Create a Path object. | |
bool | ejsIsPath(EjsVar *vp) |
Determine if a variable is a Path. | |
EjsRegExp* | ejsCreateRegExp(Ejs *ejs, cchar *pattern) |
Create a new regular expression object. | |
bool | ejsIsRegExp(EjsVar *vp) |
Determine if the variable is a regular expression. | |
EjsString* | ejsCreateBareString(Ejs *ejs, int len) |
Create an empty string object. | |
EjsString* | ejsCreateString(Ejs *ejs, cchar *value) |
Create a string object. | |
EjsString* | ejsCreateStringAndFree(Ejs *ejs, char *value) |
Create a string object and free the argument. | |
EjsString* | ejsCreateStringWithLength(Ejs *ejs, cchar *value, int len) |
Create a string and reserve extra room. | |
EjsString* | ejsDupString(Ejs *ejs, EjsString *sp) |
Duplicate a string object. | |
EjsString* | ejsToString(Ejs *ejs, EjsVar *vp) |
Cast a variable to a string. | |
boolean | ejsIsXML(EjsVar *vp) |
Determine if a variable is an XML object. |
Typedefs
MprNumber | Configured numeric type. |
EjsCode | Byte code. |
EjsEx | Exception Handler Record. |
EjsHashEntry | Hash entry for a property. |
EjsList | List type. |
EjsLookup | Lookup State. |
EjsNames | Property Names. |
EjsService | Ejscript Service structure. |
EjsTrait | Property traits. |
EjsTypeHelpers | Type Helpers. |
Defines
#define | _h_EJS_BYTECODETABLE_H 1 |
ejsByteCodeTable.h - Master Byte Code Table. | |
#define | _h_EJS_WEB_h 1 |
ejsWeb.h -- Header for the Ejscript Web Framework. | |
#define | EJS_ARENA_SIZE ((1 * 1024 * 1024) - MPR_HEAP_OVERHEAD) |
Initial virt memory for objects. | |
#define | EJS_ATTR_BLOCK_HELPERS (1 << 7) |
Use block helper methods. | |
#define | EJS_ATTR_BUILTIN (1 << 12) |
Type is builtin. | |
#define | EJS_ATTR_CALLS_SUPER (1 << 11) |
Constructor calls super(). | |
#define | EJS_ATTR_CONST (1 << 16) |
Property is constant after first assignment. | |
#define | EJS_ATTR_CONSTRUCTOR (1 << 26) |
Method is a constructor. | |
#define | EJS_ATTR_DEFAULT (1 << 23) |
Parameter has default value. | |
#define | EJS_ATTR_DYNAMIC_INSTANCE (1 << 17) |
Instances are not sealed. | |
#define | EJS_ATTR_ENUMERABLE (1 << 19) |
Property is visible. | |
#define | EJS_ATTR_FINAL (1 << 14) |
Type can't be subclassed. | |
#define | EJS_ATTR_FULL_SCOPE (1 << 28) |
Function needs closure when defined. | |
#define | EJS_ATTR_GETTER (1 << 20) |
Property is a getter. | |
#define | EJS_ATTR_HAS_CONSTRUCTOR (1 << 4) |
Type has a constructor. | |
#define | EJS_ATTR_HAS_INITIALIZER (1 << 9) |
Type has an initializer. | |
#define | EJS_ATTR_HAS_RETURN (1 << 29) |
Function has a return statement. | |
#define | EJS_ATTR_HAS_STATIC_INITIALIZER (1 << 10) |
Type has an initializer. | |
#define | EJS_ATTR_HAS_VALUE (1 << 31) |
Property has a value record. | |
#define | EJS_ATTR_INHERITED (1 << 5) |
Function is inherited. | |
#define | EJS_ATTR_INITIALIZER (1 << 3) |
Initializer code. | |
#define | EJS_ATTR_INTERFACE (1 << 30) |
Class is an interface. | |
#define | EJS_ATTR_LITERAL_GETTER (1 << 21) |
Property is a getter in object literal. | |
#define | EJS_ATTR_NATIVE (1 << 1) |
Property is builtin. | |
#define | EJS_ATTR_NO_BIND (1 << 13) |
Type properties are never bound. | |
#define | EJS_ATTR_NOT_NULLABLE (1 << 22) |
Property cannot take a null value. | |
#define | EJS_ATTR_OBJECT (1 << 18) |
Instances are based on EjsObject. | |
#define | EJS_ATTR_OBJECT_HELPERS (1 << 6) |
Use object helper methods. | |
#define | EJS_ATTR_OVERRIDE (1 << 15) |
Override base type. | |
#define | EJS_ATTR_PROTOTYPE (1 << 2) |
not supported yet. | |
#define | EJS_ATTR_REST (1 << 27) |
Parameter is a "..." rest. | |
#define | EJS_ATTR_SETTER (1 << 24) |
Property is a settter. | |
#define | EJS_ATTR_SLOTS_NEED_FIXUP (1 << 8) |
Missing inherited slots. | |
#define | EJS_ATTR_STATIC (1 << 25) |
Class static property. | |
#define | EJS_FLAG_COMPILER 0x4 |
Running inside the compiler. | |
#define | EJS_FLAG_DOC 0x40 |
Load documentation from modules. | |
#define | EJS_FLAG_EMPTY 0x2 |
Create an empty interpreter without native elements. | |
#define | EJS_FLAG_EVENT 0x1 |
Event pending. | |
#define | EJS_FLAG_EXIT 0x80 |
Interpreter should exit. | |
#define | EJS_FLAG_MASTER 0x20 |
Create a master interpreter. | |
#define | EJS_FLAG_NO_EXE 0x8 |
VM will not execute code. | |
#define | EJS_FLAG_NOEXIT 0x200 |
App should service events and not exit. | |
#define | EJS_FLAGS_ENUM_ALL 0x2 |
Enumerate non-enumerable and fixture properties. | |
#define | EJS_FLAGS_ENUM_INHERITED 0x1 |
Enumerate inherited base classes. | |
#define | EJS_GC_WORK_QUOTA 1024 |
Allocations required before garbage colllection. | |
#define | EJS_HASH_MIN_PROP 8 |
Min props to hash. | |
#define | EJS_LOTSA_PROP 256 |
Object with lots of properties. | |
#define | EJS_MAX_TYPE 256 |
Maximum number of types. | |
#define | EJS_NUM_GLOBAL 256 |
Number of globals slots to pre-create. | |
#define | EJS_NUM_PROP 8 |
Default object number of properties. | |
#define | EJS_SPEC_ECMA 0 |
Run in strict ECMA-262 compliance mode. | |
#define | EJS_SPEC_FIXED 2 |
Run with ECMA-262 plus enhancements and add breaking fixes. | |
#define | EJS_SPEC_PLUS 1 |
Run in enhanced ECMA-262 with non-breaking changes. | |
#define | EJS_WORKER_BEGIN 1 |
Worker yet to start. | |
#define | EJS_WORKER_CLOSED 3 |
Inside worker has finished. | |
#define | EJS_WORKER_COMPLETE 4 |
Worker has completed all messages. | |
#define | EJS_WORKER_STARTED 2 |
Worker has started a script. | |
#define | ejsIsNull ejsIs(vp, ES_Null) |
Determine if a variable is a null. | |
#define | ejsIsNull ejsIs(vp, ES_Null) |
Determine if a variable is a null. |
Ejs
Ejsript Interperter Structure.
- Description:
- The Ejs structure contains the state for a single interpreter. The ejsCreate routine may be used to create multiple interpreters and returns a reference to be used in subsequent Ejscript API calls.
- API Stability:
- Prototype.
- See Also:
- ejsAppendSearchPath, ejsCreate, ejsCreateService, ejsEvalFile, ejsEvalScript, ejsExit, ejsSetSearchPath
- Fields:
-
Append to the module search path.
- Description:
- Append a path to the ejs module search path.
- Parameters:
-
ejs Ejs interpreter. ejsPath Search path. This is a colon (or semicolon on Windows) separated string of directories.
- See Also:
- ejsCreate, ejsCreateService, ejsEvalFile, ejsEvalScript, ejsExit, ejsSetSearchPath
Create an ejs interpreter.
- Description:
- Create an interpreter object to evalute Ejscript programs. Ejscript supports multiple interpreters. One interpreter can be designated as a master interpreter and then it can be cloned by supplying the master interpreter to this call. A master interpreter provides the standard system types and clone interpreters can quickly be created an utilize the master interpreter's types. This saves memory and speeds initialization.
- Parameters:
-
ctx Any memory context returned by mprAlloc. master Optional master interpreter to clone. searchPath Module search path to use. Set to NULL for the default search path. flags Optional flags to modify the interpreter behavior. Valid flags are: - EJS_FLAG_COMPILER - Interpreter will compile code from source
- EJS_FLAG_NO_EXE - Don't execute any code. Just compile.
- EJS_FLAG_MASTER - Create a master interpreter
- EJS_FLAG_DOC - Load documentation from modules
- EJS_FLAG_NOEXIT - App should service events and not exit unless explicitly instructed
- Returns:
- A new interpreter.
Open the Ejscript service.
- Description:
- One Ejscript service object is required per application. From this service, interpreters can be created.
- Parameters:
-
ctx Any memory context returned by mprAlloc.
- Returns:
- An ejs service object.
- See Also:
- ejsAppendSearchPath, ejsCreate, ejsEvalFile, ejsEvalScript, ejsExit, ejsSetSearchPath
Evaluate a file.
- Description:
- Evaluate a file containing an Ejscript. This requires linking with the Ejscript compiler library (libec).
- Parameters:
-
path Filename of the script to evaluate.
- Returns:
- Return zero on success. Otherwise return a negative Mpr error code.
- See Also:
- ejsAppendSearchPath, ejsCreate, ejsCreateService, ejsEvalScript, ejsExit, ejsSetSearchPath
Evaluate a module.
- Description:
- Evaluate a module containing compiled Ejscript.
- Parameters:
-
path Filename of the module to evaluate.
- Returns:
- Return zero on success. Otherwise return a negative Mpr error code.
Evaluate a script.
- Description:
- Evaluate a script. This requires linking with the Ejscript compiler library (libec).
- Parameters:
-
script Script to evaluate.
- Returns:
- Return zero on success. Otherwise return a negative Mpr error code.
- See Also:
- ejsAppendSearchPath, ejsCreate, ejsCreateService, ejsEvalFile, ejsExit, ejsSetSearchPath
Instruct the interpreter to exit.
- Description:
- This will instruct the interpreter to cease interpreting any further script code.
- Parameters:
-
ejs Interpeter object returned from ejsCreate. status Reserved and ignored.
Get the hosting handle.
- Description:
- The interpreter can store a hosting handle. This is typically a web server object if hosted inside a web server.
- Parameters:
-
ejs Interpeter object returned from ejsCreate.
- Returns:
- Hosting handle.
Report an error message using the MprLog error channel.
- Description:
- This will emit an error message of the format:
- program:line:errorCode:SEVERITY: message
- Parameters:
-
ejs Interpeter object returned from ejsCreate. fmt Is an alternate printf style format to emit if the interpreter has no valid error message. ... Arguments for fmt.
Set the module search path.
- Description:
- Set the ejs module search path. The search path is by default set to the value of the EJSPATH environment directory. Ejsript will search for modules by name. The search strategy is: Given a name "a.b.c", scan for:
- File named a.b.c
- File named a/b/c
- File named a.b.c in EJSPATH
- File named a/b/c in EJSPATH
- File named c in EJSPATH
- Parameters:
-
ejs Ejs interpreter. ejsPath Search path. This is a colon (or semicolon on Windows) separated string of directories.
- See Also:
- ejsAppendSearchPath, ejsCreate, ejsCreateService, ejsEvalFile, ejsEvalScript, ejsExit
Throw an exception.
- Description:
- Throw an exception object.
- Parameters:
-
ejs Interpeter object returned from ejsCreate. error Exception argument object.
- Returns:
- The exception argument for chaining.
EjsArray
Array class.
- Description:
- Arrays provide a growable, integer indexed, in-memory store for objects. An array can be treated as a stack (FIFO or LIFO) or a list (ordered). Insertions can be done at the beginning or end of the stack or at an indexed location within a list. The Array class can store objects with numerical indicies and can also store any named properties. The named properties are stored in the obj field, whereas the numeric indexed values are stored in the data field. Array extends EjsObject and has all the capabilities of EjsObject.
- API Stability:
- Evolving.
- See Also:
- ejsCreateArray, ejsIsArray
- Fields:
-
EjsVar ** data Array elements. int length Array length property. EjsObject obj Extends Object.
Create an array.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. size Initial size of the array.
- Returns:
- A new array object.
- See Also:
- EjsArray, ejsIsArray
Determine if a variable is an array.
- Parameters:
-
vp Variable to test.
- Returns:
- True if the variable is an array.
- See Also:
- EjsArray, ejsCreateArray
EjsBoolean
Boolean class.
- Description:
- The Boolean class provides the base class for the boolean values "true" and "false". EjsBoolean is a primitive native type and extends EjsVar. It is still logically an Object, but implements Object properties and methods itself. Only two instances of the boolean class are ever created created these are referenced as ejs->trueValue and ejs->falseValue.
- API Stability:
- Evolving.
- See Also:
- ejsCreateBoolean, ejsGetBoolean, ejsIsBoolean
- Fields:
-
EjsObject obj NEW: Extends Object - Property storage. bool value Boolean value.
Create a boolean.
- Description:
- Create a boolean value. This will not actually create a new boolean instance as there can only ever be two boolean instances (true and false). Boolean properties are immutable in Ejscript and so this routine will simply return the appropriate pre-created true or false boolean value.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. value Desired boolean value. Set to 1 for true and zero for false.
- See Also:
- EjsBoolean, ejsGetBoolean, ejsIsBoolean
Get the C boolean value from a boolean object.
- Parameters:
-
vp Boolean variable to access.
- Returns:
- True or false.
- See Also:
- EjsBoolean, ejsCreateBoolean, ejsIsBoolean
Determine if a variable is a boolean.
- Parameters:
-
vp Variable to test.
- Returns:
- True if the variable is a boolean.
- See Also:
- EjsBoolean, ejsCreateBoolean, ejsGetBoolean
Cast a variable to a boolean.
- Description:
- Parameters:
-
ejs Ejs reference returned from ejsCreate. vp Variable to cast.
- Returns:
- A new boolean object.
- See Also:
- EjsBoolean, ejsCreateBoolean, ejsGetBoolean, ejsIsBoolean
EjsByteArray
ByteArray class.
- Description:
- ByteArrays provide a growable, integer indexed, in-memory store for bytes. ByteArrays are a powerful data type that can be used as a simple array to store and encode data as bytes or it can be used as a Stream implementing the Stream interface.
When used as a simple byte array, the ByteArray class offers a low level set of methods to insert and extract bytes. The index operator [] can be used to access individual bytes and the copyIn and copyOut methods can be used to get and put blocks of data. In this mode, the read and write position properties are ignored. Accesses to the byte array are from index zero up to the size defined by the length property. When constructed, the ByteArray can be designated as growable, in which case the initial size will grow as required to accomodate data and the length property will be updated accordingly.
When used as a Stream, the byte array offers various read and write methods which store data at the location specified by the write position property and they read data from the read position. The available method indicates how much data is available between the read and write position pointers. The flush method will reset the pointers to the start of the array. The length property is unchanged in behavior from when used as a simple byte array and it specifies the overall storage capacity of the byte array. As numeric values are read or written, they will be encoded according to the value of the endian property which can be set to either LittleEndian or BigEndian. When used with for/in, ByteArrays will iterate or enumerate over the available data between the read and write pointers.
In Stream mode ByteArrays can be configured with input and output callbacks to provide or consume data to other streams or components. These callbacks will automatically be invoked as required when the various read/write methods are called.
Unlike the Array class, ByteArray can only store data in numeric indicies. It is much efficient than EjsByteArray is a primitive native type and extends EjsVar. It is still logically an Object, but implements Object properties and methods itself. Only two instances of the boolean class are ever created created these are referenced as ejs->trueValue and ejs->falseValue.
- API Stability:
- Evolving.
- See Also:
- ejsCreateByteArray, ejsIsByteArray, ejsSetByteArrayPositions
- Fields:
-
Create a byte array.
- Description:
- Create a new byte array instance.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. size Initial size of the byte array.
- Returns:
- A new byte array instance.
- See Also:
- EjsByteArray, ejsIsByteArray, ejsSetByteArrayPositions
Determine if a variable is a byte array.
- Parameters:
-
vp Variable to test.
- Returns:
- True if the variable is a byte array.
- See Also:
- EjsByteArray, ejsCreateByteArray, ejsSetByteArrayPositions
Set the I/O byte array positions.
- Description:
- Set the read and/or write positions into the byte array. ByteArrays implement the Stream interface and support sequential and random access reading and writing of data in the array. The byte array maintains read and write positions that are automatically updated as data is read or written from or to the array.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. ap Byte array object. readPosition New read position to set. writePosition New write position to set.
- See Also:
- EjsByteArray, ejsCreateByteArray, ejsIsByteArray
EjsDate
Date class.
- Description:
- The Date class is a general purpose class for working with dates and times. is a a primitive native type and extends EjsVar. It is still logically an Object, but implements Object properties and methods itself.
- API Stability:
- Evolving.
- See Also:
- ejsCreateDate
- Fields:
-
EjsObject obj NEW: Extends Object - Property storage. MprTime value Time in milliseconds since "1970/01/01 GMT".
Determine if a variable is a Date.
- Parameters:
-
vp Variable to test.
- Returns:
- True if the variable is a date.
- See Also:
- EjsDate, ejsCreateDate
EjsFile
File class.
- Description:
- The File class provides a foundation of I/O services to interact with physical files and directories. Each File object represents a single file or directory and provides methods for creating, opening, reading, writing and deleting files, and for accessing and modifying information about the file.
- API Stability:
- Prototype.
- See Also:
- ejsCreateFile
- Fields:
-
MprFile * file Open file handle. MprPath info Cached file info. int mode Current open mode. char * modeString User supplied mode string. EjsObject obj Extends Object. char * path Filename path. int perms Posix permissions mask.
EjsFileSystem
FileSystem class.
- Description:
- The FileSystem class provides file system services.
- API Stability:
- Prototype.
- See Also:
- EjsFile, ejsCreateFile
- Fields:
-
MprFileSystem * fs MPR file system object. EjsObject obj Extends Object. char * path Filename path.
Create a FileSystem object.
- Description:
- Create a file system object associated with the given pathname.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. path Path to describe the file system. Can be any path in the file system.
- Returns:
- A new file system object.
- See Also:
- EjsFile, ejsCreateFile
Determine if a variable is a Path.
- Parameters:
-
vp Variable to test.
- Returns:
- True if the variable is a FileSystem.
- See Also:
- EjsFile, ejsCreateFile
EjsFunction
Function class.
- Description:
- The Function type is used to represent closures, function expressions and class methods. It contains a reference to the code to execute, the execution scope and possibly a bound "this" reference.
- API Stability:
- Evolving.
- See Also:
- ejsCreateFunction, ejsIsFunction, ejsIsInitializer, ejsIsNativeFunction, ejsRunFunction, ejsRunFunctionBySlot, ejsRunInitializer
- Fields:
-
Create a function object.
- Description:
- This creates a function object and optionally associates byte code with the function.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. code Pointer to the byte code. The byte code is not copied so this must be a persistent pointer. codeLen Length of the code. numArgs Number of formal arguments to the function. numExceptions Number of exception handlers. returnType Return type of the function. Set to NULL for no defined type. attributes Integer mask of access attributes. constants Reference to the module constant pool. Some byte code opcodes contain references into the constant pool. scope Reference to the chain of blocks that that comprises the lexical scope chain for this function. lang Language level (ecma|plus|fixed). Use constants EJS_SPEC_ECMA, EJS_SPEC_PLUS, EJS_SPEC_FIXED.
- Returns:
- An initialized function object.
Determine if a variable is a function.
This will return true if the variable is a function of any kind, including methods, native and script functions or initializers- Parameters:
-
vp Variable to test.
- Returns:
- True if the variable is a function.
Determine if the function is an initializer.
Initializers are special functions created by the compiler to do static and instance initialization of classes during construction- Parameters:
-
vp Variable to test.
- Returns:
- True if the variable is an initializer.
Determine if the function is a native function.
Functions can be either native - meaning the implementation is via a C function, or can be scripted- Parameters:
-
vp Variable to test.
- Returns:
- True if the variable is a native function.
Run a function.
- Description:
- Run a function with the given actual parameters.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. fn Function object to run. obj Object to use as the "this" object when running the function. argc Count of actual parameters. argv Vector of actual parameters.
- Returns:
- The return value from the function. If an exception is thrown, NULL will be returned and ejs->exception will be set to the exception object.
Run a function by slot number.
- Description:
- Run a function identified by slot number with the given actual parameters. This will run the function stored at slotNum in the obj variable.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. obj Object that holds the function at its "slotNum" slot. Also use this object as the "this" object when running the function. slotNum Slot number in obj that contains the function to run. argc Count of actual parameters. argv Vector of actual parameters.
- Returns:
- The return value from the function. If an exception is thrown, NULL will be returned and ejs->exception will be set to the exception object.
Run the initializer for a module.
- Description:
- A module's initializer runs global code defined in the module.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. module Module object reference.
- Returns:
- The last expression result of global code executed.
EjsGlobal
EjsGlobal cass.
- Description:
- The Global class is the base class for the global object. The global object is the top level scoping object.
- API Stability:
- Stable.
EjsIterator
Iterator Class.
- Description:
- Iterator is a helper class to implement iterators in other native classes.
- API Stability:
- Prototype.
- See Also:
- ejsCreateIterator
- Fields:
-
bool deep Iterator deep (recursively over all properties). int index Current index. EjsVar * indexVar Reference to current item. EjsArray * namespaces Namespaces to consider in iteration. EjsNativeFunction nativeNext Native next function. EjsVar * target Object to be enumerated. EjsObject var NEW: Extends Object - Property storage.
Create an iterator object.
- Description:
- The EjsIterator object is a helper class for native types to implement iteration and enumeration.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. target Target variable to iterate or enumerate. next Function to invoke to step to the next element. deep Set to true to do a deep iteration/enumeration. namespaces Reserved and not used. Supply NULL.
- Returns:
- A new EjsIterator object.
- See Also:
- EjsIterator
EjsName
Qualified name structure.
- Description:
- All names in Ejscript consist of a property name and a name space. Namespaces provide discrete spaces to manage and minimize name conflicts. These names will soon be converted to unicode.
- API Stability:
- Prototype.
- See Also:
- ejsAllocName, ejsName
- Fields:
-
cchar * name Property name. cchar * space Property namespace.
Allocate and Initialize a Qualified Name structure.
- Description:
- Create and initialize a qualified name structure using a name and namespace.
- Parameters:
-
ctx Any memory context returned by mprAlloc. space Namespace string. name Name string.
- Returns:
- A reference to an allocated EjsName structure. Caller must free.
Initialize a Qualified Name structure.
- Description:
- Initialize the statically allocated qualified name structure using a name and namespace.
- Parameters:
-
qname Reference to an existing, uninitialized EjsName structure. space Namespace string. name Name string.
- Returns:
- A reference to the qname structure.
- See Also:
- EjsName, ejsAllocName
EjsNamespace
Namespace Class.
- Description:
- Namespaces are used to qualify names into discrete spaces.
- API Stability:
- Evolving.
- See Also:
- ejsCreateNamespace, ejsIsNamespace
- Description:
- The Reflect class permits introspection into the type and attributes of objects and properties.
- API Stability:
- Evolving.
- See Also:
- Fields:
-
int flags Fast comparison flags. char * name Textual name of the namespace. EjsObject obj NEW: Extends Object - Property storage. char * uri Optional uri definition.
Create a namespace object.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. name Space name to use for the namespace. uri URI to associate with the namespace.
- Returns:
- A new namespace object.
- See Also:
Determine if a variable is a namespace.
- Returns:
- True if the variable is a namespace.
- See Also:
EjsNull
Null Class.
- Description:
- The Null class provides the base class for the singleton null instance. This instance is stored in ejs->nullValue.
- API Stability:
- Evolving.
- See Also:
- Fields:
-
EjsNumber
Number class.
- Description:
- The Number class provide the base class for all numeric values. The primitive number storage data type may be set via the configure program to be either double, float, int or int64.
- API Stability:
- Evolving.
- See Also:
- ejsCreateNumber, ejsGetDouble, ejsGetInt, ejsGetNumber, ejsIsNumber, ejsToNumber
- Fields:
-
EjsObject obj NEW: Extends Object - Property storage. MprNumber value Numeric value.
Create a number object.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. value Numeric value to initialize the number object.
- Returns:
- A number object.
- See Also:
- EjsNumber, ejsGetDouble, ejsGetInt, ejsGetNumber, ejsIsNumber, ejsToNumber
Get the numeric value stored in a EjsNumber object.
- Parameters:
-
vp Variable to examine.
- Returns:
- A double value.
- See Also:
- EjsNumber, ejsCreateNumber, ejsGetInt, ejsGetNumber, ejsIsNumber, ejsToNumber
Get the numeric value stored in a EjsNumber object.
- Parameters:
-
vp Variable to examine.
- Returns:
- An integer value.
- See Also:
- EjsNumber, ejsCreateNumber, ejsGetDouble, ejsGetNumber, ejsIsNumber, ejsToNumber
Get the numeric value stored in a EjsNumber object.
- Parameters:
-
vp Variable to examine.
- Returns:
- A numeric value.
- See Also:
- EjsNumber, ejsCreateNumber, ejsGetDouble, ejsGetInt, ejsIsNumber, ejsToNumber
Determine if a variable is a number.
- Parameters:
-
vp Variable to examine.
- Returns:
- True if the variable is a number.
- See Also:
- EjsNumber, ejsCreateNumber, ejsGetDouble, ejsGetInt, ejsGetNumber, ejsToNumber
Cast a variable to a number.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. vp Variable to cast.
- Returns:
- A number object.
- See Also:
- EjsNumber, ejsCreateNumber, ejsGetDouble, ejsGetInt, ejsGetNumber, ejsIsNumber
EjsPath
Path class.
- Description:
- The Path class provides file path name services.
- API Stability:
- Prototype.
- See Also:
- EjsFile, ejsCreatePath, ejsIsPath
- Fields:
-
Determine if a variable is a Path.
- Parameters:
-
vp Variable to test.
- Returns:
- True if the variable is a Path.
- See Also:
- EjsFile, ejsCreatePath
EjsRegExp
RegExp Class.
- Description:
- The regular expression class provides string pattern matching and substitution.
- API Stability:
- Evolving.
- See Also:
- ejsCreateRegExp, ejsIsRegExp
- Fields:
-
void * compiled Compiled pattern. int endLastMatch End of the last match (one past end). bool global Search for pattern globally (multiple times). bool ignoreCase Do case insensitive matching. struct EjsString * matched Last matched component. bool multiline Match patterns over multiple lines. int options Other parsed options. char * pattern Pattern to match with. int startLastMatch Start of the last match. EjsObject var NEW: Extends Object - Property storage.
Create a new regular expression object.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. pattern Regular expression pattern string.
- Returns:
- A EjsRegExp object.
- See Also:
- EjsRegExp, ejsIsRegExp
Determine if the variable is a regular expression.
- Returns:
- True if the variable is a regular expression.
- See Also:
- EjsRegExp, ejsCreateRegExp
EjsString
String Class.
- Description:
- The String class provides the base class for all strings. Each String object represents a single immutable linear sequence of characters. Strings have operators for: comparison, concatenation, copying, searching, conversion, matching, replacement, and, subsetting.
Strings are currently sequences of UTF-8 characters. They will soon be upgraded to UTF-16.
- API Stability:
- Evolving.
- See Also:
- ejsCreateBareString, ejsCreateString, ejsCreateStringWithLength, ejsDupString, ejsToString
- Fields:
-
int length String length (sans null). EjsObject obj NEW: Extends Object - Property storage. char * value String value. Currently UTF-8. Will upgrade to UTF-16 soon.
Create an empty string object.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. len Length of space to reserve for future string data.
- Returns:
- A string object.
- See Also:
- EjsString, ejsCreateString, ejsCreateStringWithLength, ejsDupString, ejsToString
Create a string object.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. value C string value to define for the string object. Note: this will soon be changed to unicode.
- API Stability:
- Prototype.
- Returns:
- A string object.
Create a string object and free the argument.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. value C string value to define for the string object. Note: this will soon be changed to unicode.
- API Stability:
- Prototype.
- Returns:
- A string object.
Create a string and reserve extra room.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. value C string value to define for the string object. Note: this will soon be changed to unicode. len Length of the string storage to allocate.
- Returns:
- A string object.
- See Also:
- EjsString, ejsCreateBareString, ejsCreateString, ejsDupString, ejsToString
Duplicate a string object.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. sp String value to copy.
- Returns:
- A string object.
Cast a variable to a string.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. vp Variable to cast.
- Returns:
- A string object.
EjsTimer
Timer Class.
- Description:
- Timers manage the scheduling and execution of Ejscript functions. Timers run repeatedly until stopped by calling the stop method and are scheduled with a granularity of 1 millisecond.
- API Stability:
- Evolving.
- See Also:
- Fields:
-
EjsFunction * callback Callback function. int drift Event is allowed to drift. Ejs * ejs Need interpreter reference in callback. MprEvent * event MPR event for the timer. EjsObject obj Extends Object. int period Time in msec between invocations.
EjsVoid
Void class.
- Description:
- The Void class provides the base class for the singleton "undefined" instance. This instance is stored in ejs->undefinedValue.
- API Stability:
- Evolving.
- See Also:
EjsWorker
Worker Class.
- Description:
- The Worker class provides the ability to create new interpreters in dedicated threads.
- API Stability:
- Prototype.
- See Also:
- EjsObject
- Fields:
-
int complete Worker has completed its work. Ejs * ejs Interpreter. int inside Running inside the worker. char * name Optional worker name. EjsObject obj Logically extentends Object. struct EjsWorker * pair Corresponding worker object in other thread. char * scriptFile Script or module to run. char * scriptLiteral Literal script string to run. int state Worker state. int terminated Worker has had terminate() called.
EjsXML
XML class.
- Description:
- The XML class and API is based on ECMA-357 -- ECMAScript for XML (E4X). The XML class is a core class in the E4X specification; it provides the ability to load, parse and save XML documents.
- API Stability:
- Evolving.
- See Also:
- ejsIsXML
- Fields:
-
Determine if a variable is an XML object.
- Returns:
- True if the variable is an XML or XMLList object.
- See Also:
- EjsXML
Functions
Copy data into a byte array.
- Description:
- Copy data into a byte array at a specified offset.
- Parameters:
-
ejs Ejs reference returned from ejsCreate. ap Byte array object. offset Offset in the byte array to which to copy the data. data Pointer to the source data. length Length of the data to copy.
- Returns:
- Zero if successful, otherwise a negative MPR error code.
Determine if a variable is a File.
- Parameters:
-
vp Variable to test.
- Returns:
- True if the variable is a File.
Run a script.
- Description:
- Run a script that has previously ben compiled by ecCompile.
- Parameters:
-
ejs Interpeter object returned from ejsCreate.
- Returns:
- Zero if successful, otherwise a non-zero Mpr error code.
Typedefs
Configured numeric type.
The configure program will define BLD_FEATURE_NUM_TYPE to be either double, float, int or int64Byte code.
- Description:
- This structure describes a sequence of byte code for a function. It also defines a set of execption handlers pertaining to this byte code.
- Fields:
-
uchar * byteCode Byte code. int codeLen Byte code length. struct EjsConst * constants Constant pool. Reference to module constant pool. struct EjsEx ** handlers Exception handlers. int numHandlers Number of exception handlers. int sizeHandlers Size of handlers array.
Exception Handler Record.
- Description:
- Each exception handler has an exception handler record allocated that describes it.
- Fields:
-
struct EjsType * catchType Type of error to catch. uint flags Exception flags. uint handlerEnd Ptr to one past the end. uint handlerStart Ptr to start of catch/finally block. uint numBlocks Count of blocks opened in the try block. uint numStack Count of stack slots used before the try block. uint tryEnd Ptr to one past the end. uint tryStart Ptr to start of try block.
Hash entry for a property.
- Description:
- Properties are indexed by hash entries. These store the property name and a reference to the next slot in the hash collision chain.
- Fields:
-
int nextSlot Next property in hash chain. EjsName qname Property name.
List type.
- Description:
- The EjsList is a dynamic growable array suitable for storing pointers to arbitrary objects.
- Fields:
-
void ** items List item data. int length Count of used items. int maxSize Maximum capacity.
- API Stability:
- Prototype.
- See Also:
Lookup State.
- Description:
- Location information returned when looking up properties.
- Fields:
-
Property Names.
- Description:
- This structure stores the names of all the properties in an object and holds the hash table state.
- Fields:
-
int * buckets Hash buckets and head of link chains. EjsHashEntry * entries Hash entries. int sizeBuckets Size of buckets. int sizeEntries Size of entries array in elements.
Ejscript Service structure.
- Description:
- The Ejscript service manages the overall language runtime. It is the factory that creates interpreter instances via ejsCreate.
- Fields:
-
MprHashTable * nativeModules Native module initialization callbacks.
Property traits.
- Description:
- Property traits describe the type and access attributes of a property. The Trait structure is used by EjsBlock to describe the attributes of properties defined within a block. Note: These traits apply to a property definition and not to the referenced object. ie. two property definitions may have different traits but will refer to the same object.
- Fields:
-
int attributes Property attributes. struct EjsType * type Property type.
- API Stability:
- Evolving.
Type Helpers.
- Description:
- The type helpers interface defines the set of primitive operations a type must support to interact with the virtual machine.
- Fields:
-