HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EXPR.h File Reference
#include "EXPR_API.h"
#include "EX_Error.h"
#include "EXPR_Lock.h"
#include <UT/UT_NonCopyable.h>
#include <UT/UT_SmallObject.h>
#include <UT/UT_String.h>
#include <SYS/SYS_Types.h>
#include <SYS/SYS_MemoryOrder.h>
#include <iosfwd>
+ Include dependency graph for EXPR.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  EV_TOKENVALUE
 union used to hold a token's value More...
 
struct  EV_SYMBOL
 class representing a symbol operated upon by expressions More...
 
struct  EV_TYPEDEF
 
struct  EV_OPERATOR
 struct describing an operator's characteristics More...
 
class  EV_FUNCTION
 
struct  EV_ChangeOpReferenceParms
 
class  EV_EXPRESSION
 
struct  EV_SYMTABLE
 

Macros

#define EV_OPTIMIZE0   0 /* No optimization */
 
#define EV_OPTIMIZE1   1 /* Constant folding */
 
#define MAX_RECURSION   20 /* Maximum depth of recursion */
 
#define EV_NHELPARGS   10 /* Maximum # of args in help */
 
#define EX_USERFLAGMASK   (0x03ffffff | EV_EXFUNC_REF)
 
#define OP_PLUS   1 /* + */
 
#define OP_MINUS   2 /* - */
 
#define OP_TIMES   3 /* * */
 
#define OP_DIVIDE   4 /* / */
 
#define OP_POWER   5 /* ^ */
 
#define OP_MOD   6 /* % */
 
#define OP_NOT   7 /* ! */
 
#define OP_EQ   8 /* == */
 
#define OP_NE   9 /* != */
 
#define OP_LT   10 /* < */
 
#define OP_LE   11 /* <= */
 
#define OP_GT   12 /* > */
 
#define OP_GE   13 /* >= */
 
#define OP_LOGAND   14 /* && (logical and) */
 
#define OP_LOGOR   15 /* || (logical or) */
 
#define OP_COMMA   16 /* , almost a NOP */
 
#define OP_QUESTION   20 /* ? */
 
#define OP_COLON   21 /* : */
 
#define OP_AND   22 /* & */
 
#define OP_OR   23 /* | */
 
#define OP_DOT   24 /* . */
 
#define OP_TILDE   25 /* ~ */
 
#define OP_AT   26 /* @ */
 
#define OP_SBRACKET   30 /* [ end square bracket implied */
 
#define OP_BRACE   31 /* { end brace implied */
 
#define OP_EQUATE   32 /* = */
 
#define MAX_OPERATOR_TOKEN   32
 
#define EV_SYMTRANSIENT   0x04000000
 Symbol is result of operation. More...
 
#define EV_SYMCONSTANT   0x08000000
 Symbol has a constant value. More...
 
#define EV_FLAGS_SET   0x10000000
 User flags have been set. More...
 
#define EV_SYMEXPAND   0x20000000
 String should be expanded. More...
 
#define EV_EXFUNC_REF   0x40000000
 Refers to an expression function. More...
 
#define EV_FOR_EXFUNC   0x80000000
 
#define EV_TYPEFLOAT   0
 Float type of symbol. More...
 
#define EV_TYPESTRING   1
 String type of symbol. More...
 
#define EV_TYPEUNIXVAR   2
 Unix variable type. More...
 
#define EV_TYPEEXPANDVAR   4
 Variable of form ${foo$x}. More...
 
#define EV_TYPEVECTOR   5
 Vector. More...
 
#define EV_TYPEMATRIX   6
 
#define EV_TYPE_LOCAL_VAR   10
 A node local variable. More...
 
#define EV_TYPE_UNRESOLVED_VAR   11
 An unknown variable. More...
 
#define EV_TYPE_DEFINE   12
 A node local variable. More...
 
#define EV_TYPE_GEOATTRIBUTE   13
 An attribute reference. More...
 
#define EV_TYPE_GLOBAL_VAR   20
 A global variable. More...
 
#define EV_TYPE_CPPSYMBOL   45
 A symbol inside a function. More...
 
