Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Attributes | Friends
ost::ScriptCommand Class Reference

This class holds the bound keyword set for a given Bayonne style script interpreter. More...

#include <script3.h>

Inheritance diagram for ost::ScriptCommand:
Inheritance graph
[legend]
Collaboration diagram for ost::ScriptCommand:
Collaboration graph
[legend]

Data Structures

struct  _keyword
 

Public Types

enum  scrAccess {
  scrPUBLIC, scrPROTECTED, scrPRIVATE, scrFUNCTION,
  scrLOCAL
}
 
typedef enum scrAccess scrAccess
 
enum  symType {
  symNORMAL = 0, symCONST, symDYNAMIC, symFIFO,
  symSEQUENCE, symSTACK, symCOUNTER, symPOINTER,
  symREF, symARRAY, symASSOC, symINITIAL,
  symNUMBER, symLOCK, symPROPERTY, symORIGINAL,
  symMODIFIED, symTIMER, symBOOL
}
 
typedef enum symType symType
 
typedef bool(ScriptInterp::* Method )(void)
 
typedef const char
*(ScriptCommand::* 
Check )(Line *line, ScriptImage *img)
 
typedef bool(* Cond )(ScriptInterp *interp, const char *v)
 
typedef long(* Function )(long *args, unsigned prec)
 
typedef const char *(* Meta )(ScriptInterp *interp, const char *token)
 
typedef const char *(* Parse )(ScriptCompiler *img, const char *token)
 
typedef void(* Init )(void)
 
typedef struct ost::Script::_symbol Symbol
 
typedef struct ost::Script::_array Array
 

Public Member Functions

virtual bool isInput (Line *line)
 Checks if the line statement is an input statement. More...
 
Method getHandler (const char *keyword)
 Get the method handler associated with a given keyword. More...
 
bool control (char **args)
 Issue a control event against current image for attached modules until claimed. More...
 
ScriptImagegetActive (void)
 Get the active script. More...
 
const char * getTrapName (unsigned id)
 Get the name of a trap from it's id. More...
 
void aliasModule (const char *id, const char *use)
 Alias use modules... More...
 
virtual void errlog (const char *level, const char *text)
 Server level logging interface override. More...
 
 ScriptCommand ()
 Create an initialized script command box. More...
 
 ScriptCommand (ScriptCommand *ini)
 Create a ScriptCommand box initialized from another. More...
 
unsigned getActivity (void)
 Get activity counter. More...
 
unsigned getIndex (char **data, unsigned max)
 Get an index array of ALL keywords that are stored by the current keydata object. More...
 
void load (const char *keypath)
 Load additional key values into the currrent object from the specfied config source (a config file/section pair). More...
 
void load (Define *pairs)
 Load default keywords into the current object. More...
 
void loadPrefix (const char *prefix, const char *keypath)
 Load additional key values into the currrent object from the specfied config source (a config file/section pair). More...
 
void loadFile (const char *filepath, const char *keys=NULL, const char *pre=NULL)
 Load additional keys into the current object using a real filename that is directly passed rather than a computed key path. More...
 
void unlink (void)
 Unlink the keydata object from the cache file stream. More...
 
int getCount (const char *sym)
 Get a count of the number of data "values" that is associated with a specific keyword. More...
 
const char * getFirst (const char *sym)
 Get the first data value for a given keyword. More...
 
const char * getLast (const char *sym)
 Get the last (most recently set) value for a given keyword. More...
 
bool isKey (const char *sym)
 Find if a given key exists. More...
 
const char * getString (const char *sym, const char *def=NULL)
 Get a string value, with an optional default if missing. More...
 
long getLong (const char *sym, long def=0)
 Get a long value, with an optional default if missing. More...
 
bool getBool (const char *key)
 Get a bool value. More...
 
double getDouble (const char *key, double def=0.)
 Get a floating value. More...
 
void setValue (const char *sym, const char *data)
 Set (replace) the value of a given keyword. More...
 
const char *const * getList (const char *sym)
 Return a list of all values set for the given keyword returned in order. More...
 
void clrValue (const char *sym)
 Clear all values associated with a given keyword. More...
 
