SMLCONTEXT Struct Reference

The main class used by SML and DBQuery functions. More...

#include <sml.h>

List of all members.

Public Member Functions

void AddNameAlias (const char *NewName, const char *OldName)
int GetArg (SMLARG *args, int numargs, int num, SMLOBJECT **pObject, bool UndefinedOK=false)
int GetArrayIndexBase () const
double GetCancelCheckInterval () const
bool GetCaseSensitiveStrings () const
int GetCodeSize () const
const SMLMACHINEINSTGetCS () const
SMLMACHINEINSTGetCSNonConst () const
void * GetConsole () const
const SMLFUNCGetCurrentFunction () const
UNICODEGetCurrentFunctionName () const
int GetDatabaseHandle (int ElemType) const
SMLSYMBOLGetDestObjectSymbol (int numargs, SMLARG *args, UINT8 *argtype, SMLSTYPE OutSTYPE, UINT32 flags)
const DISPLAYINFOGetDispInfo () const
int GetErrorLine () const
int GetExitOnError () const
SMLSYMBOLGetFieldSymbol (int table, int field)
SMLSYMBOLGetFieldSymbol (SMLSYMBOL *t, SMLSYMBOL *f)
SMLSYMBOLGetForEachRastSym () const
char * GetFuncGroupName (int num) const
int GetFunctionTypeList (char ***namep, int **typep) const
int GetLastError (MISTRING &msg, INT32 *pos=0)
ERRVALUE GetLastError (INT32 *pos=0)
SMLSTRINGGetLastPoppedString () const
int GetMainObject (FILEPATH &filepath, INT32 *inodep) const
int GetNeedLineNumbersInCode () const
int GetNumBreakPoints () const
int GetNumFuncClasses () const
SMLOBJECTGetObjectList () const
const SMLMACHINEINSTRUCTION * GetOpCodeData (int opcode) const
MDLGPARENT GetParentWidget () const
void * GetParentWidgetVoid () const
int GetParserWarningLevel () const
const MISTRINGGetParserWarnings () const
const SIMPLE_ARRAY< SMLFIELDDATA > & GetUnindexedFieldList () const
void SetParserWarningLevel (int level)
const SMLMACHINEINSTGetPC () const
int GetPCList (SMLMACHINEINST ***plist)
ERRVALUE GetPCList (SIMPLE_ARRAY< const SMLMACHINEINST * > &plist)
const SMLSOURCEINFO * GetSourceInfo (const SMLMACHINEINST *pc) const
const SMLPARSEPOS * GetSourcePos (const SMLMACHINEINST *pc) const
bool GetSourceLine (const SMLMACHINEINST *pc, MISTRING &mistr) const
SMLSYMBOLGetPrimaryKeySymbol (SMLSYMBOL *fk_sym)
int GetPrimaryTable (int segment) const
XMLDOCGetXMLDoc () const
int AppendPrintBuffer (const UNICODE *)
int AppendPrintBuffer (const char *)
UNICODEGetPrintBuffer () const
const MISTRINGGetPrintBufferMISTRING () const
char ** GetPrintBufPtr ()
SMLDEVPRIVATEGetPrivData (int pindex) const
int GetProgBase () const
int GetProgPtr () const
char * GetRCSID (SMLSOURCEINFO *fni)
SMLCLASSGetRegisteredClassList () const
int GetRootElemNum () const
int GetRootElemType () const
const FILEPATHGetScriptFilePath () const
INT32 GetScriptInode () const
int GetSegmentDatabaseHandle (int segment) const
int GetSegmentType (int segment=-1) const
int GetSegmentUsage (int segment=-1) const
int GetSegmentElemType (int segment=-1) const
const XMLNODEGetSegmentXMLNode (int segnum) const
int GetSegmentByXMLNode (const XMLNODE *node) const
UINT32 GetStatus () const
MSTATUSCONTEXT GetStatusContext () const
SMLSYMBOLGetStdSym () const
SMLSYMBOLGetSymbol (const char *name) const
SMLSYMBOLGetSymbol (const UNICODE *name) const
int GetSymbolTypeList (char ***namep, int **typep) const
SMLSYMBOLGetSymbolListFuncs (int group=0) const
SMLSYMBOLGetSymbolListGlobal (int level=0) const
SMLSYMBOLGetSymbolListLocal () const
SMLSYMBOLGetSymbolListPerm () const
int GetSymbolNameList (int funcgroup, UNICODE ***names) const
int GetSymbolNameList (int funcgroup, MISTRINGLIST &names, bool bIncludeAliases=true) const
SMLSYMBOLGetTableSymbol (int table)
void SetArgError (int errcode, int argnum, const UNICODE *funcname=0)
void SetCancelCheckInterval (double seconds)
void SetCancelFunc (int(*func)(SMLCONTEXT *, void *), void *data)
void SetCaseSensitiveStrings (bool sensitive=true)
void SetConsole (void *console)
void SetDebugger (SMLDEBUG *debug)
void SetDebuggerCallback (void(*func)(SMLCONTEXT *context, void *DebugData), void *data)
void SetDispInfo (const DISPLAYINFO &info)
int SetErrorCode (int code)
void SetErrorMessageForce (UNICODE *s)
void SetFileHandle (int handle)
void SetNeedLineNumbersInCode (int val)
void SetParentWidget (MDLGPARENT widget)
void SetPrivData (int pindex, SMLDEVPRIVATE *pdata)
void SetScriptFilePath (const FILEPATH &filepath)
void SetScriptInode (INT32 inode)
ERRVALUE SetSegment (int segnum)
void SetSegmentXMLNode (int segnum, const XMLNODE *node)
UINT32 SetStatusBits (UINT32 bits)
void SetStatusContext (MSTATUSCONTEXT status)
void SetStatusFunc (void(*func)(), void *data)
void SetXMLDoc (XMLDOC *doc)
ERRVALUE AddObjectSymbol (const UNICODE *name, int fhandle, INT32 inode, SMLSYMBOL **symp, UINT32 flags=0)
ERRVALUE AddObjectSymbol (const char *name, int fhandle, INT32 inode, SMLSYMBOL **symp, UINT32 flags=0)
ERRVALUE AddObjectSymbol (const UNICODE *name, int ohandle, SMLSYMBOL **symp, UINT32 flags=0)
ERRVALUE AddObjectSymbol (const char *name, int ohandle, SMLSYMBOL **symp, UINT32 flags=0)
void AddOnExit (SMLONEXITDATA *data)
SMLSYMBOLAddSymbol (const UNICODE *name, SMLSTYPE stype)
SMLSYMBOLAddSymbol (const char *name, SMLSTYPE stype)
SMLSYMBOLAddClassSymbol (const UNICODE *name, char *classname, void *ptr)
SMLSYMBOLAddClassSymbol (const char *name, char *classname, void *ptr)
int BreakPointAdd (int offset)
int BreakPointRemove (int offset)
int BreakPointToggle (int offset)
int CallbackAdd (McbCallbackFunc func, void *cbdata, UINT32 reason)
int CallbackRemove (McbCallbackFunc func, void *cbdata, UINT32 reason)
int CallCallbacks (SMLCALLBACKSTRUCT *cbs)
void CallDestructors ()
void CallFunction (SMLSYMBOL *func, SMLARG *args, int numargs, UINT8 *tlist, SMLARG *ret, UINT32 flags=0)
double CallFunction (const char *name, ELEMTYPE elemtype, INT32 element=0)
double CallFunction (const char *name, INT32 element=0)
void ClearPrintBuffer ()
UINT32 ClearStatusBits (UINT32 bits)
void CloseObjects ()
bool CurrentFunctionIsClassMethod () const
int Destroy ()
int Evaluate (int segnum, INT32 element, int ElemType, void *valp)
int Evaluate (int segnum, INT32 element, void *valp)
SMLGEOSTRUCT * GeorefAlloc ()
SMLGEOSTRUCT * GeorefAlloc (bool bUseTempMem)
SMLGEOSTRUCT * GeorefCopy (const SMLGEOSTRUCT *src)
SMLGEOSTRUCT * GeorefCopy (const SMLGEOSTRUCT *src, bool bUseTempMem)
void GeorefFree (SMLGEOSTRUCT *georef)
bool HasBreakPoint (int offset) const
bool HasCancelFunc () const
int InstallClass (SMLCLASS *staticClass)
int InstallEnum (const char *name, SMLFLAG *smlflags, UINT32 flags)
int InstallEnum (const char *name, int(*func)(SMLCONTEXT *, void *, SMLFLAG **), void *funcdata, UINT32 flags)
int InstallFunctionList (SMLFUNCINSTALLER *funclist)
int InstallFunctions (const char *symclass, const SMLFUNC *vfuncs)
void InstallSMLOnlyFunctions ()
bool IsBeingDestroied () const
void List (FILE *file)
void List (MISTRING &)
int ListLine (const SMLMACHINEINST *c, bool bIgnoreBad, bool bMarkIt, MISTRING &buf)
int ListLine (const SMLMACHINEINST *c, bool bIgnoreBad, bool bMarkIt, UNICODE *buf, int len)
SMLFLAGLookupEnumList (const char *name)
SMLFLAGLookupEnumList (char *name)
SMLOBJECTObjectAlloc (SMLSTYPE stype)
int ObjectAlloc (SMLRASTEROBJECT **)
int ObjectAlloc (SMLVECTOROBJECT **)
int ObjectAlloc (SMLCADOBJECT **)
int ObjectAlloc (SMLTINOBJECT **)
int ObjectAlloc (SMLREGIONOBJECT **)
int Optimize ()
void OutstandingDestroysDec ()
int OutstandingDestroysGet () const
void OutstandingDestroysInc ()
int Parse (int segnum, const UNICODE *str, UINT32 flags=0)
int PrivDataIndexAlloc ()
void RecycleStrings (bool FreeStringsInCodeToo=false)
void RegisterObjectCloseFunc (SMLSTYPE stype, int(*func)(SMLCONTEXT *, SMLOBJECT *))
int ResolveClassMembers (FILE *MissingClassFile=NULL)
int Run (int segnum, UINT32 flags=0)
int SegmentCreate (int qtype, int ElemType, int table=-1)
int SegmentDestroy (int segment)
int TestCancelOnce ()
int SetupObjectDatabase (SMLOBJECT *obj, int dbid, SMLELEMDATA *ElemData, int ElemType, RVCDBASEINFO *info, int infosize, bool fromcb=false)
int Stop (bool bCanDestroyContext)
int Stop ()
SMLSTRINGStringAlloc (const char *str)
SMLSTRINGStringAlloc (const UINT8 *str)
SMLSTRINGStringAlloc (const UNICODE *str)
void StringFree (SMLSTRING *)
void * TempMemAlloc (int size, UINT32 flags=0)
void TempMemHandleFree (LINKEDLIST *list, SMLTEMPMEMHANDLE *handle)
int TempMemMarkAsOffStack (void *ptr, UINT32 flags=0)
void TempMemMarkAsOnStack (void *ptr, SMLCLASS *itemclass, UINT32 flags=0)
void * TempMemRegister (void *ptr, void(*Free)(void *), UINT32 flags=0)
void * TempMemRegister (void *ptr, UINT32 flags=0)
SMLSYMBOLTempObjectSymbolAlloc (SMLSTYPE stype)
void TempObjectSymbolFree (SMLSYMBOL *)
void VMExecute (SMLMACHINEINST *pc)
int VMReset ()
ERRVALUE MemAlloc (void **pRet, UINT32 size)
ERRVALUE MemAllocC (void **pRet, UINT32 size)
void MemFree (void *ptr)