#define EV_TYPE_UNRESOLVED_CPPSYMBOL   46
 
#define EV_START_FN(name)
 
#define EV_START_FNNA(name)
 
#define EV_START_FUNC(name)
 
#define EV_END_FN(answer)   result->value.fval = (answer)
 
#define EV_END_FNS(answer)   result->value.sval = (answer)
 

Typedefs

typedef char *(* ev_Expander )(const char *str, int thread)
 
typedef void(* EXPRopDependencyCallback )(EV_FUNCTION *me, EV_SYMBOL **argv, void *ref_id)
 
typedef void(* EXPRopChangeRefCallback )(EV_FUNCTION *me, EV_SYMBOL **argv, char *new_args[], const char *new_fullpath, const char *old_fullpath, const char *old_cwd, const char *chan_name, const char *old_chan_name)
 
typedef void(* EXPRfuncCallback )(EV_FUNCTION *me, EV_SYMBOL *result, EV_SYMBOL **argv, int thread, unsigned &func_flags)
 
typedef struct EV_TYPEDEF EV_TYPEDEF
 
typedef struct EV_OPERATOR EV_OPERATOR
 
typedef struct EV_FUNCHELP EV_FUNCHELP
 
typedef struct EV_SYMTABLE EV_SYMTABLE
 

Enumerations

enum  EV_InlineFuncReturnType {
  EV_EXPR_RETURN_NONE, EV_EXPR_RETURN_FLOAT, EV_EXPR_RETURN_STRING, EV_EXPR_RETURN_VECTOR,
  EV_EXPR_RETURN_MATRIX
}
 

Functions

EXPR_API void ev_InitFloat ()
 
EXPR_API void ev_InitString ()
 initialize string operations More...
 
EXPR_API void ev_InitVariable ()
 
EXPR_API void ev_InitVector ()
 initialize vector operations More...
 
EXPR_API void ev_InitMatrix ()
 initialize matrix operations More...
 
EXPR_API void ev_InitUserFunc ()
 
EXPR_API void ev_PrintHelp (std::ostream &os, const char *match, const char *keyword, bool full_match_only=false)
 
EXPR_API int ev_GetNFunctions ()
 
EXPR_API EV_FUNCTIONev_GetFunction (int i)
 
EXPR_API EV_TYPEDEFev_GetTypeDef (int key)
 
EXPR_API int ev_FindFunction (const char *name)
 
EXPR_API void ev_SetFunctionDependencyCallbacks (const char *func, EXPRopDependencyCallback depend_cb, EXPRopChangeRefCallback changeref_cb)
 
EXPR_API EV_EXPRESSIONev_AllocExpr (EV_InlineFuncReturnType rettype)
 
EXPR_API int ev_ChangeExpr (EV_EXPRESSION *expr, const char *source)
 
EXPR_API void ev_UnresolveVars (EV_EXPRESSION *expr, int thread)
 
EXPR_API fpreal ev_EvaluateFloat (EV_EXPRESSION *expr, int thread)
 
EXPR_API void ev_EvaluateString (UT_String &result, EV_EXPRESSION *expr, int thread)
 
EXPR_API int ev_EvaluateVector (EV_EXPRESSION *expr, ev_Vector &result, int thread)
 
EXPR_API int ev_EvaluateMatrix (EV_EXPRESSION *expr, ev_Matrix &result, int thread)
 
EXPR_API void ev_FreeExpr (EV_EXPRESSION *expr)
 
EXPR_API void ev_UpdateOpDependency (EV_EXPRESSION *expr, void *ref_id, int thread)
 
EXPR_API int ev_ChangeOpReference (EV_EXPRESSION *expr, const char *new_fullpath, const char *old_fullpath, const char *old_cwd, const char *chan_name, const char *old_chan_name, int thread)
 
EXPR_API EV_SYMBOLev_Evaluate (EV_EXPRESSION *expr, EV_InlineFuncReturnType func_ret_type, int thread)
 
EXPR_API void EXPRftoa (UT_WorkBuffer &buf, fpreal v)
 
EXPR_API void ev_SetExpander (ev_Expander expander)
 
