home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / BSC32.ZIP / BSCREF.TXT < prev    next >
Text File  |  1994-01-24  |  77KB  |  1,805 lines

  1. ______________________________________________________________________
  2.  
  3. Browser Toolkit Library Reference - BSCREF.TXT
  4. Microsoft Visual C++ Browser Toolkit for Windows NT
  5. (C) Copyright Microsoft Corporation, 1993
  6.  
  7.      This document discusses the Microsoft Visual C++
  8.      Browser Toolkit API definitions. It explains how to use
  9.      the browser library to access the contents of a browser
  10.      database.
  11.  
  12. Contents
  13.  
  14.  
  15.      1    Using the Browser Library
  16.      
  17.           1.1  Compiling Programs
  18.      
  19.      2.   Browser Database Functions
  20.      
  21.           2.1  Callback Functions
  22.           2.2  Opening and Closing a Browser Database
  23.           2.3  Database Index Variables
  24.      
  25.                2.3.1     Modules (IMOD Variables)
  26.                2.3.2     Module Symbols (IMS Variables)
  27.                2.3.3     Symbols (ISYM Variables)
  28.                2.3.4     Symbol Instances (IINST Variables)
  29.                2.3.5     Definitions and References (IDEF
  30.                          and IREF Variables)
  31.                2.3.6     Uses/Used-by Information (IUSE and
  32.                          IUBY Variables)
  33.                2.3.7     Base and Derived Classes (IBASE and
  34.                          IDERV Variables)
  35.                2.3.8     Friend (In/Out) Classes (IFRIN and
  36.                          IFROUT Variables)
  37.      
  38.           2.4  Generating Calltrees and Classtrees
  39.      
  40.                2.4.1     Sample Calltrees
  41.                2.4.2     Sample Classtrees
  42.      
  43.           2.5  Listing Database References
  44.           2.6  File Outline Functions
  45.           2.7  String Processing Functions
  46.           2.8  Miscellaneous Functions
  47.      
  48.      3.   Browser Objects
  49.      
  50.           3.1  Creating and Manipulating BOB Variables
  51.           3.2  Performing Database Queries
  52.           3.3  Generating Name Overloads
  53.      
  54.      4.   Browser Library Index
  55.  
  56. ______________________________________________________________________
  57.  
  58. 1  Using the Browser Library
  59.  
  60.      The Browser Toolkit includes a powerful library of
  61.      functions that give you complete access to browser
  62.      database files created by Microsoft Visual C++. This
  63.      browser library, named BSC.LIB, contains functions that
  64.      access browser database files (.BSC), query database
  65.      tables, and even generate information, such as
  66.      calltrees and symbol reference tables. Additionally,
  67.      BSC.LIB incorporates functions that access and
  68.      manipulate information about C++ classes and objects
  69.      that may be present in a browser database. For example,
  70.      some of these functions create classtrees and return
  71.      undecorated names of C++ functions (typically stored in
  72.      decorated form).
  73.      
  74.      To provide BSC.LIB users maximum flexibility, the
  75.      Browser Toolkit allows you to implement several
  76.      callback functions described below (see section 2.1).
  77.      
  78.      A callback function is one that performs a particular
  79.      system service required by the browser library. Some
  80.      examples of such services are memory allocation, file
  81.      I/O, and error-handling. The BSC.LIB file provides
  82.      callbacks so that the browser library does not have to
  83.      depend on the run-time library for these services.
  84.      Instead, library functions "call back" to the function
  85.      designated to perform a particular service without the
  86.      library requiring any knowledge of how this service is
  87.      performed. Because you have the option of writing your
  88.      own callbacks, these functions provide a flexible
  89.      interface to any environment that might require special
  90.      access to run-time resources.
  91.  
  92. ______________________________________________________________________
  93.  
  94. 1.1  Compiling Programs
  95.  
  96.      To compile a browser program (such as the BSCDUMP.C
  97.      program used in this example) and link it with BSC.LIB
  98.      at the MS-DOS prompt, you can use the following
  99.      command:
  100.      
  101.      cl -W3 -I. bscdump.c bsc.lib -link -nodefaultlib:libcmt.lib
  102.         -defaultlib:libc.lib
  103.      
  104.      NOTE:  If you choose to define the callbacks (described
  105.      in the following section) required by the library, they
  106.      will not be linked from BSC.LIB. Defining these
  107.      callbacks yourself allows BSC.LIB to be used in any
  108.      custom environments you may have (such as Windows real
  109.      mode, for example).  Be sure to link with the
  110.      appropriate file(s) containing your callback
  111.      definitions
  112.  
  113. ______________________________________________________________________
  114.  
  115. 2  Browser Database Functions
  116.  
  117.      The following sections describe various browser
  118.      database functions.
  119.  
  120. ______________________________________________________________________
  121.  
  122. 2.1 Callback Functions
  123.  
  124.      The BSC.LIB file provides default versions of all
  125.      callback functions. These defaults should provide you
  126.      with the necessary flexibility to develop programs for
  127.      most environments.  However, if an environment does not
  128.      permit the use of normal run-time calls, you must
  129.      define several callback functions to avoid dependency
  130.      on the C standard I/O library. Table 2 outlines the
  131.      prototypes for functions that handle basic I/O and
  132.      memory allocation and deallocation. If you implement
  133.      these functions yourself, ensure that your versions
  134.      follow the specifications described below.
  135.      
  136.      Table 2:  Callback Functions
  137.  
  138.      ------------------------------------------------------------
  139.      Callback To  Prototype                 Result
  140.      ------------------------------------------------------------
  141.      Standard     LPV BSC_API LpvAllocCb(   A void far
  142.      memory           WORD cb)              pointer must be
  143.      allocation                             returned to a
  144.      function                               block of size cb
  145.                                             bytes. If the
  146.                                             block of memory
  147.                                             has not been
  148.                                             allocated, then
  149.                                             the return value
  150.                                             should be NULL.
  151.                                           
  152.      Standard     VOID BSC_API FreeLpv(     Given a void far
  153.      memory           LPV lpv)              pointer to a
  154.      deallocatio                            block of memory
  155.      n function                             lpv, the
  156.                                             function must
  157.                                             deallocate the
  158.                                             memory block.
  159.                                           
  160.      Standard     int BSC_API BSCOpen(      Opens the file
  161.      file open        LSZ lszFileName,      lszFileName and
  162.      function         int mode)             prepares the
  163.                                             file for
  164.                                             subsequent
  165.                                             reading or
  166.                                             writing, as
  167.                                             defined by mode.
  168.                                             The function
  169.                                             must return a
  170.                                             file handle for
  171.                                             the opened file.
  172.                                             A return value
  173.                                             of -1 should
  174.                                             indicate an
  175.                                             error. The mode
  176.                                             parameter may be
  177.                                             any combination
  178.                                             of the  O_* bits
  179.                                             that are used in
  180.                                             the standard
  181.                                             open() call. At
  182.                                             this time,
  183.                                             however, the
  184.                                             library will
  185.                                             make this call
  186.                                             only with mode =
  187.                                             O_BINARY |
  188.                                             O_RDONLY.
  189.                                           
  190.      Standard     int BSC_API BSCClose(     Closes the file
  191.      file close       int handle)           with the given
  192.      function                               handle value. A
  193.                                             return of 0
  194.                                             should indicate
  195.                                             success.
  196.                                           
  197.      Standard     int BSC_API BSCRead(      Reads a number
  198.      file read        int handle,           of bytes ch from
  199.      function         LPCH lpchBuf,         the file with
  200.                       WORD ch)              the given handle
  201.                                             into the far
  202.                                             character buffer
  203.                                             pointed to by
  204.                                             lpchBuf. The
  205.                                             return value
  206.                                             should be the
  207.                                             number of actual
  208.                                             bytes that were
  209.                                             read, or -1 if
  210.                                             an error
  211.                                             occurred.
  212.  
  213.      Standard     int BSC_API BSCSeek(      Moves the file
  214.      file seek        int handle,           pointer
  215.      function         long lPos,            associated with
  216.                       int mode)             the file with
  217.                                             the given handle
  218.                                             to a new
  219.                                             location, lpos
  220.                                             bytes from the
  221.                                             position in the
  222.                                             file determined
  223.                                             by mode. Here,
  224.                                             mode can be any
  225.                                             of SEEK_CUR,
  226.                                             SEEK_END, or
  227.                                             SEEK_SET as in
  228.                                             the lseek() call
  229.                                             from the C
  230.                                             standard
  231.                                             library.
  232.                                             Currently, only
  233.                                             SEEK_SET is used
  234.                                             by BSC.LIB. The
  235.                                             return value
  236.                                             should be -1 on
  237.                                             an error; any
  238.                                             other value
  239.                                             indicates
  240.                                             success.
  241.                                           
  242.      ASCII text   VOID BSC_API BSCOutput(   Writes the given
  243.      output           LSZ lsz)              zero-terminated
  244.      function                               string to the
  245.                                             standard output.
  246.                                             This function is
  247.                                             called by the
  248.                                             library whenever
  249.                                             it wants to
  250.                                             output any text
  251.                                             (that is, for a
  252.                                             calltree or
  253.                                             classtree,
  254.                                             outline, or
  255.                                             other request).
  256.                                             The default
  257.                                             implementation
  258.                                             writes to the
  259.                                             standard output;
  260.                                             however, a user
  261.                                             implementation
  262.                                             of this function
  263.                                             can direct the
  264.                                             output
  265.                                             elsewhere.
  266.  
  267.      Error-       VOID BSC_API SeekError(   These functions
  268.      handling         LSZ LszFilename)      should be
  269.      functions                              provided to
  270.                                             handle the
  271.                   VOID BSC_API ReadError(   occurrence of
  272.                       LSZ LszFilename)      any one of the
  273.                                             corresponding
  274.                                             errors. The
  275.                   VOID BSC_API BadBSCVer(   string parameter
  276.                       LSZ LszFilename)      is the name of
  277.                                             the file
  278.                                             involved in the
  279.                                             error. If these
  280.                                             functions choose
  281.                                             to exit the
  282.                                             application,
  283.                                             they should
  284.                                             close any
  285.                                             file(s) the
  286.                                             browser has
  287.                                             opened.
  288.  
  289. ______________________________________________________________________
  290.  
  291. 2.2 Opening and Closing a Browser Database
  292.  
  293.      Two browser library functions open and close a browser
  294.      database file. The following table details the
  295.      prototypes for these functions.
  296.      
  297.      Table 3:  File Opening/Closing Functions
  298.  
  299.      ------------------------------------------------------------
  300.      Purpose    Prototype                   Result
  301.      ------------------------------------------------------------
  302.      Opens the  BOOL BSC_API FOpenBSC       Opens the
  303.      .BSC file  (LSZ lszName)               specified
  304.                                             database file
  305.                                             lszName. Returns
  306.                                             the value TRUE if
  307.                                             successful, or
  308.                                             FALSE if
  309.                                             unsuccessful. The
  310.                                             lszName parameter
  311.                                             can be any valid
  312.                                             path name to a
  313.                                             .BSC file.
  314.                                          
  315.      Closes     VOID BSC_API CloseBSC       Closes the
  316.      the .BSC   (VOID)                      current database
  317.      file                                   file. This will
  318.                                             free any memory
  319.                                             the library may
  320.                                             be using.
  321.  
  322. ______________________________________________________________________
  323.  
  324. 2.3  Database Index Variables
  325.  
  326.      Each object found in the browser database is
  327.      represented by a numerical index value that uniquely
  328.      identifies one database object. The name of every index
  329.      variable type begins with the letter "I" and ends with
  330.      letters referring to the kind of object indexed by the
  331.      variable. Each of these index variable types and the
  332.      functions that operate on them are described below.
  333.  
  334. 2.3.1  Modules (IMOD Variables)
  335.  
  336.      Each module in the database has an associated module
  337.      index (IMOD) value. Using the functions detailed in the
  338.      following table, you can convert a filename into a
  339.      module index, convert a module index into a filename,
  340.      or enumerate all the module index values in the
  341.      database.
  342.      
  343.      Table 4:  IMOD Conversion Functions
  344.  
  345.      ------------------------------------------------------------
  346.      Purpose     Prototype                  Result
  347.      ------------------------------------------------------------
  348.      Converts    LSZ BSC_API LszNameFrMod   LszNameFrMod
  349.      from IMOD   (IMOD imod)                (given a
  350.      to module                              module index
  351.      name                                   imod) returns
  352.                                             the zero-
  353.                                             terminated
  354.                                             string name
  355.                                             for that
  356.                                             symbol index.
  357.                                             
  358.      Converts    IMOD BSC_API ImodFrLsz     ImodFrLsz
  359.      from        (LSZ lszModName)           returns the
  360.      module                                 index, if one
  361.      name to                                exists, from
  362.      IMOD                                   the symbol
  363.                                             name
  364.                                             lszModName. If
  365.                                             that module
  366.                                             name does not
  367.                                             exist, then
  368.                                             the return
  369.                                             value is
  370.                                             imodNil.
  371.                                             
  372.      Determine   IMOD BSC_API ImodMac       The return
  373.      s largest   (VOID)                     value is the
  374.      IMOD                                   biggest IMOD
  375.      value                                  index in this
  376.                                             database; the
  377.                                             range of these
  378.                                             indexes is
  379.                                             from zero to
  380.                                             the return
  381.                                             value less
  382.                                             one.
  383.      
  384.      
  385.      
  386. 2.3.2  Module Symbols (IMS Variables)
  387.  
  388.      The browser database contains a list of all the symbol
  389.      instances (see section 2.3.4, Symbol Instances) defined
  390.      in any particular module. These module symbols also are
  391.      referenced via a module symbol index (called an IMS
  392.      value). Given a module index (IMOD) variable, certain
  393.      library functions can find the range of valid module
  394.      symbol index (IMS) values for that module. This range
  395.      of values then can be used to reveal the contents of
  396.      that module. Table 5 describes functions that either
  397.      operate on or return IMS values.
  398.      
  399.      
  400.      Table 5:  IMS Values
  401.  
  402.      ------------------------------------------------------------
  403.      Purpose    Prototype                   Result
  404.      ------------------------------------------------------------
  405.      Determines VOID BSC_API MsRangeOfMod(  The IMS values
  406.      the range      IMOD imod,              pointed to by
  407.      of IMS         IMS far *pimsMin,       pimsMin and
  408.      values for     IMS far *pimsMac)       pimsMac will
  409.      the given                              contain the
  410.      IMOD                                   IMS start and
  411.                                             end values for
  412.                                             the specified
  413.                                             module index.
  414.                                             If pimsMin is
  415.                                             equal to
  416.                                             pimsMac, then
  417.                                             the specified
  418.                                             module (imod)
  419.                                             contains no
  420.                                             definitions
  421.                                             and hence has
  422.                                             no
  423.                                             corresponding
  424.                                             IMS values.
  425.                                              
  426.      Gets the   IINST BSC_API IinstOfIms(   Given the
  427.      instance       IMS ims)                index ims of a
  428.      index                                  module symbol,
  429.      (IINST)                                this function
  430.      from the                               returns the
  431.      module                                 instance index
  432.      symbol                                 for subsequent
  433.      index (IMS)                            use in other
  434.                                             calls. Refer
  435.                                             to section
  436.                                             2.3.4 for a
  437.                                             discussion of
  438.                                             symbol
  439.                                             instances.
  440.      
  441.      
  442. 2.3.3  Symbols (ISYM Variables)
  443.  
  444.      All symbols (identifiers) of any type have an
  445.      associated symbol index (ISYM); that is, there is a one-
  446.      to-one correspondence between symbol indexes and symbol
  447.      names known to the database. The range of valid symbol
  448.      index values is determined by the call
  449.      
  450.           ISYM BSC_API IsymMac (VOID)
  451.      
  452.      which determines the size of a browser database's
  453.      symbol table.
  454.      
  455.      The return value is the biggest symbol index in the
  456.      particular browser database being queried. The range of
  457.      valid indexes is from zero to the return value less
  458.      one. Symbol index values are assigned to symbols in
  459.      alphabetical order (with one exception: a leading
  460.      question mark in decorated names is ignored). For
  461.      example, to obtain a list of symbols in sorted order,
  462.      you need only obtain the text of symbols with ISYM
  463.      values of 0, 1, 2 , 3, and so forth, up to the value
  464.      returned by IsymMac less one.
  465.      
  466.      Another library function determines the smallest symbol
  467.      index whose value is greater than or equal to that of a
  468.      given symbol name.
  469.      
  470.           ISYM BSC_API IsymSupLsz (LSZ lszSymName)
  471.      
  472.      Strings can be converted to symbol indexes (and vice
  473.      versa) using the following calls:
  474.      
  475.           LSZ BSC_API LszNameFrSym (ISYM isym)
  476.           ISYM BSC_API IsymFrLsz (LSZ lszSymName)
  477.      
  478.      Given an index isym, LszNameFrSym returns the zero-
  479.      terminated string name for the symbol index. IsymFrLsz
  480.      returns the index, if one exists, from the symbol name
  481.      lszSymName. If that symbol name does not exist in the
  482.      database, the function returns isymNil.
  483.      
  484.      To get data other than the name from a symbol index,
  485.      you must enumerate its corresponding instance values,
  486.      which correspond to the various instances of that
  487.      symbol. These instance values are discussed next.
  488.  
  489. 2.3.4  Symbol Instances (IINST Variables)
  490.  
  491.      Every symbol in a browser database is associated with
  492.      several instances, each of which corresponds to a
  493.      different way the symbol is used in the program(s)
  494.      described in the browser database (see Table 6). For
  495.      example, the symbol "mysymbol" might be used as a
  496.      static variable in one place, and as a function
  497.      parameter in another. The browser library keeps track
  498.      of these various instances using instance index values
  499.      called IINST variables.
  500.  
  501.  
  502.      Table 6:  IINST Values
  503.  
  504.      ------------------------------------------------------------
  505.      Purpose    Prototype                   Result
  506.      ------------------------------------------------------------
  507.      Determines VOID BSC_API                Fills in the
  508.      the range  InstRangeOfSym (            values of
  509.      of valid       ISYM isym,              piinstMin and
  510.      IINST          IINST far *piinstMin,   piinstMac in an
  511.      values for     IINST far *piinstMac)   analogous way to
  512.      a                                      MsRangeOfMod()
  513.      particular                             described in
  514.      symbol                                 Table 5.
  515.      (isym)
  516.                                           
  517.      Finds the  IINST BSC_API IinstMac (    As with
  518.      range of       VOID)                   ImodMac() and
  519.      valid                                  IsymMac(),
  520.      IINST                                  IinstMac returns
  521.      values for                             the upper bound
  522.      the whole                              on valid IINST
  523.      database                               values. IINST
  524.                                             values range
  525.                                             from zero to the
  526.                                             return value
  527.                                             less one.
  528.                                           
  529.      Retrieves  VOID BSC_API InstInfo (     Fills in the
  530.      information    IINST iinst,            corresponding
  531.      about a        ISYM far *pisyminst,    symbol, type,
  532.      particular     TYP far *ptype,         and attribute
  533.      instance       ATR far *pattr)         values (pointer
  534.                                             to ISYM, TYP,
  535.                                             and ATR, respect-
  536.                                             ively) given an
  537.                                             IINST. ISYM
  538.                                             values are
  539.                                             discussed in
  540.                                             section 2.3.3.
  541.                                           
  542.      Finds the  IINST IinstContextFrIref(   Returns the
  543.      IINST          IREF iref)              IINST value for
  544.      value that                             the instance
  545.      best                                   that best
  546.      represents                             represents the
  547.      the context                            context at the
  548.      at the                                 reference
  549.      location                               indicated by the
  550.      of the                                 given iref.  If
  551.      given IREF.                            it finds no such
  552.      For                                    instance index,
  553.      example, if                            the function
  554.      you have an                            returns
  555.      IREF for                               iinstNil. IREF
  556.      some                                   variables are
  557.      variable,                              discussed in
  558.      the context                            section 2.3.5.
  559.      IINST would                            This function
  560.      be the                                 uses a
  561.      function                               heuristic, "best
  562.      that the                               guess" algorithm
  563.      variable                               that is highly
  564.      was defined                            accurate, though
  565.      in.                                    not 100% so.
  566.  
  567.      Finds the  IINST IinstFrIref (         Returns the
  568.      IINST          IREF iref)              IINST value for
  569.      which                                  the instance
  570.      contains                               that contains
  571.      the given                              the reference
  572.      IREF.                                  indicated by
  573.                                             iref.  If it
  574.                                             finds no such
  575.                                             instance index,
  576.                                             the function
  577.                                             returns
  578.                                             iinstNil. This
  579.                                             function will
  580.                                             fail if iref is
  581.                                             an invalid
  582.                                             reference index.
  583.                                             IREF variables
  584.                                             are discussed in
  585.                                             section 2.3.5.
  586.  
  587.      Finds the  IINST IinstFrIdef (         Returns the
  588.      IINST          IDEF idef)              IINST value for
  589.      which                                  the instance
  590.      contains                               that contains
  591.      the given                              the definition
  592.      IDEF.                                  indicated by
  593.                                             idef.  If it
  594.                                             finds no such
  595.                                             instance index,
  596.                                             the function
  597.                                             returns
  598.                                             iinstNil.  This
  599.                                             function will
  600.                                             fail if idef is
  601.                                             an invalid
  602.                                             definition
  603.                                             index. IDEF
  604.                                             variables are
  605.                                             discussed in
  606.                                             section 2.3.5.
  607.  
  608.      The type value (refer to InstInfo in Table 6) will be
  609.      exactly one of the following:
  610.      
  611.      INST_TYP_FUNCTION   INST_TYP_LABEL      INST_TYP_PARAMETER
  612.      INST_TYP_VARIABLE   INST_TYP_CONSTANT   INST_TYP_MACRO
  613.      INST_TYP_TYPEDEF    INST_TYP_STRUCNAM   INST_TYP_ENUMNAM
  614.      INST_TYP_ENUMMEM    IINST_TYP_UNIONNAM  INST_TYP_SEGMENT
  615.      INST_TYP_GROUP      INST_TYP_PROGRAM    INST_TYP_CLASSNAM
  616.      INST_TYP_MEMFUNC    INST_TYP_MEMVAR
  617.      
  618.      Note that three of these constants refer to C++
  619.      symbols: INST_TYP_CLASSNAM, INST_TYP_MEMFUNC, and
  620.      INST_TYP_MEMVAR.
  621.      
  622.      The attribute value describes the storage class and/or
  623.      scope of the instance. Any combination of the attribute
  624.      bits may be set, although some combinations do not make
  625.      sense and thus do not occur in practice. These bits can
  626.      be tested using the C/C++ languages' bitwise operators,
  627.      or through the use of the FInstFilter function
  628.      (described in Table 7). The attribute bits are as
  629.      follows:
  630.      
  631.      INST_ATR_LOCAL   INST_ATR_STATIC   INST_ATR_SHARED
  632.      INST_ATR_NEAR    INST_ATR_COMMON   INST_ATR_DECL_ONLY
  633.      INST_ATR_PUBLIC  INST_ATR_NAMED    INST_ATR_MODULE
  634.      INST_ATR_VIRTUAL INST_ATR_PRIVATE  INST_ATR_PROTECT
  635.      
  636.      Additionally, for inheritance mode attributes, the
  637.      following constants have been defined:
  638.      
  639.      IMODE_VIRTUAL    IMODE_PRIVATE          IMODE_PUBLIC
  640.      IMODE_PROTECT
  641.      
  642.      Several functions designed to help with some typical
  643.      operations on instance index values are shown in Table
  644.      7.
  645.      
  646.      Table 7:  Attribute-Testing Functions
  647.  
  648.      ------------------------------------------------------------
  649.      Purpose     Prototype                  Result
  650.      ------------------------------------------------------------
  651.      Acts as an  BOOL BSC_API FInstFilter ( FInstFilter
  652.      attribute       IINST iinst,           returns TRUE if
  653.      filter          MBF mbf)               the given IINST
  654.                                             value has a TYP
  655.                                             value that
  656.                                             corresponds
  657.                                             with the value
  658.                                             passed in mbf.
  659.                                             See the list of
  660.                                             possible MBF
  661.                                             values below
  662.                                             this table.
  663.  
  664.      Gets an     LSZ BSC_API LszTypInst (   Returns the
  665.      ASCII           IINST iinst)           zero-terminated
  666.      version of                             ASCII string
  667.      an IINST                               from the
  668.      variable                               instance index
  669.      type                                   iinst. These
  670.                                             correlate
  671.                                             directly with
  672.                                             the types given
  673.                                             above as
  674.                                             INST_TYP_LABEL
  675.                                             and so on.
  676.                                             
  677.      Dumps a     VOID BSC_API DumpInst (    Outputs
  678.      single          IINST iinst)           information
  679.      instance                               about the
  680.                                             instance
  681.                                             indexed by
  682.                                             iinst to the
  683.                                             standard output
  684.                                             using the
  685.                                             BSCOutput()
  686.                                             callback. The
  687.                                             format of the
  688.                                             output is
  689.                                             described
  690.                                             below.
  691.      
  692.      FInstFilter requires an instance type filter as one of
  693.      its parameters. The instance type (called an MBF) can
  694.      be any bitwise-OR combination of the following
  695.      constants:
  696.      
  697.      mbfNil    mbfVars   mbfFuncs  mbfMacros
  698.      mbfTypes  mbfClass  mbfAll
  699.      
  700.      The instance information output provided by DumpInst
  701.      has the following format:
  702.      
  703.      <ascii instance name>  <ascii type name>  <ascii attribute names>
  704.  
  705. 2.3.5  Definitions and References (IDEF and IREF Variables)
  706.  
  707.      Each instance in the database has an associated set of
  708.      definitions and references, which also are tracked
  709.      using index variables (IDEF and IREF). The two
  710.      functions below return the range of valid definition
  711.      and reference index values for a given instance.
  712.      
  713.           VOID BSC_API DefRangeOfInst (IINST iinst,
  714.                                    IDEF far *pidefMin,
  715.                                    IDEF far *pidefMac)
  716.      
  717.           VOID BSC_API RefRangeOfInst (IINST iinst,
  718.                                    IREF far *pirefMin,
  719.                                    IREF far *pirefMac)
  720.      
  721.      The first of these functions returns index limits in
  722.      two IDEF variables; the second returns the limits in
  723.      IREF variables. From a definition or reference index,
  724.      the actual filename and line number of a particular
  725.      instance reference or definition can be determined
  726.      using one of the following functions:
  727.      
  728.           VOID BSC_API DefInfo (IDEF idef,
  729.                              LSZ far *plszName,
  730.                              WORD far *pline)
  731.      
  732.           VOID BSC_API RefInfo (IDEF iref,
  733.                              LSZ far *plszName,
  734.                              WORD far *pline)
  735.      
  736.      NOTE:  Study the prototype for these two functions
  737.      carefully. The LSZ argument is handled in an atypical
  738.      way. Instead of placing text in a buffer that the
  739.      caller provides, the library actually fills in a
  740.      pointer to one of its internal buffers where the
  741.      filename can be found. The LSZ pointer is set to point
  742.      to this buffer. If you intend to use the contents of
  743.      this buffer after making another call to the library,
  744.      be sure to copy these contents, or they may be lost in
  745.      the next library call.
  746.  
  747. 2.3.6  Uses/Used-by Information (IUSE and IUBY Variables)
  748.  
  749.      Each symbol in the database has an associated set of
  750.      instances that use the given symbol or that the symbol
  751.      uses. These "uses" and "used-by" instances have
  752.      associated index variables called IUSE and IUBY,
  753.      respectively. For a particular instance, these
  754.      uses/used-by instances can be accessed by first
  755.      determining the range of valid uses/used-by index
  756.      values via one of the following functions:
  757.      
  758.           VOID BSC_API UseRangeOfInst (IINST iinst,
  759.                                    IUSE far *piuseMin,
  760.                                    IUSE far *piuseMac)
  761.      
  762.           VOID BSC_API UbyRangeOfInst  (IINST iinst,
  763.                                     IUBY far *piubyMin,
  764.                                     IUBY far *piubyMac)
  765.      
  766.      From a "uses" or "used-by" instance index, the
  767.      corresponding instance that uses or is used by the
  768.      queried instance can be found, as can the number of
  769.      times such use occurs.
  770.      
  771.           VOID BSC_API  UseInfo (IUSE iuse,
  772.                               IINST far *piinst,
  773.                               WORD far *pcnt)
  774.      
  775.           VOID BSC_API UbyInfo (IUBY iuby,
  776.                              IINST far *piinst,
  777.                              WORD far *pcnt)
  778.      
  779.      After a call to one of the above functions, piinst will
  780.      point to the instance index (IINST) value for the
  781.      instance to which the IUSE or IUBY variable refers. The
  782.      pcnt variable will point to the number of times the
  783.      respective use occurs.
  784.      
  785. 2.3.7  Base and Derived Classes (IBASE and IDERV Variables)
  786.  
  787.      Some instances in the browser database could refer to
  788.      classes that they are based on or from which they are
  789.      derived. In similar form to other index-range
  790.      functions, two library functions provide the valid base
  791.      class or derived class index range:
  792.      
  793.           VOID BSC_API  BaseRangeOfInst (IINST iinst,
  794.                                     IBASE far *pibaseMin,
  795.                                     IBASE far *pibaseMac)
  796.      
  797.           VOID BSC_API DervRangeOfInst (IINST iinst,
  798.                                    IDERV far *pidervMin,
  799.                                    IDERV far *pidervMac)
  800.      
  801.      If an instance does not represent a class, then the
  802.      Min/Mac pointers will point to the same value.
  803.      
  804.      Given an index to a base, you can obtain information
  805.      about the base or derived classes using the following
  806.      functions:
  807.      
  808.           VOID BSC_API BaseInfo(IBASE ibase,
  809.                              IINST far *piinst,
  810.                              WORD far *pmode)
  811.      
  812.           VOID BSC_API DervInfo(IDERV iderv,
  813.                              IINST far *piinst,
  814.                              WORD far *pmode)
  815.      
  816.      For a given IBASE or IDERV index, these functions
  817.      return the instance for the base/derived class and the
  818.      inheritance mode.
  819.      
  820.  
  821. 2.3.8  Friend (Incoming/Outgoing) Classes (IFRIN and IFROUT
  822. Variables)
  823.  
  824.      Assume that your code has a class named A. An incoming
  825.      friend of class A is a class that gives class A friend
  826.      access. An outgoing friend of class A is a class that
  827.      obtains friend access from class A. Note that it is
  828.      possible for a function to have incoming friends but no
  829.      outgoing friends (that is, a function can be given
  830.      friend access, but the function does not give such
  831.      access). For each type of friend, index variables
  832.      (either IFRIN or IFROUT) track all friend instances.
  833.      For a particular instance, there may be several other
  834.      instances that give or obtain friend access to or from
  835.      other instances. Given an instance index, the following
  836.      functions return the valid range of friend indexes for
  837.      that instance:
  838.      
  839.           VOID BSC_API FrinRangeOfInst(IINST iinst,
  840.                                    IFRIN far *pifrinMin,
  841.                                    IFRIN far *pifrinMac)
  842.      
  843.           VOID BSC_API FroutRangeOfInst(IINST iinst,
  844.                                     IFROUT far *pifroutMin,
  845.                                     IFROUT far *pifroutMac)
  846.      
  847.      Given a single friend index (either incoming or
  848.      outgoing), the following functions return the instance
  849.      of the corresponding friend:
  850.      
  851.           VOID BSC_API FrinInfo(IFRIN ifrin,
  852.                              IINST far *piinst)
  853.      
  854.           VOID BSC_API FroutInfo(IFROUT ifrout,
  855.                               IINST far *piinst)
  856.  
  857. ______________________________________________________________________
  858.  
  859. 2.4 Generating Calltrees and Classtrees
  860.  
  861.      A very important feature of the browser database is the
  862.      ability to generate calltrees from any function and
  863.      classtrees from any C++ class instance or name. These
  864.      trees may be generated in both forward and backward
  865.      directions from the given instance index or symbol
  866.      name. The following functions generate the calltree or
  867.      classtree from either an instance index or a symbol
  868.      name, respectively:
  869.      
  870.      Calltrees:
  871.      
  872.           VOID BSC_API CallTreeInst (IINST iinst)
  873.           VOID BSC_API RevTreeInst (IINST iinst)
  874.      
  875.           VOID BSC_API FCallTreeLsz (LSZ lszName)
  876.           VOID BSC_API FRevTreeLsz (LSZ lszName)
  877.      
  878.      Classtrees:
  879.      
  880.           VOID BSC_API ClassTreeInst (IINST iinst)
  881.           VOID BSC_API RevClassTreeInst (IINST iinst)
  882.      
  883.           VOID BSC_API FRevClassTreeLsz (LSZ lszname)
  884.           VOID BSC_API FClassTreeLsz (LSZ lszname)
  885.      
  886.      For calltrees, the symbol name may be either the name
  887.      of a function or the name of a module. In the latter
  888.      case, the root of the tree is the module name; the
  889.      child subtrees are the functions contained in that
  890.      module. For classtrees, the symbol name may be the name
  891.      of a function, variable, or class.
  892.      
  893.      The result is ASCII text output to the standard output.
  894.      Indentations denote different levels of the tree. If
  895.      any node is visited more than once, due to cycles in
  896.      the call graph, then the node's name will be succeeded
  897.      by an ellipsis (...). If the source script of the
  898.      function is not known, then it will be followed by a
  899.      question mark (?).
  900.      
  901.      The following is sample source code that will be used
  902.      to demonstrate the output of these and, in subsequent
  903.      sections, other functions.
  904.      
  905.      #include <stdio.h>
  906.      void one (void);
  907.      void two (void);
  908.      void three (void);
  909.      void five (void);
  910.      
  911.      void one()
  912.      {
  913.          printf("One, ");
  914.      }
  915.      
  916.      void two()
  917.      {
  918.          printf("Two, ");
  919.          three();
  920.          five();
  921.      }
  922.      
  923.      void three()
  924.      {
  925.          printf("Three, ");
  926.      }
  927.      
  928.      void five()
  929.      {
  930.          printf("Five\n");
  931.      }
  932.      
  933.      main()
  934.      {
  935.          printf("This program prints the first ");
  936.          printf("five Fibonacci numbers . . .\n");
  937.          one();
  938.          one();
  939.          two();
  940.      }
  941.      
  942. 2.4.1  Sample Calltrees
  943.  
  944.      The following are five separate forward calltrees for
  945.      the symbols main, one, two, three, and five from the
  946.      source script listed above:
  947.      
  948.      main           one         two         three       five
  949.      |__printf[2]?  |__printf?  |__printf?  |__printf?  |__printf?
  950.      |__one[2]                  |__three
  951.      |  |__printf?              |  |__printf?
  952.      |__two                     |__five
  953.         |__printf?                 |__printf?
  954.         |__three
  955.         |  |__printf?
  956.         |__five
  957.            |__printf?
  958.      
  959.      The two reverse calltrees listed below are for the
  960.      symbols printf and five from the sample source:
  961.      
  962.      printf              five
  963.      |__one              |__two
  964.      |  |__main[2]           |__main
  965.      |__two
  966.      |  |__main...
  967.      |__three
  968.      |  |__two...
  969.      |__five
  970.      |  |__two...
  971.      |__main[2]...
  972.  
  973. 2.4.2  Sample Classtrees
  974.  
  975.      The tree on the left is a forward classtree for the
  976.      symbol CWnd from the HELLOAPP program provided with
  977.      Visual C++ (see the MFC SAMPLES directory). The tree on
  978.      the right is a reverse classtree for the symbol
  979.      CHelloWindow from the same program.
  980.      
  981.       CWnd                    CHelloWindow
  982.       |__CDialog              |__CFrameWnd
  983.       |  |__CModalDialog         |__CWnd
  984.       |__CStatic                    |__CCmdTarget
  985.       |__CButton                       |__CObject
  986.       |  |__CBitmapButton                 |__CObjectRoot
  987.       |__CListBox
  988.       |__CComboBox
  989.       |__CEdit
  990.       |__CScrollBar
  991.       |__CFrameWnd
  992.       |  |__CMDIFrameWnd
  993.       |  |__CMDIChildWnd
  994.       |  |__CHelloWindow
  995.       |__CView
  996.          |__CScrollView
  997.  
  998. ______________________________________________________________________
  999.  
  1000. 2.5  Listing Database References
  1001.  
  1002.      The following function, ListRefs, lists references of
  1003.      all symbols in the browser database which meet the
  1004.      requirements set by the filter mask mbfReqd. These
  1005.      symbols will be dumped to the standard output. If the
  1006.      function is unable to complete its task, then the
  1007.      return value is FALSE; otherwise it is TRUE.
  1008.      
  1009.           BOOL BSC_API ListRefs (MBF mbfReqd)
  1010.      
  1011.      The filter mask can be set using the bitwise OR
  1012.      operator, as in
  1013.      
  1014.           ListRefs (mbfFuncs | mbfMacros | mbfTypes)
  1015.      
  1016.      which produces the following output for the sample
  1017.      script listed above:
  1018.      
  1019.      FUNCTION  CALLED BY LIST
  1020.      
  1021.      five:     two
  1022.      main:
  1023.      one:      main[2]
  1024.      printf:   one       two
  1025.                three     five
  1026.                main[2]
  1027.      three:    two
  1028.      two:      main
  1029.      
  1030.      MACRO     USED BY LIST
  1031.      
  1032.      _MSC_VER:
  1033.      
  1034.      TYPE      USED BY LIST
  1035.      
  1036.      _iobuf:
  1037.      FILE:
  1038.      fpos_t:
  1039.      size_t:
  1040.      va_list:
  1041.  
  1042. ______________________________________________________________________
  1043.  
  1044. 2.6  File Outline Functions
  1045.  
  1046.      The following function outputs an outline of a module:
  1047.      
  1048.           VOID BSC_API OutlineMod (IMOD imod, MBF mbf)
  1049.      
  1050.      Given a module symbol index imod and a filter mask mbf,
  1051.      this function sends to the standard output all of the
  1052.      symbols in that module with attributes and type that
  1053.      match the required filter. For example, a call of this
  1054.      fuction
  1055.      
  1056.           OutlineMod (imod, mbfVars | mbfFuncs)
  1057.      
  1058.      produces the following output:
  1059.      
  1060.      
  1061.      fib.c
  1062.        five    (function:public)
  1063.        main    (function:public)
  1064.        one     (function:public)
  1065.        three   (function:public)
  1066.        two     (function:public)
  1067.      
  1068.      The following function outputs the outline for the
  1069.      module(s) matching a name or pattern:
  1070.      
  1071.           BOOL BSC_API FOutlineModuleLsz (LSZ lszName, MBF mbf)
  1072.      
  1073.      This function performs similarly to OutLineMod, except
  1074.      the zero-terminated string lszName may contain the
  1075.      pattern-matching wildcards   * and ?.
  1076.  
  1077. ______________________________________________________________________
  1078.  
  1079. 2.7  String Processing Functions
  1080.      
  1081.      Table 8 describes the operation of string processing
  1082.      functions.
  1083.      
  1084.      Table 8:  String Processing Functions
  1085.  
  1086.      ------------------------------------------------------------
  1087.      Action     Prototype                   Result
  1088.      ------------------------------------------------------------
  1089.      Simple     VOID BSC_API BSCFormat (    Format from
  1090.      formatter      LPCH lpchOut,           the string
  1091.                     LSZ lszFormat,          lszFormat to
  1092.                     va_list va)             the string
  1093.                                             lpchOut as
  1094.                                             specified by
  1095.                                             the standard
  1096.                                             switch (for
  1097.                                             example, %s).
  1098.                                             
  1099.      Simple    VOID BSC_API BSCPrintf (     Takes one or
  1100.      printf        LSZ lszFormat,           more zero-
  1101.      replacement   ...)                     terminated
  1102.                                             strings and
  1103.                                             outputs them
  1104.                                             to the
  1105.                                             standard
  1106.                                             output. Only
  1107.                                             two switches
  1108.                                             are supported,
  1109.                                             %d and %s.
  1110.                                             
  1111.      Simple     VOID BSC_API BSCSprintf (   See BSCPrintf
  1112.      sprintf        LPCH lpchOut,           above.
  1113.      replacement    LSZ lszFormat,
  1114.                     ...)
  1115.                
  1116.  
  1117.                                             
  1118.      Pattern-   BOOL BSC_API FWildMatch (   Returns TRUE
  1119.      matching       LSZ lszPat,             if the pattern
  1120.      function       LSZ lszText)            string lszPat
  1121.                                             matches the
  1122.                                             string
  1123.                                             lszText. The
  1124.                                             standard
  1125.                                             wildcards (*
  1126.                                             and ?) may be
  1127.                                             used in the
  1128.                                             pattern
  1129.                                             string.
  1130.                                             Matching
  1131.                                             occurs just as
  1132.                                             MS-DOS matches
  1133.                                             filenames.
  1134.                                             
  1135.      Compares   INT BSC_API CaseCmp (       Performs a
  1136.      strings        LSZ lszl,               case-
  1137.                     LSZ lsz2)               (in)sensitive
  1138.                                             comparison,
  1139.                                             depending on
  1140.                                             the current
  1141.                                             case
  1142.                                             sensitivity,
  1143.                                             which can be
  1144.                                             set by
  1145.                                             SetCaseBSC
  1146.                                             (see Table 9).
  1147.                                             The comparison
  1148.                                             occurs in the
  1149.                                             order of
  1150.                                             symbols listed
  1151.                                             in the symbol
  1152.                                             table.
  1153.                                             
  1154.      Compares   int BSC_API CaseCmpPrefix ( Nearly
  1155.      prefixes       LSZ lszprefix,          identical to
  1156.      of two         LSZ lszdecor)           CaseCmp except
  1157.      strings                                that only the
  1158.                                             prefixes of
  1159.                                             two strings
  1160.                                             are compared.
  1161.  
  1162.      Returns    LSZ BSC_API LszBaseName (   Given a path
  1163.      the base       LSZ lsz)                name lsz, the
  1164.      name of                                base name is
  1165.      a path                                 extracted and
  1166.                                             returned. If
  1167.                                             an empty
  1168.                                             string is
  1169.                                             passed to the
  1170.                                             function, then
  1171.                                             the empty
  1172.                                             string is
  1173.                                             returned.
  1174.                                             
  1175.      Obtains    LSZ BSC_API FormatDname (   Returns the
  1176.      undecora       LSZ lszname)            undecorated
  1177.      ted                                    name for the
  1178.      names                                  function name
  1179.                                             indicated by
  1180.                                             lszname.
  1181.                                             
  1182.      Returns    LSZ BSC_API LszBaseOfDname  Returns the
  1183.      the base       (LSZ lszname)           full name if
  1184.      name of                                lszname is
  1185.      a                                      undecorated,
  1186.      decorate                               the member
  1187.      d name.                                name if
  1188.                                             lszname is a
  1189.                                             member
  1190.                                             variable or
  1191.                                             member
  1192.                                             function, the
  1193.                                             function or
  1194.                                             variable name
  1195.                                             if lszname is
  1196.                                             just a
  1197.                                             decorated
  1198.                                             function or
  1199.                                             data item
  1200.                                             (global), or
  1201.                                             the class name
  1202.                                             if lszname is
  1203.                                             a constructor
  1204.                                             or destructor.
  1205.                                             All other
  1206.                                             inputs return
  1207.                                             NULL.
  1208.                                             
  1209.      Returns    LSZ BSC_API LszClassOfDname Returns the
  1210.      the            (LSZ lszname)           class name
  1211.      class                                  from a
  1212.      name                                   decorated name
  1213.      from a                                 or NULL if
  1214.      decorate                               lszname
  1215.      d name.                                contains no
  1216.                                             class name.
  1217.                                             If lszname is
  1218.                                             either not
  1219.                                             decorated or
  1220.                                             if the class
  1221.                                             name part of a
  1222.                                             decorated
  1223.                                             lszname is
  1224.                                             empty (as in a
  1225.                                             global
  1226.                                             operator),
  1227.                                             then the
  1228.                                             pointer return
  1229.                                             is NULL.
  1230.  
  1231. ______________________________________________________________________
  1232.  
  1233. 2.8  Miscellaneous Functions
  1234.  
  1235.      Table 9 describes other useful browser functions:
  1236.      
  1237.      Table 9:  Miscellaneous Functions
  1238.  
  1239.      ------------------------------------------------------------
  1240.      Purpose      Prototype                 Result
  1241.      ------------------------------------------------------------
  1242.      Assists      WORD BSC_API BSCMaxSymLen Returns the
  1243.      formatting   (VOID)                    length of the
  1244.      of output                              largest symbol
  1245.      from                                   in the browser
  1246.      database                               database.
  1247.      queries
  1248.                                           
  1249.      Determines   BOOL BSC_API FCaseBSC     Returns TRUE if
  1250.      case         (VOID)                    the database is
  1251.      sensitivity                            built with case-
  1252.                                             sensitive
  1253.                                             language;
  1254.                                             returns FALSE
  1255.                                             otherwise.
  1256.                                           
  1257.      Sets the     VOID BSC_API SetCaseBSC   Overrides the
  1258.      case         (BOOL fCase-Sensitive)    case sensitivity
  1259.      sensitivity                            of the database.
  1260.                                             Look-ups in the
  1261.                                             symbol table
  1262.                                             become case
  1263.                                             (in)sensitive as
  1264.                                             specified by
  1265.                                             fCaseSensitive.
  1266.                                           
  1267.      Dumps        VOID BSC_API StatsBSC()   Outputs
  1268.      database                               statistics to
  1269.      statistics                             the standard
  1270.                                             output using
  1271.                                             BSCOutput.
  1272.      
  1273.      As an example of the output from StatsBSC, consider the
  1274.      simple "Hello world!" script:
  1275.      
  1276.           #include <stdio.h>
  1277.           main()
  1278.           {
  1279.                printf("Hello world!");
  1280.           }
  1281.      
  1282.      For this script, StatsBSC produces the following:
  1283.      
  1284.      Totals
  1285.      MOD       : 3
  1286.      MODSYM    : 13
  1287.      SYM       : 13
  1288.      INST      : 13
  1289.      REF       : 55
  1290.      DEF       : 13
  1291.      USE       : 6
  1292.      UBY       : 6
  1293.      
  1294.      Detail
  1295.      <Unknown> Modsyms:2
  1296.      C:\WINDEV\INCLUDE\stdio.h Modsyms:10
  1297.      hello.c Modsyms:1
  1298.      _base         (mem_var:public) DEF 1 REF 0 USE 0 UBY 1
  1299.      _cnt          (mem_var:public) DEF 1 REF 0 USE 0 UBY 1
  1300.      _file         (mem_var:public) DEF 1 REF 0 USE 0 UBY 1
  1301.      _flag         (mem_var:public) DEF 1 REF 0 USE 0 UBY 1
  1302.      _iobuf        (struct_name) DEF 1 REF 1 USE 5 UBY 0
  1303.      _MSC_VER      (constant) DEF 1 REF 1 USE 0 UBY 0
  1304.      _ptr          (mem_var:public) DEF 1 REF 0 USE 0 UBY 1
  1305.      FILE          (typedef) DEF 1 REF 40 USE 0 UBY 0
  1306.      fpos_t        (typedef) DEF 1 REF 2 USE 0 UBY 0
  1307.      main          (function:public) DEF 1 REF 0 USE 1 UBY 0
  1308.      printf        (function:decl_only:public) DEF 1 REF 2 USE 0 UBY 1
  1309.      size_t        (typedef) DEF 1 REF 5 USE 0 UBY 0
  1310.      va_list       (typedef) DEF 1 REF 4 USE 0 UBY 0
  1311.  
  1312. ______________________________________________________________________
  1313.  
  1314. 3  Browser Objects
  1315.  
  1316.      The following sections describe browser objects (BOBs).
  1317.  
  1318. ______________________________________________________________________
  1319.  
  1320. 3.1 Creating and Manipulating BOB Variables
  1321.  
  1322.      The browser library provides several high-level
  1323.      functions that help the client query the information
  1324.      stored in the database. Examples of such queries
  1325.      include:
  1326.      
  1327.      -  Information about the names of all modules in the database
  1328.      -  Functions an instance might call
  1329.      -  Occurrences of a symbol definition
  1330.      -  Friend access relationships
  1331.      
  1332.      All the queries process one item called a browser
  1333.      object (BOB). A browser object is actually one of the
  1334.      index values that are encoded along with the type of
  1335.      index into a  32-bit quantity. Thus, once it is known,
  1336.      the type or "class" of the browser object can be
  1337.      extracted, as can its appropriate index value (see
  1338.      below).
  1339.      
  1340.      The ClsOfBob() macro returns one of the following CLS
  1341.      (class) types for the given browser object:
  1342.      
  1343.      clsMod         clsInst        clsSym         clsRef
  1344.      clsDef         clsUse         clsUby         clsBase
  1345.      clsDerv        clsFrin        clsFrout
  1346.      
  1347.      A browser object can be created from either a name of a
  1348.      symbol known to the database or from an index which is
  1349.      valid with respect to the database.
  1350.      
  1351.      The following call creates a browser object from the
  1352.      name of the object:
  1353.      
  1354.           BOB BSC_API BobFrName (LSZ lsz)
  1355.      
  1356.      If no browser object can be created from the given
  1357.      name, the value bobNil is returned. If the name is
  1358.      found, then the browser object returned will be either
  1359.      of class clsMod (if the name was a module name) or of
  1360.      class clsInst (if the name was a symbol name). If more
  1361.      than one instance is associated with the given name,
  1362.      the browser object's value will be the first (smallest)
  1363.      such instance.
  1364.      
  1365.      The following macros can create a browser object from
  1366.      one of the index values. Listed beside each macro is
  1367.      the macro that performs the reverse operation.
  1368.      
  1369.           BobFrMod ( IMOD x )      ImodFrBob ( BOB b )
  1370.           BobFrSym ( ISYM x )      IsymFrBob ( BOB b )
  1371.           BobFrInst ( IINST x )    IinstFrBob ( BOB b )
  1372.           BobFrRef ( IREF x )      IrefFrBob ( BOB b )
  1373.           BobFrDef ( IDEF x )      IdefFrBob ( BOB b )
  1374.           BobFrUse ( IUSE x )      IuseFrBob ( BOB b )
  1375.           BobFrUby ( IUBY x )      IubyFrBob ( BOB b )
  1376.           BobFrBase ( IBASE x )    IbaseFrBob ( BOB b )
  1377.           BobFrDerv ( IDERV x )    IdervFrBob ( BOB b )
  1378.           BobFrFrin ( IFRIN x )    IfrinFrBob ( BOB b )
  1379.           BobFrFrout ( IFROUT x )  IfroutFrBob ( BOB b )
  1380.      
  1381.      All of the macros on the left use the function
  1382.      BobFrClsIdx, which, given one of the indexes shown
  1383.      above, returns the appropriate BOB.
  1384.      
  1385.      NOTE:  The macros that convert an index into a browser
  1386.      object create a BOB whose class type corresponds to the
  1387.      type of index given. But the macros that convert a
  1388.      browser object back to an index do not check to make
  1389.      sure that the browser object has the correct class type
  1390.      value to do the conversion. It is up to the user of
  1391.      these macros to do whatever checking may be required
  1392.      before using them.
  1393.      
  1394.      To retrieve the symbol name of a browser object, use
  1395.      the function
  1396.      
  1397.           LSZ BSC_API LszNameFrBob  ( BOB bob )
  1398.      
  1399.      which returns either a symbol name or a module name,
  1400.      depending on the class type of the browser object.
  1401.      
  1402.      The browser library also has a function that retrieves
  1403.      a range of symbol indexes given only a prefix. To
  1404.      obtain this range,  use the function
  1405.      
  1406.           BOOL BSC_API FindPrefixRange ( LSZ lszprefix,
  1407.                                       ISYM far *pfirstisym,
  1408.                                       ISYM far *plastisym )
  1409.      
  1410.      which returns TRUE if the search was successful, or
  1411.      FALSE otherwise. Matching for this function always is
  1412.      case insensitive.
  1413.  
  1414. ______________________________________________________________________
  1415.  
  1416. 3.2 Performing Database Queries
  1417.  
  1418.      You can initiate several predefined queries once a
  1419.      browser object has been created. These are passed to
  1420.      the function InitBSCQuery along with the browser object
  1421.      itself.
  1422.      
  1423.           BOOL BSC_API InitBSCQuery (QY qy, BOB bob)
  1424.      
  1425.      The function returns TRUE if the query has been
  1426.      initiated successfully, FALSE otherwise. Not all
  1427.      queries can be performed on all browser objects (for
  1428.      example, trying to perform the query "What does this
  1429.      browser object call?" when the browser object type is
  1430.      actually that of a module index). The possible queries
  1431.      and their permitted browser object types are outlined
  1432.      in Table 10.
  1433.      
  1434.      Table 10:  Database Queries and BOB Types
  1435.  
  1436.      ------------------------------------------------------------
  1437.      Query            Input     Return      Query initiated for
  1438.                       BOB Type  BOB Type
  1439.      ------------------------------------------------------------
  1440.      qyFiles          (ignored) module      Modules that are
  1441.                                             defined in the
  1442.                                             database.
  1443.  
  1444.      qySymbols        (ignored) instance    Instances of symbols
  1445.                                             that occur in the
  1446.                                             database.
  1447.  
  1448.      qyContains       module    instance    Symbols that are
  1449.                                             defined in that
  1450.                                             module.
  1451.  
  1452.      qyCalls          instance  instance    Instances that a
  1453.                                             function (instance)
  1454.                                             calls. If the
  1455.                                             instance in that BOB
  1456.                                             is not of the type
  1457.                                             function, then the
  1458.                                             list of instances
  1459.                                             returned will be of
  1460.                                             zero length.
  1461.  
  1462.      qyUses           instance  instance    Instances that an
  1463.                                             instance uses.
  1464.  
  1465.      qyCalledBy       instance  instance    Instances that call
  1466.                                             the input instance.
  1467.                                             These instances will
  1468.                                             be of the type
  1469.                                             function.
  1470.  
  1471.      qyUsedBy         instance  instance    Instances that use
  1472.                                             the input instance.
  1473.  
  1474.      qyUsedIn         instance  module      Module(s) that
  1475.                                             use/reference the
  1476.                                             instance.
  1477.  
  1478.      qyDefinedIn      instance  module      Module(s) that
  1479.                                             define the instance.
  1480.  
  1481.      qyRefs           instance, reference   References to all
  1482.                       symbol                instances of the
  1483.                                             symbol, or, if the
  1484.                                             BOB is an instance,
  1485.                                             then the references
  1486.                                             to that particular
  1487.                                             instance itself.
  1488.  
  1489.      qyDefs           instance, definition  Definitions of all
  1490.                       symbol                instances of a
  1491.                                             symbol, or, if the
  1492.                                             BOB is an instance,
  1493.                                             then the definitions
  1494.                                             to that particular
  1495.                                             instance itself.
  1496.  
  1497.      qyBaseOf         instance, instance,   Instances that have
  1498.                       class     class       the given symbol as
  1499.                                             their base class.
  1500.  
  1501.      qyDervOf         instance, instance,   Instances that are
  1502.                       class     class       derived from the
  1503.                                             symbol.
  1504.  
  1505.      qyMembers        instance, instance,   All members of the
  1506.                       class     mem_var,    given class
  1507.                                 mem_funct   including bases.
  1508.  
  1509.      qyMemberOf       instance, instance,   All classes of which
  1510.                       mem_var,  class       the given symbol is
  1511.                       mem_func              a member.
  1512.  
  1513.      qyImpMembers     instance, instance,   All members
  1514.                       classb    mem_var,    implemented by the
  1515.                                 mem_funct   given class.
  1516.  
  1517.      qyFriendIn       instance, instance,   All classes that
  1518.                       class     class       give friend access
  1519.                                             to the given class.
  1520.  
  1521.      qyFriendOut      instance, instance,   All classes that
  1522.                       class     class       obtain friend access
  1523.                                             from the given
  1524.                                             class.
  1525.  
  1526.      qyBaseSorted,    --        --          Reserved for
  1527.      qyBaseIncSorted,                       internal use.
  1528.      qyDervSorted,
  1529.      qyDervIncSorted
  1530.      
  1531.      The result of a query is a collection of browser
  1532.      objects. To obtain the next browser object in the query
  1533.      information, use the following function:
  1534.      
  1535.           BOB BSC_API  BobNext (VOID)
  1536.      
  1537.      Any one of the browser objects returned may be passed
  1538.      back to initiate another query. The name of the symbol
  1539.      for that browser object may be found using the function
  1540.      LszNameFrBob, which can also be used to obtain the next
  1541.      browser object in the collection. If there are no more
  1542.      browser objects left in the collection, the value
  1543.      bobNil is returned.
  1544.  
  1545. ______________________________________________________________________
  1546.  
  1547. 3.3  Generating Name Overloads
  1548.      
  1549.      The GenerateOverloads and GenerateOverloadsEx functions
  1550.      find all possible browser objects that match a given
  1551.      name, such as all  members of a given class, all class
  1552.      members having the given name, or all top-level items
  1553.      having the given name. These functions then pass each
  1554.      BOB to a given function (pointed to by PFN_BOB in
  1555.      GenerateOverloads and PFN_BOB_EX in
  1556.      GenerateOverloadsEx).
  1557.      
  1558.           WORD BSC_API GenerateOverloads (LSZ, MBF, PFN_BOB)
  1559.           WORD BSC_API GenerateOverloadsEx (LSZ, MBF, PFN_BOB_EX)
  1560.      
  1561.      The following are the forms LSZ can have and their
  1562.      subsequent action:
  1563.      
  1564.           class::        Generates a list of all members of
  1565.                          the class.
  1566.           class::mem     Generates a list of all members
  1567.                          named mem. GenerateOverloadsEx also
  1568.                          accepts wildcards, as in mem*, and
  1569.                          nested classes (such as
  1570.                          classA::classB::mem).
  1571.           mem            Generates a list of all members mem
  1572.                          in any class or top-level items.
  1573.      
  1574.      The member mem can be a regular member or it can be
  1575.      operator+, operator new, and so forth.
  1576.      
  1577.      GenerateOverloadsEx stops executing (returns) whenever
  1578.      the function pointed to by PFN_BOB_EX returns FALSE,
  1579.      whereas GenerateOverloads continues executing.  This
  1580.      feature of GenerateOverloadsEx can be used, for
  1581.      example, to show the first n overloads in a list box
  1582.      without waiting for all the overloads to be computed.
  1583.  
  1584. ______________________________________________________________________
  1585.  
  1586. 4  Browser Library Index
  1587.  
  1588.      This index lists all of the browser library functions,
  1589.      variables, and constants discussed in this reference
  1590.      document and also defined or declared in the header
  1591.      files BSC.H and BSCSUP.H, both of which provide the
  1592.      browser library interface. Each entry is followed by
  1593.      the section and/or table in which that particular item
  1594.      is discussed.
  1595.  
  1596. B
  1597.      BadBSCVer() -- 2.1, T2
  1598.      BaseInfo() -- 2.3.7
  1599.      BaseRangeOfInst() -- 2.3.7
  1600.      BobFrBase() -- 3.1
  1601.      BobFrClsIdx() -- 3.1
  1602.      BobFrDef() -- 3.1
  1603.      BobFrDerv() -- 3.1
  1604.      BobFrFrin() -- 3.1
  1605.      BobFrFrout() -- 3.1
  1606.      BobFrInst() -- 3.1
  1607.      BobFrMod() -- 3.1
  1608.      BobFrName() -- 3.1
  1609.      BobFrRef() -- 3.1
  1610.      BobFrSym() -- 3.1
  1611.      BobFrUby() -- 3.1
  1612.      BobFrUse() -- 3.1
  1613.      BobNext() -- 3.2
  1614.      bobNil -- 3.1
  1615.      BSCClose() -- 2.1, T2
  1616.      BSCFormat() -- 2.7, T8
  1617.      BSCMaxSymLen() -- 2.8, T9
  1618.      BSCOpen() -- 2.1, T2, 2.3.4, T7
  1619.      BSCOutput() -- 2.1, T2, 2.3.4, T7
  1620.      BSCPrintf() -- 2.7, T8
  1621.      BSCRead() -- 2.1, T2
  1622.      BSCSeek() -- 2.1, T2
  1623.      BSCSprintf() -- 2.7, T8
  1624.  
  1625. C
  1626.      CallTreeInst () -- 2.4
  1627.      CaseCmp() -- 2.7, T8
  1628.      CaseCmpPrefix() -- 2.7, T8
  1629.      ClassTreeInst () -- 2.4
  1630.      CloseBSC() -- 2.2, T3
  1631.      clsBase -- 3.1
  1632.      clsDef -- 3.1
  1633.      clsDerv -- 3.1
  1634.      clsFrin -- 3.1
  1635.      clsFrout -- 3.1
  1636.      clsInst -- 3.1
  1637.      clsMod -- 3.1
  1638.      ClsOfBob() -- 3.1
  1639.      clsRef -- 3.1
  1640.      clsSym -- 3.1
  1641.      clsUby -- 3.1
  1642.      clsUse -- 3.1
  1643.  
  1644. D
  1645.      DefInfo() -- 2.3.5
  1646.      DefRangeOfInst() -- 2.3.5
  1647.      DervInfo() -- 2.3.7
  1648.      DervRangeOfInst() -- 2.3.5
  1649.      DumpInst() -- 2.3.4, T7
  1650.  
  1651. F
  1652.      FCallTreeLsz() -- 2.4
  1653.      FCaseBSC() -- 2.8, T9
  1654.      FClassTreeLsz() -- 2.4
  1655.      FindPrefixRange () -- 3.1
  1656.      FInstFilter () -- 2.3.4, T7
  1657.      FOpenBSC () -- 2.2, T3
  1658.      FormatDname () -- 2.7 T8
  1659.      FOutlineModuleLsz ()-- 2.6
  1660.      FreeLpv() -- 2.1, T2
  1661.      FRevClassTreeLsz ()-- 2.4
  1662.      FRevTreeLsz() -- 2.4
  1663.      FrinInfo() -- 2.3.8
  1664.      FrinRangeOfInst() -- 2.3.8
  1665.      FroutInfo() -- 2.3.8
  1666.      FroutRangeOfInst() -- 2.3.8
  1667.      FWildMatch() -- 2.7, T8
  1668.  
  1669. G
  1670.      GenerateOverloads() -- 3.3
  1671.      GenerateOverloadsEx() -- 3.3
  1672.  
  1673. I
  1674.      IbaseFrBob() -- 3.1
  1675.      IdefFrBob() -- 3.1
  1676.      IdervFrBob() -- 3.1
  1677.      IfrinFrBob() -- 3.1
  1678.      IfroutFrBob() -- 3.1
  1679.      IinstContextFrIref() -- 2.3.4, T6
  1680.      IinstFrBob() -- 3.1
  1681.      IinstFrIref() -- 2.3.4, T6
  1682.      IinstFrIdef() -- 2.3.4, T6
  1683.      IinstMac() -- 2.3.4, T6
  1684.      iinstNil -- 2.3.4, T6
  1685.      IinstOfIms() -- 2.3.2, T5
  1686.      IMODE_PRIVATE -- 2.3.4
  1687.      IMODE_PROTECT -- 2.3.4
  1688.      IMODE_PUBLIC -- 2.3.4
  1689.      IMODE_VIRTUAL -- 2.3.4
  1690.      ImodFrBob() -- 3.1
  1691.      ImodFrLsz() -- 2.3.1, T4
  1692.      ImodMac() -- 2.3.1, T4, 2.3.4, T6
  1693.      imodNil -- 2.3.1, T4
  1694.      InitBSCQuery () -- 3.2
  1695.      INST_ATR_COMMON -- 2.3.4
  1696.      INST_ATR_DECL_ONLY -- 2.3.4
  1697.      INST_ATR_LOCAL -- 2.3.4
  1698.      INST_ATR_MODULE -- 2.3.4
  1699.      INST_ATR_NAMED -- 2.3.4
  1700.      INST_ATR_NEAR -- 2.3.4
  1701.      INST_ATR_PRIVATE -- 2.3.4
  1702.      INST_ATR_PROTECT -- 2.3.4
  1703.      INST_ATR_PUBLIC -- 2.3.4
  1704.      INST_ATR_SHARED -- 2.3.4
  1705.      INST_ATR_STATIC -- 2.3.4
  1706.      INST_ATR_VIRTUAL -- 2.3.4
  1707.      INST_TYP_CLASSNAM -- 2.3.4
  1708.      INST_TYP_CONSTANT -- 2.3.4
  1709.      INST_TYP_ENUMMEM -- 2.3.4
  1710.      INST_TYP_ENUMNAM -- 2.3.4
  1711.      INST_TYP_FUNCTION -- 2.3.4
  1712.      INST_TYP_GROUP -- 2.3.4
  1713.      INST_TYP_LABEL -- 2.3.4
  1714.      INST_TYP_MACRO -- 2.3.4
  1715.      INST_TYP_MEMFUNC -- 2.3.4
  1716.      INST_TYP_MEMVAR -- 2.3.4
  1717.      INST_TYP_PARAMETER-- 2.3.4
  1718.      INST_TYP_PROGRAM -- 2.3.4
  1719.      INST_TYP_SEGMENT -- 2.3.4
  1720.      INST_TYP_STRUCNAM -- 2.3.4
  1721.      INST_TYP_TYPEDEF -- 2.3.4
  1722.      INST_TYP_UNIONNAM -- 2.3.4
  1723.      INST_TYP_VARIABLE -- 2.3.4
  1724.      InstInfo() -- 2.3.4, T6
  1725.      InstRangeOfSym() -- 2.3.4, T6
  1726.      IrefFrBob() -- 3.1
  1727.      IsymFrBob() -- 3.1
  1728.      IsymFrLsz() -- 2.3.3
  1729.      IsymMac() -- 2.3.3, 2.3.4, T6
  1730.      isymNil -- 2.3.3
  1731.      IsymSupLsz() -- 2.3.3
  1732.      IubyFrBob() -- 3.1
  1733.      IuseFrBob() -- 3.1
  1734.  
  1735. L
  1736.      ListRefs () -- 2.5
  1737.      LpvAllocCb() -- 2.1, T2
  1738.      LszBaseName() -- 2.7, T8
  1739.      LszBaseOfDname() -- 2.7, T8
  1740.      LszClassOfDname() -- 2.7, T8
  1741.      LszNameFrBob() -- 3.1
  1742.      LszNameFrMod () -- 2.3.1, T4
  1743.      LszNameFrSym () -- 2.3.3
  1744.      LszTypInst() -- 2.3.4, T7
  1745.  
  1746. M
  1747.      MBF -- 2.3.4
  1748.      mbfAll -- 2.3.4
  1749.      mbfClass -- 2.3.4
  1750.      mbfFuncs -- 2.3.4
  1751.      mbfMacros -- 2.3.4
  1752.      mbfNil -- 2.3.4
  1753.      mbfTypes -- 2.3.4
  1754.      mbfVars -- 2.3.4
  1755.      MsRangeOfMod() -- 2.3.2, T5, 2.3.4, T6
  1756.  
  1757. O
  1758.      OutlineMod() -- 2.6
  1759.  
  1760. P
  1761.      PFN_BOB -- 3.3
  1762.      PFN_BOB_EX -- 3.3
  1763.  
  1764. Q
  1765.      qyBaseIncSorted -- 3.2, T10
  1766.      qyBaseOf -- 3.2, T10
  1767.      qyBaseSorted -- 3.2, T10
  1768.      qyCalledBy -- 3.2, T10
  1769.      qyCalls -- 3.2, T10
  1770.      qyContains -- 3.2, T10
  1771.      qyDefinedIn -- 3.2, T10
  1772.      qyDefs -- 3.2, T10
  1773.      qyDervIncSorted -- 3.2, T10
  1774.      qyDervOf -- 3.2, T10
  1775.      qyDervSorted -- 3.2, T10
  1776.      qyFiles -- 3.2,T10
  1777.      qyFriendIn -- 3.2, T10
  1778.      qyFriendOut -- 3.2, T10
  1779.      qyImpMembers -- 3.2, T10
  1780.      qyMemberOf -- 3.2, T10
  1781.      qyMembers -- 3.2, T10
  1782.      qyRefs -- 3.2, T10
  1783.      qySymbols -- 3.2, T10
  1784.      qyUsedBy -- 3.2, T10
  1785.      qyUsedIn -- 3.2, T10
  1786.      qyUses -- 3.2,T10
  1787.  
  1788. R
  1789.      ReadError() -- 2.1, T2
  1790.      RefInfo() -- 2.3.5
  1791.      RefRangeOfInst() -- 2.3.5
  1792.      RevClassTreeInst ()-- 2.4
  1793.      RevTreeInst () -- 2.4
  1794.  
  1795. S
  1796.      SeekError() -- 2.1, T2
  1797.      SetCaseBSC() -- 2.7, T8, 2.8, T9
  1798.      StatsBSC() -- 2.8, T9
  1799.  
  1800. U
  1801.      UbyInfo() -- 2.3.6
  1802.      UbyRangeOfInst() -- 2.3.6
  1803.      UseInfo() -- 2.3.6
  1804.      UseRangeOfInst() -- 2.3.6
  1805.