Static Public Member Functions

char * GetOperator (int num)
char * GetOperatorHelp (int num)
char * GetOperatorDescription (int num)
char ** GetOperatorList ()
char * STYPEtoString (SMLSTYPE stype)
int STYPEFlags (SMLSTYPE stype)
int STYPEToTokenVal (SMLSTYPE stype)
SMLSTYPE TokenValToSTYPE (int tval)
int CallbackAddGlobal (McbCallbackFunc func, void *cbdata, UINT32 reason)
int CallbackRemoveGlobal (McbCallbackFunc func, void *cbdata, UINT32 reason)


Detailed Description

The main class used by SML and DBQuery functions.

NOTE: This must follow the MicroImages rules for classes defined in a DLL. Mainly...

  1. No virtual functions (vtable order could change if you add functions
  2. Don't remove any methods. There's code out there using them
  3. Don't change the signature of any methods. If you do, you still have to keep the old ones around. This is for the same reason as #2.

Definition at line 5452 of file sml.h.


Member Function Documentation

SMLSYMBOL* SMLCONTEXT::AddClassSymbol const char *  name,
char *  classname,
void *  ptr
 

Add a class symbol to the context (char*) name.

See details in the (UNICODE*) version of this method

Returns:
the symbol added
Parameters:
name  Symbol name
classname  SML class name (SMLCLASSNAME_...)
ptr  Pointer to the data the symbol represents

SMLSYMBOL* SMLCONTEXT::AddClassSymbol const UNICODE name,
char *  classname,
void *  ptr
 

Add a class symbol to the context (UNICODE*) name.

This would let you add, for example, a COLOR symbol for use in a query.

Returns:
the symbol added
Parameters:
name  Symbol name
classname  SML class name (SMLCLASSNAME_...)
ptr  Pointer to the data the symbol represents

void SMLCONTEXT::AddNameAlias const char *  NewName,
const char *  OldName
 

Setup an alias for a class of function Exiting scripts will be able to refer to the class or function using OldName, but will get a parser warning that the name has changed.

Note: both names must be string literals or static. The context only keeps the pointers

ERRVALUE SMLCONTEXT::AddObjectSymbol const char *  name,
int  ohandle,
SMLSYMBOL **  symp,
UINT32  flags = 0
 

For an open object, (char*) name.

Parameters:
ohandle  Open object handle

ERRVALUE SMLCONTEXT::AddObjectSymbol const UNICODE name,
int  ohandle,
SMLSYMBOL **  symp,
UINT32  flags = 0
 

For an open object, (UNICOCE*) name.

Parameters:
ohandle  Open object handle

ERRVALUE SMLCONTEXT::AddObjectSymbol const char *  name,
int  fhandle,
INT32  inode,
SMLSYMBOL **  symp,
UINT32  flags = 0
 

Add symbol referring to object using 'char*' name.

Parameters:
fhandle  RVC file handle

ERRVALUE SMLCONTEXT::AddObjectSymbol const UNICODE name,
int  fhandle,
INT32  inode,
SMLSYMBOL **  symp,
UINT32  flags = 0
 

Add symbol referring to object using 'UNICODE*' name.

Parameters:
fhandle  RVC file handle

void SMLCONTEXT::AddOnExit SMLONEXITDATA *  data  ) 
 