EXPR_API void ev_AddType (EV_TYPEDEF *type)
 
EXPR_API void ev_AddVariableType (EV_TYPEDEF *type, int atEnd)
 
EXPR_API void ev_DeleteVariableType (EV_TYPEDEF *type)
 
EXPR_API void ev_AddOperator (EV_OPERATOR *op, int level)
 
EXPR_API void ev_AddFunction (EV_FUNCTION *func)
 
EXPR_API void ev_DeleteFunction (EV_FUNCTION *func)
 
EXPR_API void ev_SetOptimization (int level)
 
EXPR_API void ev_SetFunctionInstanceAllocator (const char *function, void *(*alloc)(), void(*free)(void *))
 Functions for supplying state data for custom expressions. More...
 
EXPR_API voidev_GetFunctionData (int thread)
 
EXPR_API bool ev_SaveCompiledCode (EV_EXPRESSION *expr, std::ostream &os, int thread)
 
EXPR_API bool ev_LoadCompiledCode (EV_EXPRESSION *expr, UT_IStream &is, int thread)
 
EXPR_API EV_SYMBOLev_AllocSymbol (int type, int thread)
 
EXPR_API void ev_FreeSymbol (EV_SYMBOL *symbol, int thread)
 
EXPR_API void ev_setSafeMode (bool safe_mode)
 
EXPR_API bool ev_isInSafeMode ()
 
EXPR_API bool ev_isKeyword (const char *string)
 

Macro Definition Documentation

#define EV_END_FN (   answer)    result->value.fval = (answer)

Handy macros for defining expression functions. They only differ by which function parameters are supplied to avoid unused parameter warnings.

Definition at line 221 of file EXPR.h.

#define EV_END_FNS (   answer)    result->value.sval = (answer)

Handy macros for defining expression functions. They only differ by which function parameters are supplied to avoid unused parameter warnings.

Definition at line 223 of file EXPR.h.

#define EV_EXFUNC_REF   0x40000000

Refers to an expression function.

Definition at line 83 of file EXPR.h.

#define EV_FLAGS_SET   0x10000000

User flags have been set.

Definition at line 81 of file EXPR.h.

#define EV_FOR_EXFUNC   0x80000000

Symbol is to be used by expr func

Definition at line 84 of file EXPR.h.

#define EV_NHELPARGS   10 /* Maximum # of args in help */

Definition at line 36 of file EXPR.h.

#define EV_OPTIMIZE0   0 /* No optimization */

Definition at line 31 of file EXPR.h.

#define EV_OPTIMIZE1   1 /* Constant folding */

Definition at line 32 of file EXPR.h.

#define EV_START_FN (   name)
Value:
static void name(EV_FUNCTION *, EV_SYMBOL *result,\
EV_SYMBOL **argv, int thread, unsigned &func_flags)
**But if you need a result
Definition: thread.h:613
GLuint const GLchar * name
Definition: glcorearb.h:786
class representing a symbol operated upon by expressions
Definition: EXPR.h:159
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun

Handy macros for defining expression functions. They only differ by which function parameters are supplied to avoid unused parameter warnings.

Examples:
expr/functions.C.

Definition at line 212 of file EXPR.h.

#define EV_START_FNNA (   name)
Value:
static void name(EV_FUNCTION *, EV_SYMBOL *result, \
EV_SYMBOL **, int thread, unsigned &func_flags)
**But if you need a result
Definition: thread.h:613
GLuint const GLchar * name
Definition: glcorearb.h:786
class representing a symbol operated upon by expressions
Definition: EXPR.h:159
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun

Handy macros for defining expression functions. They only differ by which function parameters are supplied to avoid unused parameter warnings.

Definition at line 215 of file EXPR.h.

#define EV_START_FUNC (   name)
Value:
EV_SYMBOL **argv, int thread, unsigned &func_flags)
**But if you need a result
Definition: thread.h:613
GLuint const GLchar * name
Definition: glcorearb.h:786
class representing a symbol operated upon by expressions
Definition: EXPR.h:159
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
GLenum func
Definition: glcorearb.h:783

Handy macros for defining expression functions. They only differ by which function parameters are supplied to avoid unused parameter warnings.

