[Home] [ToC] [Up] [Prev] [Next]
The language environment services provide functions for manipulating the document environments and global state of a language module.
typedef struct ih_lang_env_rec IHLangEnv; struct ih_lang_env_rec { IHNode node; IHGlobalInfo* interface; IHLanguage* language; /* Any language-private information may go here. */ };
This type is a handle on a single execution environment in a language module. Every document has one language environment associated it, for each language that is executing on it. This environment provides a context for the high-level document script, and interaction between embedded scripts.
IHLangEnv* AllocLangEnv(IHLangEnv*
le)
(IHLangEnv*)
le
(IHLangEnv*)
The initialized
language environemt (i.e., le), or NULL if there
was a fatal error.
Allocate a new language environment. There is one environment per document; it contains all of the language state information needed for that document. This function is called the first time the library is about to create a new module, embedded object, or program for that document; the library will have already allocated and linked the IHLangEnv structure. The function should return that structure back if all is okay, or NULL if there was an error.
int ExecLangEnv(IHLangEnv* le,
IHModuleInfo* main)
(IHLangEnv*)
le
(IHModuleInfo*)
main
(int)
TRUE if all is okay,
FALSE if it could not be started.
Start execution in the document's environment. If main is non-NULL, it is a pointer to the document's main program, which should be executed right now. This function is called prior to starting any of the embedded objects. Returns TRUE if all is okay.
void FreeLangEnv(IHLangEnv* le)
(IHLangEnv*)
le
Deallocated all resources the language had previously allocated in AllocLangEnv().
int StopLangEnv(IHLangEnv* le)
(IHLangEnv*)
le
Stop the execution in the document's environment. If main is non-NULL, it is a pointer to the document's main program, which should be stopped right now. This function is called after all of the embedded objects have been stopped; the library should be prepared to handle it being called even if the environment isn't currently executing.
void Term(IHLanguage* lang)
(IHLanguage*)
lang
Free all resources used by the language, prior to unloading. If the pointer to this function is NULL, the language can not be terminated and thus will never be unloaded.
[Home] [ToC] [Up] [Prev] [Next]
Dianne Kyra Hackborn <hackbod@angryredplanet.com> | Last modified: Tue Oct 8 04:38:17 PDT 1996 |