Add an OnExit entry to the OnExitList.

SMLSYMBOL* SMLCONTEXT::AddSymbol const char *  name,
SMLSTYPE  stype
 

Add a symbol to the context (char*) name.

Returns:
the symbol added

SMLSYMBOL* SMLCONTEXT::AddSymbol const UNICODE name,
SMLSTYPE  stype
 

Add a symbol to the context (UNICODE*) name.

Returns:
the symbol added

int SMLCONTEXT::AppendPrintBuffer const char *   ) 
 

Append an ISO-2022 string to the print buffer.

int SMLCONTEXT::AppendPrintBuffer const UNICODE  ) 
 

Append a Unicode string to the print buffer.

int SMLCONTEXT::BreakPointAdd int  offset  ) 
 

Add a breakpoint at the current offset.

(offset = pc - cs)

int SMLCONTEXT::BreakPointRemove int  offset  ) 
 

Remove a breakpoint from the current offset.

(offset = pc - cs)

int SMLCONTEXT::BreakPointToggle int  offset  ) 
 

Toggle a breakpoint at the current offset.

(offset = pc - cs)

int SMLCONTEXT::CallbackAdd McbCallbackFunc  func,
void *  cbdata,
UINT32  reason
 

Add a callback.

For a list of possible callback reasons