Definition at line 218 of file EXPR.h.

#define EV_SYMCONSTANT   0x08000000

Symbol has a constant value.

Definition at line 80 of file EXPR.h.

#define EV_SYMEXPAND   0x20000000

String should be expanded.

Definition at line 82 of file EXPR.h.

#define EV_SYMTRANSIENT   0x04000000

Symbol is result of operation.

These flags are common to symbols, operators and functions

NOTE: The high 8 bits of the flag are reserved for internal use User flags should start at not go higher than 0x800000

Note: when changing this definition, update EX_USERFLAGMASK

Definition at line 79 of file EXPR.h.

#define EV_TYPE_CPPSYMBOL   45

A symbol inside a function.

Definition at line 115 of file EXPR.h.

#define EV_TYPE_DEFINE   12

A node local variable.

These types are used in Houdini outside of EXPR. DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 112 of file EXPR.h.

#define EV_TYPE_GEOATTRIBUTE   13

An attribute reference.

Definition at line 113 of file EXPR.h.

#define EV_TYPE_GLOBAL_VAR   20

A global variable.

Definition at line 114 of file EXPR.h.

#define EV_TYPE_LOCAL_VAR   10

A node local variable.

These types are used in Houdini outside of EXPR. DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 110 of file EXPR.h.

#define EV_TYPE_UNRESOLVED_CPPSYMBOL   46

An unknown function symbol

Definition at line 116 of file EXPR.h.

#define EV_TYPE_UNRESOLVED_VAR   11

An unknown variable.

Definition at line 111 of file EXPR.h.

#define EV_TYPEEXPANDVAR   4

Variable of form ${foo$x}.

Definition at line 102 of file EXPR.h.

#define EV_TYPEFLOAT   0

Float type of symbol.

Implicit types known by expression language

  • The type identifiers must be positive unique integers
  • Eventhough Variables are handled as a special case, the type identifier for each variable type must be unique
  • It is suggested that applications start their typedefs identifiers 10 or greater. The identifiers do not have to be sequential.

DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 99 of file EXPR.h.

#define EV_TYPEMATRIX   6

Matrix

Definition at line 104 of file EXPR.h.

#define EV_TYPESTRING   1

String type of symbol.

Definition at line 100 of file EXPR.h.

#define EV_TYPEUNIXVAR   2

Unix variable type.

Definition at line 101 of file EXPR.h.

#define EV_TYPEVECTOR   5

Vector.

Definition at line 103 of file EXPR.h.

#define EX_USERFLAGMASK   (0x03ffffff | EV_EXFUNC_REF)

Definition at line 87 of file EXPR.h.

#define MAX_OPERATOR_TOKEN   32

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 69 of file EXPR.h.

#define MAX_RECURSION   20 /* Maximum depth of recursion */

Definition at line 34 of file EXPR.h.

#define OP_AND   22 /* & */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 61 of file EXPR.h.

#define OP_AT   26 /* @ */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 65 of file EXPR.h.

#define OP_BRACE   31 /* { end brace implied */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 67 of file EXPR.h.

#define OP_COLON   21 /* : */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 60 of file EXPR.h.

#define OP_COMMA   16 /* , almost a NOP */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 58 of file EXPR.h.

#define OP_DIVIDE   4 /* / */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 46 of file EXPR.h.

#define OP_DOT   24 /* . */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 63 of file EXPR.h.

#define OP_EQ   8 /* == */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 50 of file EXPR.h.

#define OP_EQUATE   32 /* = */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 68 of file EXPR.h.

#define OP_GE   13 /* >= */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 55 of file EXPR.h.

#define OP_GT   12 /* > */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 54 of file EXPR.h.

#define OP_LE   11 /* <= */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 53 of file EXPR.h.

#define OP_LOGAND   14 /* && (logical and) */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 56 of file EXPR.h.

#define OP_LOGOR   15 /* || (logical or) */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 57 of file EXPR.h.

#define OP_LT   10 /* < */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 52 of file EXPR.h.

#define OP_MINUS   2 /* - */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 44 of file EXPR.h.

