$#+K The Bsc Interface

The Bsc interface provides the functionality for accessing source browser information.

Functions starting with the "BSC" prefix are ANSI C bindings of the corresponding BSC Class member functions. (To use the C bindings you need to link your application with a thunk module provided in the BSC toolkit.)

Note that the current implementation of the Bsc Interface is not enabled for multithreaded access.

Member Function Categories

Operations

Getting Information

Handling Instances

Conversions

String Operations

Miscellaneous

#Operations		
open
	Opens a browser database.	
close
	Closes a browser database.	
		
#Getting Information		
idefInfo	Retrieves information about a given symbol definition.	
iinstInfo	Retrieves information about a given symbol instance.	
imodInfo	Retrieves information about a given module.	
irefInfo	Retrieves information about a given symbol reference.	
		
#Handling Instances		
fInstFilter	Performs category testing on instances.	
getAllGlobalsArray	Gets all global symbols.	
getAllModulesArray	Gets all module indices.	
getBaseArray	Gets base classes of a (class) symbol instance.	
getDefArray	Gets definitions of a symbol instance.	
getDervArray	Gets derived classes of a (class) symbol instance.	
getIinstByvalue	Gets index of symbol instance.	
getMembersArray	Gets members of a class instance.	
getModuleByName	Gets index of module given its name.	
getModuleContents	Gets instances contained in a module.	
getOverloadArray	Gets symbol instances that match a given name.	
getRefArray	Gets references of a symbol instance.	
getUsedByArray	Gets symbols that are "used by" a given instance.	
getUsesArray	Gets symbols that "use" a given instance.	
		
#Conversions		
iinstContextIref	Converts reference index to instance index based on context.	
iinstFrIdef	Converts definition index to instance index.	
iinstFrIref	Converts reference index to instance index.	
		
#String operations		
formatDname	Formats decorated name.	
szFrAtr	Gets description of attributes.	
szFrTyp	Gets description of type.	
		
#Miscellaneous 		
disposeArray	Frees an array that has been allocated by another Bsc function.	
fCaseSensitive	Checks case sensitivity of database.	
getModuleStatistics	Gets statistics about a given module.	
getStatistics	Gets statistics about the browser database.	
setCaseSensitivity	Overrides case sensitivity of database.	

$#+K Bsc::open
static BOOL open (SZ szName, OUT Bsc** ppbsc);
BOOL BSCOpen (SZ szName, OUT Bsc** ppbsc);
See Also	
Parameters
szName	Contains a null-terminated string that is the path name to a .bsc file.

ppbsc	Points to a Bsc* value  that will receive the pointer to the Bsc object.

Remarks
Opens the browser database file specified by szName and creates and creates an associated Bsc object.

Return Value
Nonzero if successful; otherwise 0.

$#+K Bsc::close
virtual BOOL close();
BOOL BSCClose(Bsc *pbsc);
See Also
Parameters
pbsc	Points to the browser database.

Remarks
Closes the current database and disposes of any memory the Bsc object may be using.

Return Value
Nonzero if successful; otherwise 0. 

$#+K Bsc::iinstInfo
virtual BOOL iinstInfo(IINST iinst, OUT SZ *psz, OUT TYP *ptyp, OUT ATR *patr);
BOOL BSCIinstInfo(Bsc *pbsc, IINST iinst, OUT SZ *psz, OUT TYP *ptyp, OUT ATR *patr);
See Also	
Parameters
pbsc	Points to the browser database.

iinst	An index that specifies a symbol instance.

psz		Pointer to an SZ value that will receive a pointer to an internal library buffer containing the name of the symbol instance. 

ptyp	Pointer to a TYP value that will receive the type specification of the symbol instance.

patr		Pointer to an ATR value that will receive the attributes of the symbol instance.	

Remarks
This function retrieves information about a particular instance of a symbol specified by iinst. It retrieves the symbol name and fills in the corresponding type (TYP) and attribute values. 

The SZ argument is handled in an atypical way. Instead of placing text in a buffer that the caller provides, the library actually fills in a pointer to one of its internal buffers where the symbol name can be found. The SZ pointer is set to point to this buffer. If you intend to use the contents of this buffer after making another call to the library, be sure to copy these contents, or they may be lost due to the next library call.