const char * operator[] (const char *keyword)
 A convient notation for accessing the keydata as an associative array of keyword/value pairs through the [] operator. More...
 
void nameMutex (const char *name)
 Enable setting of mutex name for deadlock debug. More...
 
void enterMutex (void)
 Entering a Mutex locks the mutex for the current thread. More...
 
void enter (void)
 Future abi will use enter/leave/test members. More...
 
void leave (void)
 Future abi will use enter/leave/test members. More...
 
bool test (void)
 Future abi will use enter/leave/test members. More...
 
bool tryEnterMutex (void)
 Tries to lock the mutex for the current thread. More...
 
void leaveMutex (void)
 Leaving a mutex frees that mutex for use by another thread. More...
 

Static Public Member Functions

static const char * findKeyword (Line *line, const char *keyword)
 Test for a specific keyword. More...
 
static const char * findKeyword (ScriptImage *img, Line *line, const char *keyword)
 Test for a specific keyword or keydata filler. More...
 
static bool useKeywords (Line *line, const char *list)
 Test current command against a list of valid keywords. More...
 
static unsigned getCount (Line *line)
 Count non-keyword arguments. More...
 
static const char * getMember (Line *line)
 Get the member id code of a line. More...
 
static void end (void)
 static member to end keydata i/o allocations. More...
 
static void setDebug (bool mode)
 Enable or disable deadlock debugging. More...
 
static bool isScript (Name *scr)
 
static bool isSymbol (const char *id)
 
static bool use (const char *name)
 
static unsigned getIndex (const char *id)
 
static Symbolderef (Symbol *sym)
 
static bool commit (Symbol *sym, const char *value)
 
static bool append (Symbol *sym, const char *value)
 
static bool symindex (Symbol *sym, short offset)
 
static const char * extract (Symbol *sym)
 
static unsigned count (Symbol *sym)
 
static unsigned storage (Symbol *sym)
 
static void clear (Symbol *sym)
 
static void addFunction (const char *name, unsigned count, Function i)
 
static void addConditional (const char *name, Cond test)
 
static bool isPrivate (Name *scr)
 
static bool isFunction (Name *scr)
 

Data Fields

class __EXPORT Line
 
class __EXPORT Name
 

Static Public Attributes

static bool fastStart
 
static bool useBigmem
 
static unsigned fastStepping
 
static unsigned autoStepping
 
static size_t pagesize
 
static unsigned symsize
 
static unsigned symlimit
 
static char decimal
 
static bool use_definitions
 
static bool use_macros
 
static bool use_prefix
 
static bool use_merge
 
static bool use_funcs
 
static const char * plugins
 
static const char * altplugins
 
static const char * access_user
 
static const char * access_pass
 
static const char * access_host
 
static bool exec_funcs
 
static const char * exec_extensions
 
static const char * exec_token
 
static const char * exec_prefix
 
static const char * exit_token
 
static const char * apps_extensions
 
static const char * apps_prefix
 
static const char * etc_prefix
 
static const char * var_prefix
 
static const char * log_prefix
 

Protected Member Functions

virtual const char * getExternal (const char *opt)
 
bool isInitial (const char *keyword)
 Fetch whether the given keyword is valid for constructor. More...
 
const char * check (char *command, Line *line, ScriptImage *img)
 Check keyword syntax. More...
 
virtual unsigned getTrapId (const char *name)
 Get the trap id number associated with a trap name. More...
 
virtual unsigned long getTrapDefault (void)
 Get the mask bits for the default script. More...
 
virtual unsigned long getTrapHandler (Name *script)
 Get the mask bits for a trap "handler". More...
 
virtual unsigned long getTrapMask (unsigned id)
 Get a trap mask for a given identifer. More...
 
virtual unsigned long getTrapModifier (const char *name)
 A helper method for the compiler. More...
 
virtual unsigned long getTrapMask (const char *name)
 A helper method for the compiler used specifically for "^" trap subsection requests. More...
 
void load (Script::Define *keywords)
 Load a set of keywords into the system keyword table. More...
 
int trap (const char *name, bool inherited=true)
 Add a trap handler symbolic identity to the keyword table. More...
 