See also:
SMLCALLBACKSTRUCT

int SMLCONTEXT::CallbackAddGlobal McbCallbackFunc  func,
void *  cbdata,
UINT32  reason
[static]
 

Add a callback to the Global callback list.

For a list of possible callback reasons

See also:
SMLCALLBACKSTRUCT

int SMLCONTEXT::CallbackRemove McbCallbackFunc  func,
void *  cbdata,
UINT32  reason
 

Remove a callback.

For a list of possible callback reasons

See also:
SMLCALLBACKSTRUCT

int SMLCONTEXT::CallbackRemoveGlobal McbCallbackFunc  func,
void *  cbdata,
UINT32  reason
[static]
 

Remove a callback from the Global callback list.

For a list of possible callback reasons

See also:
SMLCALLBACKSTRUCT

int SMLCONTEXT::CallCallbacks SMLCALLBACKSTRUCT cbs  ) 
 

Call the callback list.

For a list of possible callback reasons

See also:
SMLCALLBACKSTRUCT

void SMLCONTEXT::CallDestructors  ) 
 

Call the destructors symbols pointing to class data.

This calls SMLSYMBOLL::DisposeOFContents() for all STYPE_ClassVar symbols

double SMLCONTEXT::CallFunction const char *  name,
INT32  element = 0
 