Return Value
Nonzero if the information was successfully retrieved, otherwise 0.

$#+K Bsc::irefInfo
virtual BOOL irefInfo(IREF iref, OUT SZ *pszModule, OUT LINE *piline);
BOOL BSCIrefInfo(Bsc *pbsc, IREF iref, OUT SZ *pszModule, OUT LINE *piline);
See Also	
Parameters
pbsc	Points to the browser database.

iref		An index that specifies a reference to a symbol instance.

psz		Pointer to an SZ value that will receive a pointer to an internal library buffer containing the actual filename of the module where the specific reference is found. 

piline	Pointer to a LINE value that will receive the line number of the particular instance reference. 

Remarks
This function retrieves the filename and line number of a particular reference to a symbol instance.

The SZ argument is handled in an atypical way. Instead of placing text in a buffer that the caller provides, the library actually fills in a pointer to one of its internal buffers where the module name can be found. The SZ pointer is set to point to this buffer. If you intend to use the contents of this buffer after making another call to the library, be sure to copy these contents, or they may be lost due to the next library call.

Return Value
Nonzero if the information was successfully retrieved, otherwise 0.

$#+K Bsc::idefInfo
virtual BOOL idefInfo(IDEF idef, OUT SZ *pszModule, OUT LINE *piline);
BOOL BSCIdefInfo(Bsc *pbsc, IDEF idef, OUT SZ *pszModule, OUT LINE *piline);
See Also	
Parameters
pbsc	Points to the browser database.

idef		An index that specifies a definition of a symbol instance.

psz		Pointer to an SZ value that will receive a pointer to an internal library buffer containing the actual filename of the module where the specific definition is found. 

piline	Pointer to a LINE value that will receive the line number of the particular instance definition. 

Remarks
This function retrieves the filename and line number of a particular definition of a symbol instance.

The SZ argument is handled in an atypical way. Instead of placing text in a buffer that the caller provides, the library actually fills in a pointer to one of its internal buffers where the module name can be found. The SZ pointer is set to point to this buffer. If you intend to use the contents of this buffer after making another call to the library, be sure to copy these contents, or they may be lost due to the next library call.

Return Value
Nonzero if the information was successfully retrieved, otherwise 0.

$#+K Bsc::imodInfo
virtual BOOL imodInfo(IMOD imod, OUT SZ *pszModule);
BOOL BSCImodInfo(Bsc *pbsc, IMOD imod, OUT SZ *pszModule);
See Also	
Parameters
pbsc	Points to the browser database.

imod	An index that specifies a module in the database.

psz		Pointer to an SZ value that will receive a pointer to an internal library buffer containing the actual filename of the module. 

Remarks
This function retrieves the filename of a module, given a module index imod.

The SZ argument is handled in an atypical way. Instead of placing text in a buffer that the caller provides, the library actually fills in a pointer to one of its internal buffers where the module name can be found. The SZ pointer is set to point to this buffer. If you intend to use the contents of this buffer after making another call to the library, be sure to copy these contents, or they may be lost due to the next library call.

Return Value
Nonzero if the information was successfully retrieved, otherwise 0.

$#+K Bsc::szFrTyp
virtual SZ   szFrTyp(TYP typ);
SZ  BSCSzFrTyp(Bsc *pbsc, TYP typ);
See Also	
Parameters
pbsc	Points to the browser database.

typ		A TYP value, specifying the type of an instance.

Remarks
This function provides a string that describes the type valuetyp. 

Return Value
A string describing the attributes specified by typ. 
szFrTyp returns a pointer to one of its internal buffers where the corresponding string can be found. If you intend to use the contents of this buffer after making another call to the library, be sure to copy these contents, or they may be lost due to the next library call.

$#+K Bsc::szFrAtr
virtual SZ   szFrAtr(ATR atr);
SZ  BSCSzFrAtr(Bsc *pbsc, ATR atr);
See Also	
Parameters
pbsc	Points to the browser database.

atr		An ATR value, specifying zero or more attributes.

Remarks
This function provides a string that describes the attribute values specified by atr. The resulting string is a concatenation of the corresponding attribute strings separated by colons.

Return Value
A string describing the attributes specified by atr. 
szFrAtr returns a pointer to one of its internal buffers where the corresponding string can be found. If you intend to use the contents of this buffer after making another call to the library, be sure to copy these contents, or they may be lost due to the next library call.

