[Home] [ToC] [Up] [Prev] [Next]
A few miscellaneous browser services don't fit into any particular category. These include functions for handling search paths, files, string comparison, and version information.
Many of these function's implementations -- the most important being those for path and file handling -- are usually implemented as part of the common operating system glue for a platform, rather than for a specific host browser.
void*
(This is an
opaque type that is defined by the browser's internal
implementation.)
This type represents a handle on an opened file system direction, which is being scanned for files and directories.
IHDirScan BR_BeginDirScan(const char*
dir)
(const char*)
dir
(IHDirScan)
A handle on a
new directory scan operation.
Open the given file-system directory, to begin scanning it for the files and directories it contains. The syntax of the given directory name is browser-defines, and must be a string returned by BR_ParsePath().
void BR_EndDirScan(IHDirScan
ds)
(IHDirScan)
ds
Ends an active directory scan, and deallocates all resources associated with it.
void BR_FreeParsePath(const char**
path)
(const char**)
path
Deallocates the memory returned by BR_ParsePath().
const char* BR_GetBasePath(const char*
language, const char* defpath)
(const char*)
language
(const char*)
defpath
(const char*)
A string
representing the search path.
Returns a string defining the base search path to use. This may then be parsed by passing it to BR_ParsePath(). The string returned by this function must be deallocated with free().
int BR_GetCapability(IHDocument doc,
const char* name)
(IHDocument)
doc
(const char*)
name
(int)
Resulting capability
level of browser.
Checks the capability level available in the current browser/document. This defines the set of actions a script may perform and the environment it is running in. The returned integer level tells whether the capability is available; it should be 0 if not available or unknown, and 1 if it is allowed. Some capabilities define other return values.
The currently defined capability names are:
void BR_GetVersion(char**
fullname,char** name,int* ver,int* rev)
(char**)
fullname
(char**)
name
(int*)
ver
(int*)
rev
This function returns type and version information about the browser under which the system is running. Some example return values for the X Mosaic implementation are:
const char* BR_NextDirScan(IHDirScan
ds)
(IHDirScan)
ds
(const char*)
The name of the
next file in the directory.
Returns the name of the next file in the scanned directory, as a NULL-terminated string. A NULL pointer is returned when the end of the directory is reached.
FILE* BR_OpenDirFile(const char* dir,
const char* fname, const char* type)
(const char*)
dir
(const char*)
fname
(const char*)
type
(FILE*)
An opened file handle,
that can be manipulated with ANSI C file functions.
Opens a file in the given directory with the given name. The arguments dir must be a directory name as returned by BR_ParsePath() and fname must be the name of a file as returned by BR_NextDirScan(). The type argument is as per the ANSI fopen() funcion.
FILE* BR_OpenTempFile(IHDocument
doc)
(IHDocument)
doc
(FILE*)
A newly opened file
handle.
Opens a temporary file that can the be used to read/write data with standard ANSI C file functions.
const char** BR_ParsePath(const char*
path_descr, const char* langstr)
(const char*)
path_descr
(const char*)
langstr
(const char**)
A
NULL-terminated array of strings, representing the individual
directories in the path.
Parses a search path string returned by BR_GetBasePath() into its individual components. The syntax of the input string is not specified, but for Unix it will be, for example, of the form ".:/usr/local/lib".
The returned array must be deallocated with BR_FreeParsePath().
int BR_StrCmp(const char* str1, const
char* str2)
(const char*)
str1
(const char*)
str2
(int)
1 if str1 and
str2 are equal, else zero.
Performs a case-insensitive comparison of two strings. This should be used when manipulating strings that are used with the browser's functionality, such as attributes and tag names.
[Home] [ToC] [Up] [Prev] [Next]
Dianne Kyra Hackborn <hackbod@angryredplanet.com> | Last modified: Tue Oct 8 03:32:13 PDT 1996 |