Calls the named function.

Looks up a built-in or user-defined function by name and calls it with no parameters. Also sets the current element like SMLCONTEXT::Evaluate().

There's a more flexible version of this function which takes a list of parameters to be passed to the function.

Note:
This only works for procedures (no return value) or functions that return numeric values. It call any other type of function, you must use the other version of CallFunction().
Returns:
The value returned by the function or 0 if it was a procedure.

Deprecated:
Use the one that also takes an ELEMTYPE, as this one is dependant on previous state information for elemtype and could be wrong.

double SMLCONTEXT::CallFunction const char *  name,
ELEMTYPE  elemtype,
INT32  element = 0
 

Calls the named function.

Looks up a built-in or user-defined function by name and calls it with no parameters. Also sets the current element like SMLCONTEXT::Evaluate().

There's a more flexible version of this function which takes a list of parameters to be passed to the function.

Note:
This only works for procedures (no return value) or functions that return numeric values. It call any other type of function, you must use the other version of CallFunction().
Returns:
The value returned by the function or 0 if it was a procedure.

void SMLCONTEXT::CallFunction SMLSYMBOL func,
SMLARG args,
int  numargs,
UINT8 tlist,
SMLARG ret,
UINT32  flags = 0
 

Call a function pointed to by a given symbol.

This is used internally to call both user-defined and built-in SML functions. One possible use for this function would be to see if a query has some user-defined function in it and if so, call it once before drawing. For example:

          UINT8 type = SMLSTYPE_Class;
          SMLARG arg, ret; 
          SMLSYMBOL* func;
          arg.ptr = layer;          // Layer about to be drawn
      
          func = context->GetSymbol("OnDrawBegin");
          if (func) contesxt->CallFunction(func, args, 1, types, &ret);
          // Do the drawing here
          func = context->GetSymbol("OnDrawEnd");
          if (func) contesxt->CallFunction(func, args, 1, types, &ret);
Parameters:
func  SMLSYMBOL of function to call
args  List of arguments to pass
numargs  Number of arguments in "args"
tlist  SMLSTYPEs of the args
ret  Return value
flags  1 means opCALL, 0 means callback

void SMLCONTEXT::ClearPrintBuffer  ) 
 

Clears the buffer used by printf functions.

When running in an SML context, printf prints to a console window and there is no print buffer. In all other contexts, printf functions append text to a buffer which the caller can retrieve.

UINT32 SMLCONTEXT::ClearStatusBits UINT32  bits  ) 
 

Clear one or more status bits.

void SMLCONTEXT::CloseObjects  ) 
 

Closes all open objects.

This is done automatically when the script exits.

bool SMLCONTEXT::CurrentFunctionIsClassMethod  )  const
 

Returns true if the current function is a class method.