unsigned getCount (void)
 Get count of active traps. More...
 
bool isInherited (unsigned id)
 Return true if the trap id is inherited. More...
 
virtual const char * check (Check chk, Line *line, ScriptImage *img)
 Perform compile time check of a specified symbol. More...
 
KeysymgetSymbol (const char *sym, bool create)
 
virtual void * first (size_t size)
 Allocate first workspace from paged memory. More...
 
char * first (char *str)
 Allocate a string from the memory pager pool and copy the string into it's new memory area. More...
 
virtual void * alloc (size_t size)
 Allocate memory from either the currently active page, or allocate a new page for the object. More...
 
char * alloc (const char *str)
 Allocate a string from the memory pager pool and copy the string inti it's new memory area. More...
 
void purge (void)
 purge the current memory pool. More...
 
void clean (void)
 Clean for memory cleanup before exiting. More...
 
int getPages (void)
 Return the total number of pages that have been allocated for this memory pool. More...
 

Static Protected Member Functions

static bool hasKeywords (Line *line)
 Test current command to see if it uses keyword syntax. More...
 
static bool useMember (Line *line, const char *list)
 Check the member list. More...
 
static const char * getOption (Line *line, unsigned *index)
 Get an option to examine in check routine. More...
 

Protected Attributes

bool ripple
 
unsigned activity
 

Static Protected Attributes

static ScriptCommandruntime
 
static Testtest
 
static Funifun
 

Private Types

typedef struct
ost::ScriptCommand::_keyword 
Keyword
 

Private Attributes

ThreadQueuetq
 
Keywordkeywords [KEYDATA_INDEX_SIZE]
 
char * traps [(sizeof(unsigned long)*8)]
 
ScriptImageactive
 
unsigned keyword_count
 
unsigned trap_count
 
unsigned long imask
 
unsigned dbcount
 
void * dbc
 

Friends

class __EXPORT ScriptImage
 
class __EXPORT ScriptInterp
 
class __EXPORT ScriptCompiler
 
class __EXPORT ScriptBinder
 

Detailed Description

This class holds the bound keyword set for a given Bayonne style script interpreter.

Application specific dialects are created by deriving a application specific version of ScriptCommand which then binds application specific keywords and associated methods in an application derived ScriptInterp which are typecast to (scriptmethod_t).

Author
David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m Bayonne script keyword binding tables and compiler constants.

Definition at line 343 of file script3.h.

Member Typedef Documentation

typedef struct ost::Script::_array ost::Script::Array
inherited
typedef const char*(ScriptCommand::* ost::Script::Check)(Line *line, ScriptImage *img)
inherited

Definition at line 106 of file script3.h.

typedef bool(* ost::Script::Cond)(ScriptInterp *interp, const char *v)
inherited

Definition at line 107 of file script3.h.

typedef long(* ost::Script::Function)(long *args, unsigned prec)
inherited

Definition at line 108 of file script3.h.

typedef void(* ost::Script::Init)(void)
inherited

Definition at line 111 of file script3.h.

typedef const char*(* ost::Script::Meta)(ScriptInterp *interp, const char *token)
inherited

Definition at line 109 of file script3.h.

typedef bool(ScriptInterp::* ost::Script::Method)(void)
inherited

Definition at line 105 of file script3.h.

typedef const char*(* ost::Script::Parse)(ScriptCompiler *img, const char *token)
inherited

Definition at line 110 of file script3.h.

typedef enum scrAccess ost::Script::scrAccess
inherited

Definition at line 121 of file script3.h.

typedef struct ost::Script::_symbol ost::Script::Symbol
inherited
typedef enum symType ost::Script::symType
inherited

Definition at line 145 of file script3.h.

Member Enumeration Documentation

enum ost::Script::scrAccess
inherited
Enumerator
scrPUBLIC 
scrPROTECTED 
scrPRIVATE 
scrFUNCTION 
scrLOCAL 

Definition at line 113 of file script3.h.

