home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_C
/
BSC32.ZIP
/
BSCSUP.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-22
|
7KB
|
202 lines
// bscsup.h
//
// BSC high level support functions
//
VOID BSC_API StatsBSC(VOID); // ascii dump of bsc statistics
VOID BSC_API DumpBSC(VOID); // ascii dump of the .bsc file
VOID BSC_API DumpInst(IINST iinst); // ascii dump of single inst (name + flags)
LSZ BSC_API LszTypInst(IINST iinst); // ascii version of iinst type
VOID BSC_API CallTreeInst (IINST iinst); // forward call tree from instance
BOOL BSC_API FCallTreeLsz(LSZ lszName); // forward call tree from name
VOID BSC_API RevTreeInst (IINST iinst); // reverse call tree from instance
BOOL BSC_API FRevTreeLsz(LSZ lszName); // reverse call tree form name
VOID BSC_API ClassTreeInst (IINST iinst); // forward class tree from instance
BOOL BSC_API FClassTreeLsz(LSZ lszName); // forward class tree from name
VOID BSC_API RevClassTreeInst (IINST iinst);// reverse class tree from inst
BOOL BSC_API FRevClassTreeLsz (LSZ lszName);// reverse class tree from name
// return the undecorated name for the function name in lszname
LSZ BSC_API FormatDname (LSZ lszname);
// return the base name of a decorated name. That is, the full name if
// it isn't decorated, the member name if it is a member variable or member
// function, the function/variable name if it is just a decorated function or
// data item (global), or the class name if it is a constructor or destructor.
//
// all other inputs return NULL
//
LSZ BSC_API LszBaseOfDname (LSZ lszname);
// return the class name from a decorated name or NULL if there is no
// class name there. If the name is either not a decorated name or if
// the class name part of the decorated name is empty (as in a global operator)
// then the pointer return is NULL. Otherwise the class name is returned
LSZ BSC_API LszClassOfDname (LSZ lszname);
// Browse OBject
typedef DWORD BOB;
#define bobNil 0L
typedef WORD CLS;
#define clsMod 1
#define clsInst 2
#define clsRef 3
#define clsDef 4
#define clsUse 5
#define clsUby 6
#define clsSym 7
#define clsBase 8
#define clsDerv 9
#define clsFrin 10
#define clsFrout 11
#define BobFrClsIdx(cls, idx) ((((long)(cls)) << 24) | (idx))
#define ClsOfBob(bob) (CLS)((bob) >> 24)
#define ImodFrBob(bob) ((IMOD)(bob))
#define IinstFrBob(bob) ((IINST)(bob))
#define IrefFrBob(bob) ((IREF)((bob) & 0xffffffL))
#define IdefFrBob(bob) ((IDEF)(bob))
#define IuseFrBob(bob) ((IUSE)((bob) & 0xffffffL))
#define IubyFrBob(bob) ((IUBY)((bob) & 0xffffffL))
#define IsymFrBob(bob) ((ISYM)(bob))
#define IbaseFrBob(bob) ((IBASE)(bob))
#define IdervFrBob(bob) ((IDERV)(bob))
#define IfrinFrBob(bob) ((IFRIN)(bob))
#define IfroutFrBob(bob) ((IFROUT)(bob))
#define BobFrMod(x) (BobFrClsIdx(clsMod, (x)))
#define BobFrSym(x) (BobFrClsIdx(clsSym, (x)))
#define BobFrInst(x) (BobFrClsIdx(clsInst, (x)))
#define BobFrRef(x) (BobFrClsIdx(clsRef, (x)))
#define BobFrDef(x) (BobFrClsIdx(clsDef, (x)))
#define BobFrUse(x) (BobFrClsIdx(clsUse, (x)))
#define BobFrUby(x) (BobFrClsIdx(clsUby, (x)))
#define BobFrBase(x) (BobFrClsIdx(clsBase, (x)))
#define BobFrDerv(x) (BobFrClsIdx(clsDerv, (x)))
#define BobFrFrin(x) (BobFrClsIdx(clsFrin, (x)))
#define BobFrFrout(x) (BobFrClsIdx(clsFrout, (x)))
// these are the query types
//
typedef enum _qy_ {
qyFiles, qySymbols, qyContains, qyDefinedIn,
qyCalls, qyCalledBy, qyUses, qyUsedBy,
qyUsedIn, qyBaseOf, qyDervOf, qyMembers,
qyMemberOf, qyImpMembers, qyFriendIn, qyFriendOut,
qyBaseSorted, qyBaseIncSorted, qyDervSorted, qyDervIncSorted,
qyDefs, qyRefs,
} QY;
// these are visible so that you can see how the query is progressing
// you may not write on these -- these values may or may not have anything
// to do with any database indices
//
extern IDX FAR idxQyStart;
extern IDX FAR idxQyCur;
extern IDX FAR idxQyMac;
BOOL BSC_API InitBSCQuery (QY qy, BOB bob);
BOB BSC_API BobNext(VOID);
LSZ BSC_API LszNameFrBob(BOB bob);
BOB BSC_API BobFrName(LSZ lsz);
// these are the instance types you can filter on
// they are called MBF's for historical reasons which are not clear to me
//
typedef WORD MBF;
// these may be or'd together
#define mbfNil 0
#define mbfVars 1
#define mbfFuncs 2
#define mbfMacros 4
#define mbfTypes 8
#define mbfClass 16
#define mbfAll 31
BOOL BSC_API FInstFilter (IINST iinst, MBF mbf);
// show outline for the given files (by imod, or by Pattern)
//
VOID BSC_API OutlineMod(IMOD imod, MBF mbfReqd);
BOOL BSC_API FOutlineModuleLsz (LSZ lszPattern, MBF mbfReqd);
LSZ BSC_API LszBaseName(LSZ lsz);
// list references for all symbols meeting the mbf requirement
//
BOOL BSC_API ListRefs (MBF mbfReqd);
// DOS style wildcard matching
//
BOOL BSC_API FWildMatch(LSZ lszPat, LSZ lszText);
// return, if successful, the range of bob's which are prefixed by the
// zero terminated string in lszprefix, the boolean indicates success
// matching is always case INSENSITIVE
//
BOOL BSC_API FindPrefixRange (LSZ lszprefix, ISYM FAR *pfirstisym, ISYM FAR *plastisym);
typedef void (BSC_API *PFN_BOB)(BOB);
typedef BOOL (BSC_API *PFN_BOB_EX)(BOB);
// callback the given function returning all the possible bob's that
// could match the given overloaded name
//
// LSZ can be of the form
//
// class:: (generates a list of all members of the class)
// class::foo (generates a list of all members named foo)
// foo (generates a list of all members foo in any class
// or top level items named foo)
//
// for the above forms foo can be a regular member or it can be 'operator+',
// 'operator new' etc. the class can also be a nested class such as
// class1::class2::foo
//
// GenerateOverloads now also supports these two 'wildcard' forms
//
// foo* (generates a list of all symbols starting with foo)
// class::foo* (as above but symbols must be in the given class)
//
// for these two forms foo may not be an operator (it would conflict with
// the likes of operator* and so forth)
//
// GenerateOverloadsEx accepts a PFN_BOB_EX, if the function pointed to
// by the argument ever returns FALSE then generation of overloads will be
// stopped (e.g. this allows you to show the first n overloads in a listbox)
// without having to wait for all the overloads to be computed
WORD BSC_API GenerateOverloads (LSZ, MBF, PFN_BOB); // obsolete
WORD BSC_API GenerateOverloadsEx (LSZ, MBF, PFN_BOB_EX);
// do secondary mappings on iref/idef/iinst
// find the iinst which was in context at the location of the given IREF
// e.g. if a you have an IREF for some local variable, the context iinst
// would be the function that it was defined in.
IINST IinstContextFrIref (IREF iref);
// find the iinst which contains the given IREF
IINST IinstFrIref(IREF);
// find the iinst which contains the given IDEF
IINST IinstFrIdef(IDEF);