execute_CopyCommandTable()

[<<<] [>>>]

The command table is a huge table containing pointers to functions. For example the CMD_LET-th element of the table points to the function COMMAND_LET implementing the assignment command.

This table is usually treated as constant and is not moduified during run time. In case a module wants to reimplement a command it should alter this table. However the table is shared all concurrently running interpreter threads in a multi-thread variation of ScriptBasic.

To avoid altering the command table of an independent interpreter threadthe module wanting altering the command table should call this function. This function allocates memory for a new copy of the command table and copies the original constant value to this new place. After the copy is done the ExecuteObject will point to the copied command table and the extension is free to alter the table.

In case the function is called more than once for the same interpreter thread only the first time is effective. Later the function returns without creating superfluous copies of the command table.

int execute_CopyCommandTable(pExecuteObject pEo
  )@{

[<<<] [>>>]