#define OP_MOD   6 /* % */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 48 of file EXPR.h.

#define OP_NE   9 /* != */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 51 of file EXPR.h.

#define OP_NOT   7 /* ! */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 49 of file EXPR.h.

#define OP_OR   23 /* | */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 62 of file EXPR.h.

#define OP_PLUS   1 /* + */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 43 of file EXPR.h.

#define OP_POWER   5 /* ^ */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 47 of file EXPR.h.

#define OP_QUESTION   20 /* ? */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 59 of file EXPR.h.

#define OP_SBRACKET   30 /* [ end square bracket implied */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 66 of file EXPR.h.

#define OP_TILDE   25 /* ~ */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 64 of file EXPR.h.

#define OP_TIMES   3 /* * */

Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.

Definition at line 45 of file EXPR.h.

Typedef Documentation

typedef char*(* ev_Expander)(const char *str, int thread)

Definition at line 38 of file EXPR.h.

typedef struct EV_FUNCHELP EV_FUNCHELP

Definition at line 133 of file EXPR.h.

typedef struct EV_OPERATOR EV_OPERATOR

Definition at line 132 of file EXPR.h.

typedef struct EV_SYMTABLE EV_SYMTABLE

Following are the defines/typedefs for the language handler

Definition at line 630 of file EXPR.h.

typedef struct EV_TYPEDEF EV_TYPEDEF

Definition at line 131 of file EXPR.h.

typedef void(* EXPRfuncCallback)(EV_FUNCTION *me, EV_SYMBOL *result, EV_SYMBOL **argv, int thread, unsigned &func_flags)

Definition at line 227 of file EXPR.h.

typedef void(* EXPRopChangeRefCallback)(EV_FUNCTION *me, EV_SYMBOL **argv, char *new_args[], const char *new_fullpath, const char *old_fullpath, const char *old_cwd, const char *chan_name, const char *old_chan_name)

Definition at line 142 of file EXPR.h.

typedef void(* EXPRopDependencyCallback)(EV_FUNCTION *me, EV_SYMBOL **argv, void *ref_id)

This callback is used to scan for op dependencies and add/remove dependencies. Unlike evaluation, this callback can have null arguments. A null argument signifies a non-constant parameter to the function.

Definition at line 139 of file EXPR.h.

Enumeration Type Documentation

This is an enumeration of the type of return values that an inline function may be expected to return. Setting this value to EV_EXPR_RETURN_NONE will disallow an expression from supporting inline functions.

Enumerator
EV_EXPR_RETURN_NONE 
EV_EXPR_RETURN_FLOAT 
EV_EXPR_RETURN_STRING 
EV_EXPR_RETURN_VECTOR 
EV_EXPR_RETURN_MATRIX 

Definition at line 313 of file EXPR.h.

Function Documentation

EXPR_API void ev_AddFunction ( EV_FUNCTION func)

Functions for expansion of library Add operators, type definitions and functions.

Examples:
expr/channel.C, and expr/functions.C.
EXPR_API void ev_AddOperator ( EV_OPERATOR op,
int  level 
)

Functions for expansion of library Add operators, type definitions and functions.

EXPR_API void ev_AddType ( EV_TYPEDEF type)

Functions for expansion of library Add operators, type definitions and functions.

EXPR_API void ev_AddVariableType ( EV_TYPEDEF type,
int  atEnd 
)

Functions for expansion of library Add operators, type definitions and functions.

EXPR_API EV_EXPRESSION* ev_AllocExpr ( EV_InlineFuncReturnType  rettype)
EXPR_API EV_SYMBOL* ev_AllocSymbol ( int  type,
int  thread 
)

Functions used internally by type declarations

EXPR_API int ev_ChangeExpr ( EV_EXPRESSION expr,
const char *  source 
)
EXPR_API int ev_ChangeOpReference ( EV_EXPRESSION expr,
const char *  new_fullpath,
const char *  old_fullpath,
const char *  old_cwd,
const char *  chan_name,
const char *  old_chan_name,
int  thread 
)
EXPR_API void ev_DeleteFunction ( EV_FUNCTION func)

Functions for expansion of library Add operators, type definitions and functions.