$#+K Bsc::getIinstByvalue
virtual BOOL getIinstByvalue(SZ sz, TYP typ, ATR atr, OUT IINST *piinst);
BOOL BSCGetIinstByvalue(Bsc *pbsc, SZ sz, TYP typ, ATR atr, OUT IINST *piinst);
See Also	
Parameters
pbsc	Points to the browser database.

sz		A string that contains a symbol name.

typ		Specifies the type value of a symbol instance.

atr		Specifies the attribute values of a symbol instance.

piinst	Points to an IINST value that will receive the index of the symbol instance that matches the given name, type, and attributes.

Remarks
This function retrieves the index of a symbol instance that has the same name, type and attributes as those specified by sz, typ, and atr respectively, and no additional attribute values than those specified by atr.

Return Value
Nonzero if the instance index was successfully retrieved, otherwise 0.

$#+K Bsc::getOverloadArray
virtual BOOL getOverloadArray(SZ sz, MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst);
BOOL BSCGetOverloadArray(Bsc *pbsc, SZ sz, MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst);
See Also	
Parameters
pbsc	Points to the browser database.

sz		A string that specifies the search pattern.

mbf		Specifies the instance type filter (MBF).

ppiinst	Points to an IINST* value that will receive a pointer to an array of instance indices.

pciinst	Points to a ULONG value that will receive the number of elements contained in the array.

Remarks
This  function finds all possible instances that match a given name, such as all members of a given class, all class members having the given name, or all top-level items having the given name. 

The following are the forms sz can have and their subsequent action:

class::		Generates a list of all members of the class.
class::mem	Generates a list of all members named mem. It also accepts wildcards, as in mem*, and nested classes (such as classA::classB::mem).
mem		Generates a list of all members mem in any class or top-level items.

The member mem can be a regular member or it can be operator+, operator new, and so forth. 

The generated list is filtered according to the criteria specified by the instance type filter (mbf). The indices of the symbol instances that meet these criteria are placed in an array which can be accessed via the ppinst argument. 

The array is allocated dynamically by the library and the library owns the allocated memory. The caller should call Bsc::disposeArray when the array is no longer needed.

Return Value
Nonzero if the array was successfully created, otherwise 0.

$#+K Bsc::getUsedByArray
virtual BOOL getUsedByArray(IINST iinst, MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst);
BOOL BSCGetUsedByArray(Bsc *pbsc, IINST iinst, MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst);
See Also	
Parameters
pbsc	Points to the browser database.

iinst	An index that specifies a symbol instance.

mbf		Specifies the instance type filter (MBF).

ppiinst	Points to an IINST* value that will receive a pointer to an array of instance indices.

pciinst	Points to a ULONG value that will receive the number of elements contained in the array.

Remarks
Each instance in the database has an associated set of instances that use the given symbol. This function looks for instances that use the symbol instance specified by iinst, and meet the type criteria specified by the instance type filter (mbf). The indices of the symbol instances that meet these criteria are placed in an array which can be accessed via the ppinst argument. 

The array is allocated dynamically by the library and the library owns the allocated memory. The caller should call Bsc::disposeArray when the array is no longer needed.

Note that this function may be slow since it may have to search a lot of the database.

Return Value
Nonzero if the array was successfully created, otherwise 0.

$#+K Bsc::getUsesArray
virtual BOOL getUsesArray(IINST iinst, MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst);
BOOL BSCGetUsesArray(Bsc *pbsc, IINST iinst, MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst);
See Also
Parameters
pbsc	Points to the browser database.

iinst	An index that specifies a symbol instance.

mbf		Specifies the instance type filter (MBF).

ppiinst	Points to an IINST* value that will receive a pointer to an array of instance indices.

pciinst	Points to a ULONG value that will receive the number of elements contained in the array.

Remarks
Each instance in the database has an associated set of instances that the given symbol uses. This function looks for instances that are used by the symbol instance specified by iinst, and meet the type criteria specified by the instance type filter (mbf). The indices of the symbol instances that meet these criteria are placed in an array which can be accessed via the ppinst argument. 

The array is allocated dynamically by the library and the library owns the allocated memory. The caller should call Bsc::disposeArray when the array is no longer needed.

