NOTE:
This project is no longer being maintained: it was developed for my masters thesis, which was completed in early 1997. I still, however, welcome any questions or comments that people may have.

[Home] [ToC] [Up] [Prev] [Next]


iHTML Language Services

Environment

The language environment services provide functions for manipulating the document environments and global state of a language module.


Types

IHLangEnv
Synopsis
A language execution environment.
Definition
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. */
};
See Also
IHGlobalInfo, IHLanguage

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.


Functions

AllocLangEnv
Synopsis
IHLangEnv* AllocLangEnv(IHLangEnv* le)
Arguments
(IHLangEnv*) le
The new language environment the library is creating.
Return
(IHLangEnv*) The initialized language environemt (i.e., le), or NULL if there was a fatal error.
See Also
IHLangEnv

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.

ExecLangEnv
Synopsis
int ExecLangEnv(IHLangEnv* le, IHModuleInfo* main)
Arguments
(IHLangEnv*) le
An active language environment.
(IHModuleInfo*) main
The main document script in this environment.
Return
(int) TRUE if all is okay, FALSE if it could not be started.
See Also
IHLangEnv, IHModuleInfo, AllocLangEnv

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.

FreeLangEnv
Synopsis
void FreeLangEnv(IHLangEnv* le)
Arguments
(IHLangEnv*) le
A previously allocated language environment.
Return
nothing.
See Also
IHLangEnv, AllocLangEnv

Deallocated all resources the language had previously allocated in AllocLangEnv().

StopLangEnv
Synopsis
int StopLangEnv(IHLangEnv* le)
Arguments
(IHLangEnv*) le
An active language environment.
Return
nothing.
See Also
IHLangEnv, IHModuleInfo, AllocLangEnv

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.

Term
Synopsis
void Term(IHLanguage* lang)
Arguments
(IHLanguage*) lang
The language module's public interface.
Return
nothing.
See Also
IHLanguage

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]

_________.oo_Q_Q_oo.____________________________________________
Dianne Kyra Hackborn <hackbod@angryredplanet.com>
Last modified: Tue Oct 8 04:38:17 PDT 1996

This web page and all material contained herein is Copyright (c) 1997 Dianne Hackborn, unless otherwise noted. All rights reserved.