EXPR_API void ev_DeleteVariableType ( EV_TYPEDEF type)

Functions for expansion of library Add operators, type definitions and functions.

EXPR_API EV_SYMBOL* ev_Evaluate ( EV_EXPRESSION expr,
EV_InlineFuncReturnType  func_ret_type,
int  thread 
)
EXPR_API fpreal ev_EvaluateFloat ( EV_EXPRESSION expr,
int  thread 
)
EXPR_API int ev_EvaluateMatrix ( EV_EXPRESSION expr,
ev_Matrix result,
int  thread 
)
EXPR_API void ev_EvaluateString ( UT_String result,
EV_EXPRESSION expr,
int  thread 
)
EXPR_API int ev_EvaluateVector ( EV_EXPRESSION expr,
ev_Vector result,
int  thread 
)
EXPR_API int ev_FindFunction ( const char *  name)
EXPR_API void ev_FreeExpr ( EV_EXPRESSION expr)
EXPR_API void ev_FreeSymbol ( EV_SYMBOL symbol,
int  thread 
)

Functions used internally by type declarations

EXPR_API EV_FUNCTION* ev_GetFunction ( int  i)
EXPR_API void* ev_GetFunctionData ( int  thread)

From within an expression function, use this to retrieve the data created by the alloc function specified in ev_SetFunctionInstanceAllocator().

Parameters
threadThread id supplied to the expression function callback
EXPR_API int ev_GetNFunctions ( )
EXPR_API EV_TYPEDEF* ev_GetTypeDef ( int  key)
EXPR_API void ev_InitFloat ( )

initialize floating point operations Float initialization will automatically initialize vector/matrix

EXPR_API void ev_InitMatrix ( )

initialize matrix operations

EXPR_API void ev_InitString ( )

initialize string operations

EXPR_API void ev_InitUserFunc ( )
EXPR_API void ev_InitVariable ( )
EXPR_API void ev_InitVector ( )

initialize vector operations

EXPR_API bool ev_isInSafeMode ( )

These functions put the expression evaluator into/out of "safe" mode. In safe mode, certain functions will not be executed.

EXPR_API bool ev_isKeyword ( const char *  string)

These functions put the expression evaluator into/out of "safe" mode. In safe mode, certain functions will not be executed.

EXPR_API bool ev_LoadCompiledCode ( EV_EXPRESSION expr,
UT_IStream is,
int  thread 
)

These functions save and load compiled expressions.

EXPR_API void ev_PrintHelp ( std::ostream &  os,
const char *  match,
const char *  keyword,
bool  full_match_only = false 
)
EXPR_API bool ev_SaveCompiledCode ( EV_EXPRESSION expr,
std::ostream &  os,
int  thread 
)

These functions save and load compiled expressions.

EXPR_API void ev_SetExpander ( ev_Expander  expander)
EXPR_API void ev_SetFunctionDependencyCallbacks ( const char *  func,
EXPRopDependencyCallback  depend_cb,
EXPRopChangeRefCallback  changeref_cb 
)
Examples:
expr/functions.C.
EXPR_API void ev_SetFunctionInstanceAllocator ( const char *  function,
void *(*)()  alloc,
void(*)(void *)  free 
)

Functions for supplying state data for custom expressions.

This function specifies the constructor/destructor functions for the state data.

Parameters
functionName of the custom expression function
allocThis allocates and initializes the state data
freeThis deallocates the state data
EXPR_API void ev_SetOptimization ( int  level)

Functions for expansion of library Add operators, type definitions and functions.

EXPR_API void ev_setSafeMode ( bool  safe_mode)

These functions put the expression evaluator into/out of "safe" mode. In safe mode, certain functions will not be executed.

EXPR_API void ev_UnresolveVars ( EV_EXPRESSION expr,
int  thread 
)
EXPR_API void ev_UpdateOpDependency ( EV_EXPRESSION expr,
void ref_id,
int  thread 
)
EXPR_API void EXPRftoa ( UT_WorkBuffer buf,
fpreal  v 
)

Nice conversion of float to string data. This will do simple checks to try to convert integer values more correctly.