Return Value
Nonzero if the array was successfully created, otherwise 0.

$#+K Bsc::getBaseArray
virtual BOOL getBaseArray(IINST iinst, OUT IINST **ppiinst, OUT ULONG *pciinst);
BOOL BSCGetBaseArray(Bsc *pbsc, IINST iinst, OUT IINST **ppiinst, OUT ULONG *pciinst);
See Also
Parameters
pbsc	Points to the browser database.

iinst	An index that specifies a symbol instance.

ppiinst	Points to an IINST* value that will receive a pointer to an array of instance indices.

pciinst	Points to a ULONG value that will receive the number of elements contained in the array.

Remarks
Some instances in the browser database could refer to classes that they are based on. This function retrieves the instance indices of classes on which the instance iinst is based. These indices are placed in an array which can be accessed via the ppinst argument. 

The array is allocated dynamically by the library and the library owns the allocated memory. The caller should call Bsc::disposeArray when the array is no longer needed.

Return Value
Nonzero if the array was successfully created, otherwise 0.

$#+K Bsc::getDervArray
virtual BOOL getDervArray(IINST iinst, OUT IINST **ppiinst, OUT ULONG *pciinst);
BOOL BSCGetDervArray(Bsc *pbsc, IINST iinst, OUT IINST **ppiinst, OUT ULONG *pciinst);
See Also
Parameters
pbsc	Points to the browser database.

iinst	An index that specifies a symbol instance.

ppiinst	Points to an IINST* value that will receive a pointer to an array of instance indices.

pciinst	Points to a ULONG value that will receive the number of elements contained in the array.

Remarks
Some instances in the browser database could refer to derived classes. This function retrieves the instance indices of classes which derive from  the instance iinst. These indices are placed in an array which can be accessed via the ppinst argument. 

The array is allocated dynamically by the library and the library owns the allocated memory. The caller should call Bsc::disposeArray when the array is no longer needed.

Return Value
Nonzero if the array was successfully created, otherwise 0.

$#+K Bsc::getMembersArray
virtual BOOL getMembersArray(IINST iinst, MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst);
BOOL BSCGetMembersArray(Bsc *pbsc, IINST iinst, MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst);
See Also
Parameters
pbsc	Points to the browser database.

iinst	An index that specifies a symbol instance.

mbf		Specifies the instance type filter (MBF).

ppiinst	Points to an IINST* value that will receive a pointer to an array of instance indices.

pciinst	Points to a ULONG value that will receive the number of elements contained in the array.

Remarks
This function looks for member functions and member variables of the symbol instance specified by iinst. The indices of the symbol instances that meet the type criteria specified by the instance type filter (mbf) are placed in an array which can be accessed via the ppinst argument. This array may be empty in case iinst is not a class 

The array is allocated dynamically by the library and the library owns the allocated memory. The caller should call Bsc::disposeArray when the array is no longer needed.

Return Value
Nonzero if the array was successfully created, otherwise 0.

$#+K Bsc::getDefArray
virtual BOOL getDefArray(IINST iinst, OUT IDEF **ppidef, OUT ULONG *pcidef);
BOOL BSCGetDefArray(Bsc *pbsc, IINST iinst, OUT IDEF **ppidef, OUT ULONG *pcidef);
See Also
Parameters
pbsc	Points to the browser database.

iinst	An index that specifies a symbol instance.

ppidef	Points to an IINST* value that will receive a pointer to an array of instance indices.

pcidef	Points to a ULONG value that will receive the number of elements contained in the array.

Remarks
Each instance in the database has an associated set of definitions and references, which also are tracked using index variables (IDEF and IREF). This function retrieves the set of definition index values of the instance iinst. These indices are placed in an array which can be accessed via the ppinst argument. 

The array is allocated dynamically by the library and the library owns the allocated memory. The caller should call Bsc::disposeArray when the array is no longer needed.

Return Value
Nonzero if the array was successfully created, otherwise 0.

$#+K Bsc::getRefArray
virtual BOOL getRefArray(IINST iinst, OUT IREF **ppiref, OUT ULONG *pciref);
BOOL BSCGetRefArray(Bsc *pbsc, IINST iinst, OUT IREF **ppiref, OUT ULONG *pciref);
See Also
Parameters
pbsc	Points to the browser database.