enum ost::Script::symType
inherited
Enumerator
symNORMAL 
symCONST 
symDYNAMIC 
symFIFO 
symSEQUENCE 
symSTACK 
symCOUNTER 
symPOINTER 
symREF 
symARRAY 
symASSOC 
symINITIAL 
symNUMBER 
symLOCK 
symPROPERTY 
symORIGINAL 
symMODIFIED 
symTIMER 
symBOOL 

Definition at line 123 of file script3.h.

Constructor & Destructor Documentation

ost::ScriptCommand::ScriptCommand ( )

Create an initialized script command box.

ost::ScriptCommand::ScriptCommand ( ScriptCommand ini)

Create a ScriptCommand box initialized from another.

Member Function Documentation

static void ost::Script::addConditional ( const char *  name,
Cond  test 
)
staticinherited
static void ost::Script::addFunction ( const char *  name,
unsigned  count,
Function  i 
)
staticinherited
void ost::ScriptCommand::aliasModule ( const char *  id,
const char *  use 
)

Alias use modules...

Parameters
idto alias.
idto use.
virtual void* MemPager::alloc ( size_t  size)
protectedvirtualinherited

Allocate memory from either the currently active page, or allocate a new page for the object.

Parameters
sizesize of memory to allocate.
Returns
pointer to allocated memory.

Reimplemented in SharedMemPager.

char* MemPager::alloc ( const char *  str)
protectedinherited

Allocate a string from the memory pager pool and copy the string inti it's new memory area.

This checks only the last active page for available space before allocating a new page.

Parameters
strstring to allocate and copy into paged memory pool.
Returns
copy of string from allocated memory.
static bool ost::Script::append ( Symbol sym,
const char *  value 
)
staticinherited
const char* ost::ScriptCommand::check ( char *  command,
Line line,
ScriptImage img 
)
protected

Check keyword syntax.

Returns
syntax error string or NULL.
Parameters
commandname of keyword to check.
linepointer to line being compiled.
imgpointer to image being compiled.
virtual const char* ost::ScriptCommand::check ( Check  chk,
Line line,
ScriptImage img 
)
protectedvirtual

Perform compile time check of a specified symbol.

Returns
syntax error message string.
Parameters
chkobject pointer to check member function.
linepointer to line being checked.
imgpointer to image being compiled.
void MemPager::clean ( void  )
protectedinherited

Clean for memory cleanup before exiting.

static void ost::Script::clear ( Symbol sym)
staticinherited
void Keydata::clrValue ( const char *  sym)
inherited

Clear all values associated with a given keyword.

This does not de-allocate the keyword from memory, however.

Returns
keyword name to clear.
static bool ost::Script::commit ( Symbol sym,
const char *  value 
)
staticinherited
bool ost::ScriptCommand::control ( char **  args)

Issue a control event against current image for attached modules until claimed.

Parameters
argslist of control command and arguments.
Returns
true if processed.
static unsigned ost::Script::count ( Symbol sym)
staticinherited
static Symbol* ost::Script::deref ( Symbol sym)
staticinherited
static void Keydata::end ( void  )
staticinherited

static member to end keydata i/o allocations.

void Mutex::enter ( void  )
inlineinherited

Future abi will use enter/leave/test members.

Definition at line 263 of file thread.h.

void Mutex::enterMutex ( void  )
inherited

Entering a Mutex locks the mutex for the current thread.

This also can be done using the ENTER_CRITICAL macro or by using the ++ operator on a mutex.

See Also
leaveMutex
virtual void ost::ScriptCommand::errlog ( const char *  level,
const char *  text 
)
virtual

Server level logging interface override.

Parameters
levelof log message.
textof message.
static const char* ost::Script::extract ( Symbol sym)
staticinherited
static const char* ost::ScriptCommand::findKeyword ( Line line,
const char *  keyword 
)
static

Test for a specific keyword.

Returns
content of keyword that is found.
Parameters
linepointer to record to examine in check routine.
keywordto search for.
static const char* ost::ScriptCommand::findKeyword ( ScriptImage img,
Line line,
const char *  keyword 
)
static

Test for a specific keyword or keydata filler.

Returns
content of keyword that is found.
Parameters
scriptimage for keydata.
linepointer to record to examine in check routine.
keywordto search for.
virtual void* MemPager::first ( size_t  size)
protectedvirtualinherited

