[Home] [ToC] [Up] [Prev] [Next]
A few miscellaneous iHTML library services don't fit into any particular category. These include functions for manipulating MIME content type information, mapping from strings to integer identifiers, retrieving version information, and initializing and terminating the entire iHTML system.
typedef struct ih_content_type_rec { IHNode node; IHList params; /* (IHEmbeddedParam*) List of MIME arguments. */ char* type; /* The MIME content type -- e.g., "image" */ char* subtype; /* The MIME content subtype -- e.g., "gif" */ } IHContentType;
This type represents the information in a MIME Content-type header. This includes the basic type and subtype, along with a list of any additional parameters.
typedef struct name_entry_rec { char* name; int attr; } IHNameEntry;
This type maps between an arbirary identifier integer and a name string associated with it. The library includes a number of static arrays of these types, that are used to compute the ID code for a string. These are IH_ClassNames, IH_CodeNames, IH_AttrNames, and IH_WidgetMemberNames.
IHNameEntry*
IH_FindNameEntry(IHNameEntry* entries, int size, const
char* name)
(IHNameEntry*)
entries
(int)
size
(const char*)
name
(IHNameEntry*)
The entry that
matches the given name.
This function performs a binary search on the given array of NameEntries, looking for the requested name. If found, it returns a pointer to that entry. Otherwise, returns NULL. There are also four functions that provide a simpler interface for retrieving standard names:
IHNameEntry*
IH_FindClassEntry(char* name)
IHNameEntry*
IH_FindCodeEntry(char* name)
IHNameEntry*
IH_FindAttrEntry(char* name)
IHNameEntry*
IH_FindWidgetMemberEntry(char* name)
void IH_FreeContentType(IHContentType*
ct)
(IHContentType*)
ct
Deallocates the given MIME "Content-type" structure representation, which must have been previously allocated with IH_ParseContentType().
void IH_GetVersion(char** build, int*
ver, int* rev, int* sub)
(char**)
build
(int*)
ver
(int*)
rev
(int*)
sub
Fills in the given addresses with the library version information.
void IH_Initialize(int argc, char**
argv)
(int)
argc
(char**)
argv
Initializes the iHTML library and scans the system for language modules. This function must be called when the browser first starts up, with the command line that was supplied by the user.
int IH_MatchContentType(IHContentType*
tpl, IHContentType* ct)
(IHContentType*)
tpl
(IHContentType*)
ct
(int)
Result of comparison:
1 if ct matches tpl, else 0.
Compares two IHContentType structures.
tpl is the template to match against, and
ct is the content type that is being checked. Thus
tpl may have values of "*
" in its type
or subtype to match any value in ct, and
ct must have any additional parameters that are
contained in tpl
IHContentType* IH_ParseContentType(const
char* ctype)
(const char*)
ctype
(IHContentType*)
A newly
allocated Content-type structure.
/* Create a Content-type for the iHTML Python module. */ IHContentType* python = IH_ParseContentType("application/ihtml; language=python")
This routine parses a MIME Content-type header's data, returning a newly allocated IHContentType structure that is equivalent to the given string. If the given string is invalid -- e.g., there is no type or subtype supplied -- a NULL value is returned.
Deallocates and cleans up iHTML library and language modules, prior to program exit.
[Home] [ToC] [Up] [Prev] [Next]
Dianne Kyra Hackborn <hackbod@angryredplanet.com> | Last modified: Sun Oct 27 14:11:31 PST 1996 |