iinst	An index that specifies a symbol instance.

ppiref	Points to an IINST* value that will receive a pointer to an array of instance indices.

pciref	Points to a ULONG value that will receive the number of elements contained in the array.

Remarks
Each instance in the database has an associated set of definitions and references, which also are tracked using index variables (IDEF and IREF). This function retrieves the set of reference index values of the instance iinst. These indices are placed in an array which can be accessed via the ppinst argument. 

The array is allocated dynamically by the library and the library owns the allocated memory. The caller should call Bsc::disposeArray when the array is no longer needed.

Return Value
Nonzero if the array was successfully created, otherwise 0.

$#+K Bsc::getModuleContents
virtual BOOL getModuleContents(IMOD imod, MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst);
BOOL BSCGetModuleContents(Bsc *pbsc, IMOD imod, MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst);
See Also
Parameters
pbsc	Points to the browser database.

imod	An index that specifies a module.

mbf		Specifies the instance type filter (MBF).

ppiinst	Points to an IINST* value that will receive a pointer to an array of instance indices.

pciinst	Points to a ULONG value that will receive the number of elements contained in the array.

Remarks
This function looks for instances that are contained in the module imod, and meet the type criteria specified by the instance type filter (mbf). The indices of the symbol instances that meet these criteria are placed in an array which can be accessed via the ppinst argument. 

The array is allocated dynamically by the library and the library owns the allocated memory. The caller should call Bsc::disposeArray when the array is no longer needed.

Return Value
Nonzero if the array was successfully created, otherwise 0.

$#+K Bsc::getModuleByName
virtual BOOL getModuleByName(SZ sz, OUT IMOD *pimod);
BOOL BSCGetModuleByName(Bsc *pbsc, SZ sz, OUT IMOD *pimod);
See Also
Parameters
pbsc	Points to the browser database.

sz		String containing a module name.

pimod	Points to an IMOD value that will receive the module index.

Remarks
This function retrieves the module index given a module name. 

Return Value
Nonzero if the module index of the given module was found, otherwise 0.

$#+K Bsc::getAllModulesArray
virtual BOOL getAllModulesArray(OUT IMOD **ppimod, OUT ULONG *pcimod);
BOOL BSCGetAllModulesArray(Bsc *pbsc, OUT IMOD **ppimod, OUT ULONG *pcimod);
See Also
Parameters
pbsc	Points to the browser database.

ppimod	Points to an IMOD* value that will receive a pointer to an array of module indices.

pcimod	Points to a ULONG value that will receive the number of elements contained in the array.

Remarks
This function returns the indices of all modules contained in the browser database. The indices of the module instances are placed in an array which can be accessed via the ppimod argument. 

The array is allocated dynamically by the library and the library owns the allocated memory. The caller should call Bsc::disposeArray when the array is no longer needed.

Return Value
Nonzero if the array was successfully created, otherwise 0.

$#+K Bsc::disposeArray
virtual void disposeArray(void *pAnyArray);
void BSCDisposeArray(Bsc *pbsc, void *pAnyArray);
See Also
Parameters
pbsc	Points to the browser database.

pAnyArray	Points to the array that will be disposed of.

Remarks
This function is used for disposing of arrays that have been allocated by the library due to a call to one of the "Bsc::get*Array" functions. Such arrays are allocated dynamically by the library and the library owns the allocated memory. The caller should call Bsc::disposeArray when the array is no longer needed.

$#+K Bsc::formatDname
virtual SZ  formatDname(SZ szDecor);
SZ  BSCFormatDname(Bsc *pbsc, SZ szDecor);

Parameters
pbsc	Points to the browser database.

szDecor	A string that contains a decorated symbol name.

Remarks
Use this function to  obtain an undecorated form of the decorated name szDecor. This function returns a pointer to one of its internal buffers where the formatted string can be found. If you intend to use the contents of this buffer after making another call to the library, be sure to copy these contents, or they may be lost due to the next library call.

Return Value
A string that contains the undecorated name for the function name indicated by szDecor.

$#+K Bsc::fInstFilter
virtual BOOL fInstFilter(IINST iinst, MBF mbf);
BOOL BSCFInstFilter(Bsc *pbsc, IINST iinst, MBF mbf);
See Also
Parameters
pbsc	Points to the browser database.