This is for use in built-in functions. If it returns true, then args[-1] is a pointer to "this". This is useful when you have an existing function that takes a pointer to a class as its first member and want to make it do double duty as a class method. For example, the SML function ViewRedraw() takes a view (args[0] and a flag (args[1]). As a class method, it would take the same parameters but view would be args[-1] and the flags args[0]) Note that this is only valid for functions which match the prototype whatever FuncName(int numargs, SMLARG* args, UINT8* type, SMLCONTEXT* context)

int SMLCONTEXT::Destroy  ) 
 

Destroy the context.

Will free it as well, so don't access the context after calling this function. If we were using constructor/desctructors for this, this would be the destructor. However, If any widget destroy callbacks have been registered, the actual context will stick around until the last of them has been called.

int SMLCONTEXT::Evaluate int  segnum,
INT32  element,
void *  valp
 

Evaluate a query for a given element Uses the element type given when the segment was created.

int SMLCONTEXT::Evaluate int  segnum,
INT32  element,
int  ElemType,
void *  valp
 

Evaluate a query for a given element of a given type Might be better to call the other version of this method which does not take an elemtype.

SMLGEOSTRUCT* SMLCONTEXT::GeorefAlloc bool  bUseTempMem  ) 
 

Allocate an SMLGEOSTRUCT.

Code outside rvcapp.dll cannot construct SMLGEOSTRUCTs since the size of the struct is private This verion allows allocation with temporary memory. Would be implemented as just one function with a default of false, but old code will expect the parameterless version to be exported from the DLL, so we have to keep it around

SMLGEOSTRUCT* SMLCONTEXT::GeorefAlloc  ) 
 

Allocate an SMLGEOSTRUCT.

Code outside rvcapp.dll cannot construct SMLGEOSTRUCTs since the size of the struct is private

SMLGEOSTRUCT* SMLCONTEXT::GeorefCopy const SMLGEOSTRUCT *  src,
bool  bUseTempMem
 

Copy an SMLGEOSTRUCT Would be implemented as just one function with a default of false, but old code will expect the parameterless version to be exported from the DLL, so we have to keep it around.

SMLGEOSTRUCT* SMLCONTEXT::GeorefCopy const SMLGEOSTRUCT *  src  ) 
 

Copy an SMLGEOSTRUCT.

void SMLCONTEXT::GeorefFree SMLGEOSTRUCT *  georef  ) 
 

Free an SMLGEOSTRUCT.

int SMLCONTEXT::GetArg SMLARG args,
int  numargs,
int  num,
SMLOBJECT **  pObject,
bool  UndefinedOK = false
 

Get an argument from the argument list Can return an error if the argument is invalid in this case, the SML ErrorCode has already been set and you just have to return.

Note, the args/numargs parameters are in the opposite order of the old function. I thought that was a stupid order.

int SMLCONTEXT::GetArrayIndexBase  )  const
 

Get the array index base (normally 1, but can be overridden).

double SMLCONTEXT::GetCancelCheckInterval  )  const
 

Return the time in seconds between each cancel check.

bool SMLCONTEXT::GetCaseSensitiveStrings  )  const
 

Return whether or not string comparisons should be case sensitive.

int SMLCONTEXT::GetCodeSize  )  const
 

Get the size of the bytecode in memory.

void* SMLCONTEXT::GetConsole  )  const
 

Returns the console handle.

const SMLMACHINEINST* SMLCONTEXT::GetCS  )  const
 

Get the current Code Segment (CS) (const).

SMLMACHINEINST* SMLCONTEXT::GetCSNonConst  )  const
 

Get the current Code Segment (CS) (non-const).

const SMLFUNC* SMLCONTEXT::GetCurrentFunction  )  const
 

Return the SMLFUNC* of the current function.

This is only valid while running, not parsing.

UNICODE* SMLCONTEXT::GetCurrentFunctionName  )  const
 

Return the name of the current function.

This is only valid while running, not parsing. This should return a (const UNICODE *), but not all the places that need it know about const yet.

int SMLCONTEXT::GetDatabaseHandle int  ElemType  )  const
 

Get the database handle for a given element type Do NOT close this!