Allocate first workspace from paged memory.

This method scans all currently allocated blocks for available space before adding new pages and hence is both slower and more efficient.

Parameters
sizesize of memory to allocate.
Returns
pointer to allocated memory.

Reimplemented in SharedMemPager.

char* MemPager::first ( char *  str)
protectedinherited

Allocate a string from the memory pager pool and copy the string into it's new memory area.

This method allocates memory by first searching for an available page, and then allocating a new page if no space is found.

Parameters
strstring to allocate and copy into paged memory pool.
Returns
copy of string from allocated memory.
ScriptImage* ost::ScriptCommand::getActive ( void  )
inline

Get the active script.

Returns
pointer to active script image.

Definition at line 417 of file script3.h.

unsigned ost::ScriptCommand::getActivity ( void  )
inline

Get activity counter.

Returns
activity counter.

Definition at line 647 of file script3.h.

bool Keydata::getBool ( const char *  key)
inherited

Get a bool value.

Parameters
symkeyword name.
Returns
true or false.
int Keydata::getCount ( const char *  sym)
inherited

Get a count of the number of data "values" that is associated with a specific keyword.

Each value is from an accumulation of "<code>load()</code>" requests.

Parameters
symkeyword symbol name.
Returns
count of values associated with keyword.
static unsigned ost::ScriptCommand::getCount ( Line line)
static

Count non-keyword arguments.

Returns
number of non-keyword arguments.
Parameters
linerecord to examine.
unsigned ost::ScriptCommand::getCount ( void  )
inlineprotected

Get count of active traps.

Returns
count of active trap identifiers.

Definition at line 613 of file script3.h.

double Keydata::getDouble ( const char *  key,
double  def = 0. 
)
inherited

Get a floating value.

Parameters
symkeyword name.
defaultif not set.
Returns
value of key.
virtual const char* ost::ScriptCommand::getExternal ( const char *  opt)
protectedvirtual
const char* Keydata::getFirst ( const char *  sym)
inherited

Get the first data value for a given keyword.

This will typically be the /etc set global default.

Parameters
symkeyword symbol name.
Returns
first set value for this symbol.
Method ost::ScriptCommand::getHandler ( const char *  keyword)

Get the method handler associated with a given keyword.

This is used by ScriptImage when compiling.

Parameters
keywordto search for.
Returns
method handler to execute for this keyword.
static unsigned ost::Script::getIndex ( const char *  id)
staticinherited
unsigned Keydata::getIndex ( char **  data,
unsigned  max 
)
inherited

Get an index array of ALL keywords that are stored by the current keydata object.

Returns
number of keywords found.
Parameters
datapointer of array to hold keyword strings.
maxnumber of entries the array can hold.
const char* Keydata::getLast ( const char *  sym)
inherited

Get the last (most recently set) value for a given keyword.

This is typically the value actually used.

Parameters
symkeyword symbol name.
Returns
last set value for this symbol.
const char* const* Keydata::getList ( const char *  sym)
inherited

Return a list of all values set for the given keyword returned in order.

Returns
list pointer of array holding all keyword values.
Parameters
symkeyword name to fetch.
long Keydata::getLong ( const char *  sym,
long  def = 0 
)
inherited

Get a long value, with an optional default if missing.

Parameters
symkeyword name.
defaultif not present.
Returns
long value of key.
static const char* ost::ScriptCommand::getMember ( Line line)
static

Get the member id code of a line.

Returns
member id code.
Parameters
linerecord to examine in check routine.
static const char* ost::ScriptCommand::getOption ( Line line,
unsigned *  index 
)
staticprotected

Get an option to examine in check routine.

Returns
option or NULL if past end of line record.
Parameters
linerecord pointer to line to examine.
indexpointer to index value. Start at 0.
int MemPager::getPages ( void  )
inlineinherited

Return the total number of pages that have been allocated for this memory pool.

Returns
number of pages allocated.

Definition at line 181 of file misc.h.

const char* Keydata::getString ( const char *  sym,
const char *  def = NULL 
)
inherited

Get a string value, with an optional default if missing.