iinst 	An index that specifies a symbol instance.

mbf		Specifies the instance type filter (MBF).

Return Value
Nonzero if the given iinst value has a TYP value that corresponds with the value passed in the instance type filter (mbf), 0 otherwise.

$#+K Bsc::iinstFrIref
virtual IINST iinstFrIref(IREF iref);
IINST BSCIinstFrIref(Bsc *pbsc, IREF iref);
See Also
Parameters
pbsc	Points to the browser database.

iref		An index that specifies a symbol reference.

Return Value
Returns the IINST value for the instance that contains the reference indicated by iref. If it finds no such instance index, the function returns iinstNil. This function will fail if iref is an invalid reference index. 

$#+K Bsc::iinstFrIdef
virtual IINST iinstFrIdef(IDEF idef);
IINST BSCIinstFrIdef(Bsc *pbsc, IDEF idef);
See Also
Parameters
pbsc	Points to the browser database.

idef		An index that specifies a symbol definition.

Return Value
Returns the IINST value for the instance that contains the definition indicated by idef. If it finds no such instance index, the function returns iinstNil. This function will fail if idef is an invalid reference index. 

$#+K Bsc::iinstContextIref
virtual IINST iinstContextIref(IREF iref);
INST BSCIinstContextIref(Bsc *pbsc, IREF iref);
See Also
Parameters
pbsc	Points to the browser database.

iref		An index that specifies a symbol reference.

Return Value
Returns the IINST value for the instance that best represents the context at the reference indicated by the given iref. If it finds no such instance index, the function returns iinstNil. This function uses a heuristic, "best guess" algorithm that is highly accurate, though not 100% or so.

$#+K Bsc::getStatistics
virtual BOOL getStatistics(struct BSC_STAT *pstat);
BOOL BSCGetStatistics(Bsc *pbsc, struct BSC_STAT *pstat);
See Also
Parameters
pbsc	Points to the browser database.

pstat	Points to BSC_STAT structure that will receive the statistics.

Remarks
This function outputs statistics about the entire browser database to the user-supplied BSC_STAT structure. 

Return Value
Nonzero if successful, 0 otherwise.

$#+K Bsc::getModuleStatistics
virtual BOOL getModuleStatistics(IMOD imod, struct BSC_STAT *pstat);
BOOL BSCGetModuleStatistics(Bsc *pbsc, IMOD imod, struct BSC_STAT *pstat);
See Also
Parameters
pbsc	Points to the browser database.

imod	A module index.

pstat	Points to BSC_STAT structure that will receive the statistics.

Remarks
This function outputs statistics about the module imod to the user-supplied BSC_STAT structure. 

Return Value
Nonzero if successful, 0 otherwise.

$#+K Bsc::fCaseSensitive
virtual BOOL fCaseSensitive();
BOOL BSCFCaseSensitive(Bsc *pbsc);
See Also
Parameters
pbsc	Points to the browser database.

Return Value
Nonzero if the database is built with case-sensitive language, 0 otherwise.

$#+K Bsc::setCaseSensitivity
virtual BOOL setCaseSensitivity(BOOL fCaseIn);
BOOL BSCSetCaseSensitivity(Bsc *pbsc, BOOL fCaseIn);
See Also
Parameters
pbsc	Points to the browser database.

fCaseIn	Specifies whether the database should be case sensitive.

Remarks
Overrides the case sensitivity of the database. Look-ups in the symbol table become case sensitive if fCaseIn. is TRUE, otherwise look-ups become case insensitive.

Return Value
Nonzero if case sensitivity was successfully set, 0 otherwise.

$#+K Bsc::getAllGlobalsArray
virtual BOOL getAllGlobalsArray(MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst);
BOOL BSCGetAllGlobalsArray(Bsc *pbsc, MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst);
See Also
Parameters
pbsc	Points to the browser database.

mbf		Specifies the instance type filter (MBF).

ppiinst	Points to an IINST* value that will receive a pointer to an array of instance indices.

pciinst	Points to a ULONG value that will receive the number of elements contained in the array.

ppiinstinfo	Points to an IinstInfo* value that will receive a pointer to an array of IinstInfo elements.

