Classes | |
struct | SFindThing |
The SFindThing structure is used internally by the search functions to look for a rebi. More... | |
Functions | |
CENTUMSHAREDCODE_API ExecutionReturn | CreateExceptionReturn (CScope *scope, const char *message) |
This function create a new ExecutionReturn with the type EXEC_EXCEPTION, and a single thrown value holding the message. | |
CENTUMSHAREDCODE_API CThing * | FindInScope (CScope *s, unsigned long stringindex, const CStringManager *strings, CThing *newvalue=(CThing *) 0, CThing **parent=(CThing **) 0, long *name=(long *) 0) |
The FindInScope Function finds a rebi with a given name within a scope. | |
CENTUMSHAREDCODE_API CThing * | FindInThing (CThing *t, unsigned long stringindex, const CStringManager *strings, CThing *newvalue=(CThing *) 0, CThing **parent=(CThing **) 0, long *name=(long *) 0) |
The FindInThing Function finds a rebi with a given name within a scope. | |
CENTUMSHAREDCODE_API CThing * | FindInThingSub (CThing *t, unsigned long stringindex, const CStringManager *strings, CThing *newvalue=(CThing *) 0, CThing **parent=(CThing **) 0, long *name=(long *) 0) |
This function looks though a given rebi for a rebi with the given name, possibly replacing it and/or returning data about the object that it is a member of. | |
CENTUMSHAREDCODE_API SFindThing | FindInScopeSub (CScope *s, unsigned long stringindex, const CStringManager *strings, CThing *newvalue=(CThing *) 0, CThing **parent=(CThing **) 0, long *name=(long *) 0) |
This function looks though a given scope for a rebi with the given name, possibly replacing it and/or returning data about the object that it is a member of. | |
CENTUMSHAREDCODE_API SFindThing | UniversalFind (SFindThing current, unsigned long stroffset, const CStringManager *strings, CThing *newvalue=(CThing *) 0, CThing **parent=(CThing **) 0, long *name=(long *) 0) |
The UniversalFind function takes a variable name, and a context to search for it in (can be a scope or a rebi), and returns the result of the search. | |
CENTUMSHAREDCODE_API SFindThing | UniversalArrayFind (SFindThing current, unsigned long stroffset, const CStringManager *strings, CThingArray *dest, CThing **parent=(CThing **) 0, long *name=(long *) 0) |
The UniversaArrayFind function takes a variable name, and a context to search for it in (can be a scope or a rebi), and returns the result of the search, and if more than one return is called for they are stored in an array. | |
CENTUMSHAREDCODE_API CThing * | FindInScopeArray (CScope *s, unsigned long stringindex, const CStringManager *strings, CThingArray *dest, CThing **parent=(CThing **) 0, long *name=(long *) 0) |
The FindInScopArray Function finds a rebi or more than one rebi with a given name within a scope. | |
CENTUMSHAREDCODE_API void | ReturnAllTied (CThing *current, unsigned long cname, CThingArray *ta, LongArray *la) |
This function takes a rebi and the name of a local variable and adds to the passed arrays all the rebi and local variables it is tied to. | |
CENTUMSHAREDCODE_API CThing * | ReturnDestructor (const CThing *t) |
This function searches for a local or static rebi called "Destructor" that belongs to the passed rebi and returns it. | |
CENTUMSHAREDCODE_API CThing * | ReturnConstructor (const CThing *t) |
This function searches for a local or static rebi called "Constructor" that belongs to the passed rebi and returns it. | |
CENTUMSHAREDCODE_API CThing * | BuildFromDef (CDefinition *def, CScope *scope, CThingStack *params, CThingStack *usings, CThing *owner) |
Given a CDefinition object and a scope this function will return a new rebi instance of that definition constructed in the given scope. | |
CENTUMSHAREDCODE_API CThing * | BuildFromString (const char *str, CScope *scope, CThingStack *params, CThingStack *usings, CThing *owner) |
This function creates a new rebi instance based on the definition of the rebi named. | |
CENTUMSHAREDCODE_API void | MakeEqual (CThing *dest, CThing *source) |
This function makes one rebi equal to another, this is not the same as an alias operation. | |
CENTUMSHAREDCODE_API void | CallConstructor (CThing *ret, CScope *scope, CThingStack *params, CThingStack *usings) |
This function calls the "Constructor" function of a rebi. | |
CENTUMSHAREDCODE_API void | CallDestructor (CThing *thing) |
This function calls the "Destructor" function of the given rebi. | |
CENTUMSHAREDCODE_API char * | GetData (const CThing *t, unsigned long type) |
This function returns a pointer to a type of data associated with a rebi instance. | |
CENTUMSHAREDCODE_API void | AddData (CThing *t, unsigned long type, unsigned long length, const char *data) |
This function adds data of a given type and size to a CThing. | |
CENTUMSHAREDCODE_API long | GetLong (const CThing *t, long def=0) |
The GetLong function returns a long based on the data the rebi contains, or the default value if it cannot extract one. | |
CENTUMSHAREDCODE_API float | GetFloat (const CThing *t, float def=0.0) |
The GetFloat function returns a float based on the data the rebi contains, or the default value if it cannot extract one. | |
CENTUMSHAREDCODE_API char * | GetString (const CThing *t, char *def=(char *) 0) |
The GetString function returns a char pointer based on the data the rebi contains, or the default (NULL if not supplied) value if it cannot extract one. | |
CENTUMSHAREDCODE_API bool | HasLong (const CThing *t) |
Returns true if the rebi has either DATA_TYPE_SIGNED_LONG or DATA_TYPE_FLOAT data attached to it. | |
CENTUMSHAREDCODE_API void | RemoveData (CThing *t, unsigned long type) |
This function removes a specific type of data from a CThing. | |
CENTUMSHAREDCODE_API bool | HasDataType (const CThing *t, unsigned long type) |
This function returns true if the rebi instance has data of the given type attached to it and false otherwise. | |
CENTUMSHAREDCODE_API unsigned long | GetDataLength (const CThing *t, unsigned long type) |
This function returns length of a type of data associated with a rebi instance. | |
CENTUMSHAREDCODE_API CThing * | ReplaceAndReturn (CThingArray *refs, unsigned long index, CThing *rep) |
This function replaces the rebi at the provided position in the array if neccessary, and then returns the rebi at that position. | |
CENTUMSHAREDCODE_API CThing * | ReplaceAndReturnGC (CThingArray *refs, unsigned long index, CThing *rep, CThing *from) |
This function replaces the rebi at the provided position in the array if neccessary, and then returns the rebi at that position. |
The searching functions are also part of this name space.
|
This function adds data of a given type and size to a CThing. If the CThing is NULL, it has no local, or it is marked as read only or the undef object this function has no effect. A new block of data is allocated equal to the length parameter, the old data is copied into it and the buffer is associated with the rebi. Giving this function a length greate than the data being passed or passing NULL as the data pointer is ans error.
|
|
Given a CDefinition object and a scope this function will return a new rebi instance of that definition constructed in the given scope. This function uses the localinstantiation types under the CDefinition objects to construct the locals for this new object. Locals that are themselves instances are consructed recursively using this function. Passing either the definition or the scope as NULL is an error.
|
|
This function creates a new rebi instance based on the definition of the rebi named. The rebi is searched for in the scope passed to this function. If the rebi cannot be founf the new rebi is created as an instance of the undef rebi. This function works the same as BuildFromDef in all other ways.
|
|
This function calls the "Constructor" function of a rebi. The caller of the constructor function is a new scope which is the rebi that is being constucted so that inside the destructor rebi varaibles may be accessed. Parameters and usings may also be passed to the constructor function.
|
|
This function calls the "Destructor" function of the given rebi. The caller of the destructor function is a new scope which is the rebi that is being destucted so that inside the destructor rebi varaibles may be accessed.
|
|
This function create a new ExecutionReturn with the type EXEC_EXCEPTION, and a single thrown value holding the message. The thown rebi is an intance of the type interpreterexception. The message is attached as string data to that instance.
|
|
The FindInScope Function finds a rebi with a given name within a scope. This function will replace the old value when found if a replacement value is provided. If the [out] parameters are non-NULL this function will also provide the name of the rebi and the rebi that it is a local variable of. Note that these will not be provided if the rebi is found but not as a local variable. If the name of the rebi to search for contains one or more ":" each part of the name is searched through and then the next part is searched through in the result of the that search.
|
|
The FindInScopArray Function finds a rebi or more than one rebi with a given name within a scope. If more than one rebi is to be returned, such as searching for params, they are placed in the dest array (along with a single NULL value to indicate that the results are in the array, as there may be no parameters). If the [out] parameters are non-NULL this function will also provide the name of the rebi and the rebi that it is a local variable of. Note that these will not be provided if the rebi is found but not as a local variable. If the name of the rebi to search for contains one or more ":" each part of the name is searched through and then the next part is searched through in the result of the that search.
|
|
This function looks though a given scope for a rebi with the given name, possibly replacing it and/or returning data about the object that it is a member of. This function searches though the "my" variables of the scope, and if it is not found there through the scope's usings, container, and then the caller. The usings and container (if they exist) are searched with calls to FindInThingSub, and the caller is searched with FindInScopeSub. If a variable with the searched for name exists in the "my" variables it is returned wrapped in a SFindThing structure, and if a repacement value has been passed the previous value will be substituted for it before hand. The name and parent parameters will not be filled by this function, but will be passed on.
|
|
The FindInThing Function finds a rebi with a given name within a scope. This function will replace the old value when found if a replacement value is provided. If the [out] parameters are non-NULL this function will also provide the name of the rebi and the rebi that it is a local variable of. Note that these will not be provided if the rebi is found but not as a local variable. If the name of the rebi to search for contains one or more ":" each part of the name is searched through and then the next part is searched through in the result of the that search.
|
|
This function looks though a given rebi for a rebi with the given name, possibly replacing it and/or returning data about the object that it is a member of. This function searches though the local variable, and if it is not found there through the, container, and then the static variables. The container (if there is one)is searched with a call to FindInThingSub. If a variable with the searched for name exists in the local or static variables it is returned wrapped in a SFindThing structure, and if a repacement value has been passed the previous value will be substituted for it before hand. If it is a local variable the name and parent parameters will be filled in if they exist. Also if the local varaible being re-aliased is tied to any other variables those variables are re-aliased as well.
|
|
This function returns a pointer to a type of data associated with a rebi instance. If the CThing passed is NULL, its CLocal is NULL, or it does not have the requested type this function returns NULL.
|
|
This function returns length of a type of data associated with a rebi instance. If the CThing passed is NULL, its CLocal is NULL, or it does not have the requested type this function returns 0.
|
|
The GetFloat function returns a float based on the data the rebi contains, or the default value if it cannot extract one. First the rebi is examined for DATA_TYPE_FLOAT, and if it has that data it is returned. Next this function looks for DATA_TYPE_SIGNED_LONG attached to the rebi, and if it exists it is cast to a float and returned. Finally if the rebi has string data (DATA_TYPE_STRING) that data is converted to a number using atof(). If all these attempts fail the default value attached to this function is returned.
|
|
The GetLong function returns a long based on the data the rebi contains, or the default value if it cannot extract one. First this function looks for DATA_TYPE_SIGNED_LONG attached to the rebi, and returns that data if possible. Next the rebi is examined for DATA_TYPE_FLOAT, and if it has that data it is truncated to a long value and returned. Finally if the rebi has string data (DATA_TYPE_STRING) that data is converted to a number using atoi(). If all these attempts fail the default value attached to this function is returned.
|
|
The GetString function returns a char pointer based on the data the rebi contains, or the default (NULL if not supplied) value if it cannot extract one. First the rebi is examined for DATA_TYPE_STRING, and if it has that data it is returned. Next this function looks for DATA_TYPE_FLOAT attached to the rebi, and if it exists it is turned into a string with sprintf and the format string: "%#.8f" and returned. Finally if the rebi has DATA_TYPE_SIGNED_LONG that data is turned into a string with sprintf and the format string: "%d" and returned. If all these attempts fail the default value attached to this function is returned (remember this may be NULL). WARNING: longs and floats converted into strings this way reside in a single static buffer, and subseqent calls may change this value. You should use the string this function returns as soon as possible and then consider it invalid afterwards.
|
|
This function returns true if the rebi instance has data of the given type attached to it and false otherwise. If the CThing passed is NULL, its CLocal is NULL, or it does not have the requested type this function returns false.
|
|
Returns true if the rebi has either DATA_TYPE_SIGNED_LONG or DATA_TYPE_FLOAT data attached to it.
|
|
This function makes one rebi equal to another, this is not the same as an alias operation. The equals operation alters the structure of the destination rebi to make it equal to the source rebi. Any references to it will remain valid, but will now point to the altered version. This function should not be called on the undef rebi or one marked as read-only, although it will not fail if you do. After the copying operation has been completed the function searches for an "=" function and calls it if possible. You can also consult the Centum language manual for more details on the equality operation.
|
|
This function removes a specific type of data from a CThing. If the CThing is NULL, it has no local, or it is marked as read only or the undef object this function has no effect. The data of the chosen type is removed from the CThing.
|
|
This function replaces the rebi at the provided position in the array if neccessary, and then returns the rebi at that position. The rebi is replaces if the rep parameter is non-NULL. CThings replaced in this manner have ReleaseCThing called on them.
|
|
This function replaces the rebi at the provided position in the array if neccessary, and then returns the rebi at that position. The rebi is replaces if the rep parameter is non-NULL. CThings replaced in this manner have ReleaseCThingGC called on them. The ReleaseCThingGC uses the from parameter passed to this function.
|
|
This function takes a rebi and the name of a local variable and adds to the passed arrays all the rebi and local variables it is tied to. The arrays passed to this function should already exist and contain the rebi and the name you are passing to this function. The rebi and the name at the same position in the arrays correspond to one tied variable (the rebi it is a local variable in and its name). This function operates recursively.
|
|
This function searches for a local or static rebi called "Constructor" that belongs to the passed rebi and returns it. No Constructor rebi will be returned for a rebi that is not an instance. Calling this function with a NULL parameter will return NULL.
|
|
This function searches for a local or static rebi called "Destructor" that belongs to the passed rebi and returns it. No Destructor rebi will be returned for a rebi that is not an instance. Calling this function with a NULL parameter will return NULL.
|
|
The UniversaArrayFind function takes a variable name, and a context to search for it in (can be a scope or a rebi), and returns the result of the search, and if more than one return is called for they are stored in an array. If the [out] parameters are non-NULL this function will also provide the name of the rebi and the rebi that it is a local variable of. To do searching within a specific scope or rebi FindInThingSub and FindInScopeSub are called internally to accomplish this in typical cases. However this function checks for special cases such as caller or this and returns the appropriate values, internally. The universal find functions are the only place these special cases are checked for.
|
|
The UniversalFind function takes a variable name, and a context to search for it in (can be a scope or a rebi), and returns the result of the search. This function will replace the old value when found if a replacement value is provided. If the [out] parameters are non-NULL this function will also provide the name of the rebi and the rebi that it is a local variable of. To do searching within a specific scope or rebi FindInThingSub and FindInScopeSub are called internally to accomplish this in typical cases. However this function checks for special cases such as caller or this and returns the appropriate values, internally. The universal find functions are the only place these special cases are checked for.
|