Parameters
symkeyword name.
defaultif not present.
Returns
string value of key.
Keysym* Keydata::getSymbol ( const char *  sym,
bool  create 
)
protectedinherited
virtual unsigned long ost::ScriptCommand::getTrapDefault ( void  )
protectedvirtual

Get the mask bits for the default script.

Returns
trap mask to use.
virtual unsigned long ost::ScriptCommand::getTrapHandler ( Name script)
protectedvirtual

Get the mask bits for a trap "handler".

Returns
script object of trap mask to use.
virtual unsigned ost::ScriptCommand::getTrapId ( const char *  name)
protectedvirtual

Get the trap id number associated with a trap name.

Returns
trap id number, 0 (exit) if invalid.
Parameters
nameof trap identifier.
virtual unsigned long ost::ScriptCommand::getTrapMask ( unsigned  id)
protectedvirtual

Get a trap mask for a given identifer.

This is a virtual since some derived handlers may manipulate mask bits.

Returns
signal bit mask based on id number.
Parameters
idnumber of trap mask.
virtual unsigned long ost::ScriptCommand::getTrapMask ( const char *  name)
protectedvirtual

A helper method for the compiler used specifically for "^" trap subsection requests.

These will occasionally carry different attribute settings.

Parameters
nameof trap identifier.
Returns
bit shifted mask or 0 if invalid.
virtual unsigned long ost::ScriptCommand::getTrapModifier ( const char *  name)
protectedvirtual

A helper method for the compiler.

Converts a named trap into it's bit shifted mask. By making it a virtual, derived dialects can add "aliases" to default trap names.

Parameters
nameof trap identifier.
Returns
bit shifted mask or 0 if invalid.
const char* ost::ScriptCommand::getTrapName ( unsigned  id)

Get the name of a trap from it's id.

Parameters
idof trap.
Returns
name of trap.
static bool ost::ScriptCommand::hasKeywords ( Line line)
staticprotected

Test current command to see if it uses keyword syntax.

Returns
true if keyword syntax used.
Parameters
linerecord to examine in check routine.
static bool ost::Script::isFunction ( Name scr)
staticinherited
bool ost::ScriptCommand::isInherited ( unsigned  id)
protected

Return true if the trap id is inherited.

bool ost::ScriptCommand::isInitial ( const char *  keyword)
protected

Fetch whether the given keyword is valid for constructor.

Parameters
keywordto search for.
Returns
init flag.
virtual bool ost::ScriptCommand::isInput ( Line line)
virtual

Checks if the line statement is an input statement.

Used in some servers...

Returns
true if line is input.
Parameters
lineto examine.
bool Keydata::isKey ( const char *  sym)
inherited

Find if a given key exists.

Parameters
symkeyword to find.
Returns
true if exists.
static bool ost::Script::isPrivate ( Name scr)
staticinherited
static bool ost::Script::isScript ( Name scr)
staticinherited
static bool ost::Script::isSymbol ( const char *  id)
staticinherited
void Mutex::leave ( void  )
inlineinherited

Future abi will use enter/leave/test members.

Definition at line 269 of file thread.h.

void Mutex::leaveMutex ( void  )
inherited

Leaving a mutex frees that mutex for use by another thread.

If the mutex has been entered (invoked) multiple times (recursivily) by the same thread, then it will need to be exited the same number of instances before it is free for re-use. This operation can also be done using the LEAVE_CRITICAL macro or by the – operator on a mutex.

See Also
enterMutex
void Keydata::load ( const char *  keypath)
inherited

Load additional key values into the currrent object from the specfied config source (a config file/section pair).

These values will overlay the current keywords when matches are found. This can be used typically in a derived config object class constructor to first load a /etc section, and then load a matching user specific entry from ~/. to override default system values with user specific keyword values.

Parameters
keypath(filepath/section)
void Keydata::load ( Define pairs)
inherited

Load default keywords into the current object.

This only loads keyword entries which have not already been defined to reduce memory usage. This form of Load is also commonly used in the constructor of a derived Keydata class.

Parameters
pairslist of NULL terminated default keyword/value pairs.
void ost::ScriptCommand::load ( Script::Define keywords)
protected