Remarks
This function looks for instances of global symbols that meet the type criteria specified by the instance type filter (mbf), and provides an array containing the indices of the symbol instances that meet these criteria.

The array can be accessed via the ppinst argument. It is allocated dynamically by the library and the library owns the allocated memory. The caller should call Bsc::disposeArray when the array is no longer needed.

Return Value
Nonzero if the array was successfully created, otherwise 0.

$#+K Database queries

The current BSC API provides several high-level functions that help the client query the information stored in the database. Earlier versions of the BSC API provided lower-level core functionality and a bsc query mechanism for implementing higher level queries. Part of this query mechanism is also supported in the new BSC API (4.x) and provides limited backward compatibility.	

$#+K Before you use the query mechanism

Before you use the query mechanism it is essential that you open a browser database and pass the resulting BSC* pointer to the OpenBSCQuery function:

		BOOL OpenBSCQuery(BSC *pbsc)

This function associates the query mechanism with the browser database. Note that the BSC query mechanism can be associated with only one browser database at a time. Once you are done with the query mechanism, or before opening another BSC query for a different browser database you should call CloseBSCQuery:

		BOOL CloseBSCQuery()

The browser database should be remain open while the query mechanism is in use (i.e., you should not call BSC::close before calling CloseBSCQuery)

$#+K Browser Objects

All the queries process one item called a browser object (BOB). A browser object is actually one of the index values that are encoded along with the type of index into a  32-bit quantity. Thus, once it is known, the type or "class" of the browser object can be extracted, as can its appropriate index value (see below). 