SMLSYMBOL* SMLCONTEXT::GetDestObjectSymbol int  numargs,
SMLARG args,
UINT8 argtype,
SMLSTYPE  OutSTYPE,
UINT32  flags
 

Return symbol for return value of a function returning an object.

This is a magic function. Given the arguments, it returns a symbol pointing to the destination symbol. If it has to, it makes a new temporary symbol and returns that. However, it first looks at the next instruction in the code. If it's an opOBJASGN, it returns the next symbol on the stack (args[-1]), which will be the variable that opOBJASGN will assign into. It then adjusts the PC to skip the assignment instruction and adjusts the frame pointer to make the dest variable pop off with the rest of the function parameters when the funtion returns.

Allowable flags:

  • DESTOBJ_OutputCantBeInput If not set, looks to see if any input is a temp symbol. If so, return it.
  • DESTOBJ_DeleteExisting If symbol points to something, delete it. (just the object, not the file) Must keep the same name/description, which are in the object info.
  • DESTOBJ_CreateEmpty Same as DESTOBJ_DeleteExisting, but then creates an empty object with the same name, etc.
Parameters:
numargs  number of arguments passed to SML func
args  SML function's argument list
argtype  SML functions's argument types
OutSTYPE  STYPE of the object to be returned
flags  Flags (see above)

const DISPLAYINFO* SMLCONTEXT::GetDispInfo  )  const
 

Returns the display info set by previous call to SetDispInfo.

SML doesn't use this information except to pass it through to the script is _context.DisplayInfo

int SMLCONTEXT::GetErrorLine  )  const
 

Returns the line of the last error.

int SMLCONTEXT::GetExitOnError  )  const
 

Returns true if we want scripts to exit on errors.

We let the script change this and a few SML functions return error codes rather than causing the script to exit.

SMLSYMBOL* SMLCONTEXT::GetFieldSymbol SMLSYMBOL t,
SMLSYMBOL f
 

Return the SMLSYMBOL of a database field.

This version only used by the parser.

SMLSYMBOL* SMLCONTEXT::GetFieldSymbol int  table,
int  field
 

Return the SMLSYMBOL of a database field.

Parameters:
table  Table number
field  Field number

SMLSYMBOL* SMLCONTEXT::GetForEachRastSym  )  const
 

Returns the current raster being processed by a "foreach" or NULL if none.

char* SMLCONTEXT::GetFuncGroupName int  num  )  const
 

Get the name of a function group (don't free this) Maybe this should return const? Should it look up the name in messages.txt for us or should the caller? (Currently we expect the caller to do that).

int SMLCONTEXT::GetFunctionTypeList char ***  namep,
int **  typep
const
 

Returns function types and names for the "Insert Function" dialogs.

ERRVALUE SMLCONTEXT::GetLastError INT32 pos = 0  ) 
 

Returns the last error code, and (optionally) position where the error occured.

Calling this function also clears the error condition If error occured in an include file, pos returned will be -1 to tell us not to try to move the cursor (not in the text widget)

int SMLCONTEXT::GetLastError MISTRING msg,
INT32 pos = 0
 

Returns the last error code, message and position where the error occured.

Calling this function also clears the error condition If error occured in an include file, pos returned will be -1 to tell us not to try to move the cursor (not in the text widget)

SMLSTRING* SMLCONTEXT::GetLastPoppedString  )  const
 

Retrieves the last SMLSTRING to be popped from the stack.

Note:
The string returned can be modified (I don't know why you would), but don't free it!

int SMLCONTEXT::GetMainObject FILEPATH filepath,
INT32 inodep
const
 

Returns the filename/inode of the main object this query is for.

int SMLCONTEXT::GetNeedLineNumbersInCode  )  const
 

Will return true if the parser needs to emit opLINE codes for the debugger.

(Used to interleave source and assembly)

int SMLCONTEXT::GetNumBreakPoints  )  const
 

Returns the current number of breakpoints set in the debugger.

int SMLCONTEXT::GetNumFuncClasses  )  const
 

Get the number of function groups.

SMLOBJECT* SMLCONTEXT::GetObjectList