Load a set of keywords into the system keyword table.

This provides a convenient method of initializing and adding to the keyword indexes.

Parameters
keywordsdefined pair entries to load.
void Keydata::loadFile ( const char *  filepath,
const char *  keys = NULL,
const char *  pre = NULL 
)
inherited

Load additional keys into the current object using a real filename that is directly passed rather than a computed key path.

This also uses a [keys] section as passed to the object.

Parameters
filepathto load from
keyssection to parse from, or NULL to parse from head
preoptional key prefix
void Keydata::loadPrefix ( const char *  prefix,
const char *  keypath 
)
inherited

Load additional key values into the currrent object from the specfied config source (a config file/section pair).

These values will overlay the current keywords when matches are found. This can be used typically in a derived config object class constructor to first load a /etc section, and then load a matching user specific entry from ~/. to override default system values with user specific keyword values. This varient puts a prefix in front of the key name.

Parameters
prefix
keypath(filepath/section)
void Mutex::nameMutex ( const char *  name)
inlineinherited

Enable setting of mutex name for deadlock debug.

Parameters
namefor mutex.

Definition at line 248 of file thread.h.

const char* Keydata::operator[] ( const char *  keyword)
inlineinherited

A convient notation for accessing the keydata as an associative array of keyword/value pairs through the [] operator.

Definition at line 611 of file misc.h.

void MemPager::purge ( void  )
protectedinherited

purge the current memory pool.

static void Mutex::setDebug ( bool  mode)
inlinestaticinherited

Enable or disable deadlock debugging.

Parameters
modedebug mode.

Definition at line 240 of file thread.h.

void Keydata::setValue ( const char *  sym,
const char *  data 
)
inherited

Set (replace) the value of a given keyword.

This new value will become the value returned from getLast(), while the prior value will still be stored and found from getList().

Parameters
symkeyword name to set.
datastring to store for the keyword.
static unsigned ost::Script::storage ( Symbol sym)
staticinherited
static bool ost::Script::symindex ( Symbol sym,
short  offset 
)
staticinherited
bool Mutex::test ( void  )
inlineinherited

Future abi will use enter/leave/test members.

Returns
true if entered.

Definition at line 277 of file thread.h.

int ost::ScriptCommand::trap ( const char *  name,
bool  inherited = true 
)
protected

Add a trap handler symbolic identity to the keyword table.

These are used to handle signal mask coercion and event branch points in the compiler.

Parameters
nameof requested trap to add to the trap table.
inheritedstatus of trap.
Returns
assigned id number for the trap.
bool Mutex::tryEnterMutex ( void  )
inherited

Tries to lock the mutex for the current thread.

Behaves like enterMutex , except that it doesn't block the calling thread if the mutex is already locked by another thread.

Returns
true if locking the mutex was succesful otherwise false
See Also
enterMutex
leaveMutex
void Keydata::unlink ( void  )
inherited

Unlink the keydata object from the cache file stream.

This should be used if you plan to keepa Keydata object after it is loaded once all keydata objects have been loaded, otherwise the cfgFile stream will remain open. You can also use endKeydata().

static bool ost::Script::use ( const char *  name)
staticinherited
static bool ost::ScriptCommand::useKeywords ( Line line,
const char *  list 
)
static

Test current command against a list of valid keywords.

Returns
first keyword found not in list.
Parameters
linerecord to examine in check routine.
listof =xxx keyword entries.
static bool ost::ScriptCommand::useMember ( Line line,
const char *  list 
)
staticprotected

Check the member list.

Returns
true if member found or none.
Parameters
linerecord to examine in check routine.
listof .members...

Friends And Related Function Documentation

friend class __EXPORT ScriptBinder
friend

Definition at line 349 of file script3.h.

friend class __EXPORT ScriptCompiler
friend

Definition at line 348 of file script3.h.

friend class __EXPORT ScriptImage
friend

Definition at line 346 of file script3.h.

friend class __EXPORT ScriptInterp
friend

Definition at line 347 of file script3.h.

Field Documentation

const char* ost::Script::access_host
staticinherited

Definition at line 285 of file script3.h.