The ClsOfBob() macro returns one of the following CLS (class) types for the given browser object: clsMod, clsInst, clsRef, clsDef. (Note that the following class types are no longer supported: clsSym, clsUse, clsUby, clsBase, clsDerv, clsFrin, clsFrout.

A browser object can be created from either a name of a symbol known to the database or from an index which is valid with respect to the database. 

The following call creates a browser object from the name of the object:
	BOB BSC_API BobFrName (LSZ lsz)

If no browser object can be created from the given name, the value bobNil is returned. If the name is found, then the browser object returned will be either of class clsMod (if the name was a module name) or of class clsInst (if the name was a symbol name). If more than one instance is associated with the given name, the browser object's value will be the first (smallest) such instance. 

The following macros can create a browser object from one of the index values. Listed beside each macro is the macro that performs the reverse operation.

	BobFrMod ( IMOD x )	ImodFrBob ( BOB b )
	BobFrInst ( IINST x )	IinstFrBob ( BOB b )
	BobFrRef ( IREF x )	IrefFrBob ( BOB b )
	BobFrDef ( IDEF x )	IdefFrBob ( BOB b )

All of the macros on the left use the function BobFrClsIdx, which, given one of the indexes shown above, returns the appropriate BOB.
	
NOTE:  The macros that convert an index into a browser object create a BOB whose class type corresponds to the type of index given. But the macros that convert a browser object back to an index do not check to make sure that the browser object has the correct class type value to do the conversion. It is up to the user of these macros to do whatever checking may be required before using them. 

To retrieve the symbol name of a browser object, use the function
	LSZ BSC_API LszNameFrBob  ( BOB bob )

which returns either a symbol name or a module name, depending on the class type of the browser object. 

$#+K Performing database queries

You can initiate several predefined queries once a browser object has been created and the query mechanism has been opened via OpenBscQuery. The queries are passed to the function InitBSCQuery along with the browser object itself. 

	BOOL BSC_API InitBSCQuery (QY qy, BOB bob)

The function returns TRUE if the query has been initiated successfully, FALSE otherwise. Not all queries can be performed on all browser objects (for example, trying to perform the query "What does this browser object call?" when the browser object type is actually that of a module index). The possible queries and their permitted browser object types are outlined in  the following table:

Query	Input BOB Type	Return BOB Type	Query initiated for	
qyContains	module	instance	Symbols that are defined in that module.	
qyCalls	instance	instance	Instances that a function (instance) calls. If the instance in that BOB is not of the type function, then the list of instances returned will be of zero length.	
qyCalledBy	instance	instance	Instances that call the input instance. These instances will be of the type function.	
qyRefs	instance	reference	References to all instances of the symbol, or, if the BOB is an instance, then the references to that particular instance itself. 	
qyDefs	instance	definition	Definitions of all instances of a symbol, or, if the BOB is an instance, then the definitions to that particular instance itself.	
qyBaseOf	instance, class	instance, class	Instances that have the given symbol as their base class.	
qyDervOf	instance, class	instance, class	Instances that are derived from the symbol.	
qyImpMembers	instance, class	instance, mem_var, mem_funct	All members implemented by the given class.	

The result of a query is a collection of browser objects. To obtain the next browser object in the query information, use the following function:

	BOB BSC_API  BobNext (VOID)

Any one of the browser objects returned may be passed back to initiate another query. The name of the symbol for that browser object may be found using the function LszNameFrBob, which can also be used to obtain the next browser object in the collection. If there are no more browser objects left in the collection, the value bobNil is returned.

#$ K The type value (TYP) is exactly one of the following:

INST_TYP_FUNCTION	INST_TYP_LABEL	
INST_TYP_PARAMETER	INST_TYP_VARIABLE	
INST_TYP_CONSTANT	INST_TYP_MACRO	
INST_TYP_TYPEDEF	INST_TYP_STRUCNAM	
INST_TYP_ENUMNAM	INST_TYP_ENUMMEM	
INST_TYP_UNIONNAM	INST_TYP_SEGMENT	
INST_TYP_GROUP	INST_TYP_PROGRAM	
INST_TYP_CLASSNAM	INST_TYP_MEMFUNC	
INST_TYP_MEMVAR		

#$ +K The attribute value (ATR)  describes the storage class of the instance. Any combination of the attribute bits may be set, although some combinations do not make sense and thus do not occur in practice. The attribute bits are as follows:

INST_ATR_LOCAL     	INST_ATR_STATIC    	
INST_ATR_SHARED    	INST_ATR_NEAR      	
INST_ATR_COMMON    	INST_ATR_DECL_ONLY 	
INST_ATR_PUBLIC    	INST_ATR_NAMED     	
INST_ATR_MODULE    	INST_ATR_VIRTUAL   	
INST_ATR_PRIVATE   	INST_ATR_PROTECT	

#$ +K Instance type (MBF)  values

The instance type (called an MBF) can be any bitwise-OR combination of the following constants:

mbfNil   	mbfVars  	
mbfFuncs 	mbfMacros	
mbfTypes 	mbfClass 	
mbfAll		

$#+K Database Index Variables
Each object found in the browser database is represented by a numerical index value that uniquely identifies one database object. The name of every index variable type begins with the letter "I" and ends with letters referring to the kind of object indexed by the variable. Each of these index variable types are described below.

Modules (IMOD Variables)
Each module in the database has an associated module index (IMOD) value. 

Symbol Instances (IINST Variables)
Every symbol in a browser database is associated with several instances, each of which corresponds to a different way the symbol is used in the program(s) described in the browser database). For example, the symbol "mysymbol" might be used as a static variable in one place, and as a function parameter in another. The browser library keeps track of these various instances using instance index values called IINST variables.

Definitions and References (IDEF and IREF Variables)
Each instance in the database has an associated set of definitions and references, which also are tracked using index variables (IDEF and IREF). 

# close
# open
# irefInfo
idefInfo

# iinstInfo
idefInfo

# iinstInfo
irefInfo

# getModuleByName
getAllModulesArray

# szFrAtr

# szFrTyp

# getOverloadArray

# getIinstByvalue 
disposeArray

# getUsesArray 
disposeArray

# getUsedByArray 
disposeArray

# getDervArray 
disposeArray

# getBaseArray 
disposeArray

# getBaseArray 
getDervArray
getOverloadArray 
disposeArray

# getRefArray 
disposeArray

# getDefArray 
disposeArray

# getAllGlobalsArray 
disposeArray

# getAllModulesArray
imodInfo

# getModuleByName 
disposeArray

# getOverloadArray
getUsedByArray
getUsesArray
getBaseArray
getDervArray
getMembersArray
getDefArray
getRefArray
getModuleContents
getAllModulesArray
getAllGlobalsArray

#

# MBF

# iinstContextIref
iinstFrIdef

# iinstFrIref

# iinstFrIref

# getModuleStatistics

# getStatistics

# setCaseSensitivity

# fCaseSensitive

# getModuleContents 
disposeArray