const char* ost::Script::access_pass
staticinherited

Definition at line 284 of file script3.h.

const char* ost::Script::access_user
staticinherited

Definition at line 283 of file script3.h.

ScriptImage* ost::ScriptCommand::active
private

Definition at line 370 of file script3.h.

unsigned ost::ScriptCommand::activity
protected

Definition at line 379 of file script3.h.

const char* ost::Script::altplugins
staticinherited

Definition at line 282 of file script3.h.

const char* ost::Script::apps_extensions
staticinherited

Definition at line 291 of file script3.h.

const char* ost::Script::apps_prefix
staticinherited

Definition at line 292 of file script3.h.

unsigned ost::Script::autoStepping
staticinherited

Definition at line 258 of file script3.h.

void* ost::ScriptCommand::dbc
private

Definition at line 375 of file script3.h.

unsigned ost::ScriptCommand::dbcount
private

Definition at line 374 of file script3.h.

char ost::Script::decimal
staticinherited

Definition at line 275 of file script3.h.

const char* ost::Script::etc_prefix
staticinherited

Definition at line 294 of file script3.h.

const char* ost::Script::exec_extensions
staticinherited

Definition at line 287 of file script3.h.

bool ost::Script::exec_funcs
staticinherited

Definition at line 286 of file script3.h.

const char* ost::Script::exec_prefix
staticinherited

Definition at line 289 of file script3.h.

const char* ost::Script::exec_token
staticinherited

Definition at line 288 of file script3.h.

const char* ost::Script::exit_token
staticinherited

Definition at line 290 of file script3.h.

bool ost::Script::fastStart
staticinherited

Definition at line 255 of file script3.h.

unsigned ost::Script::fastStepping
staticinherited

Definition at line 257 of file script3.h.

Fun* ost::Script::ifun
staticprotectedinherited

Definition at line 306 of file script3.h.

unsigned long ost::ScriptCommand::imask
private

Definition at line 373 of file script3.h.

unsigned ost::ScriptCommand::keyword_count
private

Definition at line 371 of file script3.h.

Keyword* ost::ScriptCommand::keywords[KEYDATA_INDEX_SIZE]
private

Definition at line 368 of file script3.h.

class __EXPORT ost::Script::Line
inherited

Definition at line 102 of file script3.h.

const char* ost::Script::log_prefix
staticinherited

Definition at line 296 of file script3.h.

class __EXPORT ost::Script::Name
inherited

Definition at line 103 of file script3.h.

size_t ost::Script::pagesize
staticinherited

Definition at line 259 of file script3.h.

const char* ost::Script::plugins
staticinherited

Definition at line 281 of file script3.h.

bool ost::ScriptCommand::ripple
protected

Definition at line 378 of file script3.h.

ScriptCommand* ost::ScriptCommand::runtime
staticprotected

Definition at line 380 of file script3.h.

unsigned ost::Script::symlimit
staticinherited

Definition at line 261 of file script3.h.

unsigned ost::Script::symsize
staticinherited

Definition at line 260 of file script3.h.

Test* ost::Script::test
staticprotectedinherited

Definition at line 305 of file script3.h.

ThreadQueue* ost::ScriptCommand::tq
private

Definition at line 367 of file script3.h.

unsigned ost::ScriptCommand::trap_count
private

Definition at line 372 of file script3.h.

char* ost::ScriptCommand::traps[(sizeof(unsigned long)*8)]
private

Definition at line 369 of file script3.h.

bool ost::Script::use_definitions
staticinherited

Definition at line 276 of file script3.h.

bool ost::Script::use_funcs
staticinherited

Definition at line 280 of file script3.h.

bool ost::Script::use_macros
staticinherited

Definition at line 277 of file script3.h.

bool ost::Script::use_merge
staticinherited

Definition at line 279 of file script3.h.

bool ost::Script::use_prefix
staticinherited

Definition at line 278 of file script3.h.

bool ost::Script::useBigmem
staticinherited

Definition at line 256 of file script3.h.

const char* ost::Script::var_prefix
staticinherited

Definition at line 295 of file script3.h.


The documentation for this class was generated from the following file: