home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / wf_expl / intrface.doc < prev    next >
Text File  |  1992-05-02  |  95KB  |  2,783 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                                                                     WORKFRAME/2
  14.                                                          PROGRAMMING INTERFACES
  15.  
  16.                                                                         DRAFT 4
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.                                                                     May 2, 1992
  25.  
  26.  
  27.  
  28.  
  29.                                                                             LTC
  30.                                                              Toronto Laboratory
  31.                                                        VNET  - KEHM at TOROLAB6
  32.                                                  email - workframe@vnet.ibm.com
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.   CONTENTS
  74.   ________
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                                                                    Contents  ii
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   FIGURES
  141.   _______
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.                                                                    Figures  iii
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.   +--- CHANGES TO THIS DOCUMENT SINCE DRAFT 2 --------------------------------+
  208.   |                                                                           |
  209.   | o   The FINDINCLUDE interface in support of Make File creation has        |
  210.   |     changed the meaning of the first element of each array passed in the  |
  211.   |     first two parameters.                                                 |
  212.   |                                                                           |
  213.   | o   The PARSEERROR interface in the compiler DLL has changed to allow two |
  214.   |     additional parameters. One parameters is a pointer to the compiler    |
  215.   |     options area used in that invocation and the second parameter is a    |
  216.   |     flag field indicating the state of that field.                        |
  217.   |                                                                           |
  218.   | o   The guidelines for Dialog development have been changed to reflect    |
  219.   |     the recommendations of the Usability task force.                      |
  220.   |                                                                           |
  221.   | o   The section describing the Language Profile has changed to reflect    |
  222.   |     the current interface and its requirements.                           |
  223.   |                                                                           |
  224.   | o   The first driver of the WorkFrame that supports all the interfaces    |
  225.   |     will be Driver 17.                                                    |
  226.   |                                                                           |
  227.   | o   Source for the default DLL that provides support for each of these    |
  228.   |     interfaces and for a sample monitor that illustrates the IDE message  |
  229.   |     handling required of an enabled editor are available through the      |
  230.   |     author of this document.                                              |
  231.   |                                                                           |
  232.   +---------------------------------------------------------------------------+
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.                                                                               1
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.   +--- CHANGES TO THIS DOCUMENT SINCE DRAFT 3 --------------------------------+
  274.   |                                                                           |
  275.   | o   Compiler DLL may support two additional interfaces in support of help |
  276.   |     for error messages. One interface provides the name of the help file, |
  277.   |     the second interface provides the resource id of the entry in the     |
  278.   |     help file corresponding to a particular error message line. If these  |
  279.   |     interfaces are not present in the DLL, the WorkFrame will assume that |
  280.   |     help for messages is not provided.                                    |
  281.   |                                                                           |
  282.   | o   The DDE messages sent to the editor have been changed to provide the  |
  283.   |     additional informationprovided in support of error message help.      |
  284.   |                                                                           |
  285.   |     The Initialize message contains an additional field at the end con-   |
  286.   |     taining the library name. This field may be the null string if no     |
  287.   |     library is provided.                                                  |
  288.   |                                                                           |
  289.   |     The goto message contains an additional field that is the resource id |
  290.   |     for the message. If the resource id is zero, it is not provided.      |
  291.   |                                                                           |
  292.   |     It is assumed that the editor will reserve first 20000 resource ids   |
  293.   |     and that the compiler help file will use resource ids of 20001 or     |
  294.   |     greater.                                                              |
  295.   |                                                                           |
  296.   | o   The first driver of the WorkFrame that supports all the interfaces    |
  297.   |     will be Driver 33.                                                    |
  298.   |                                                                           |
  299.   | o   All changes since Draft 3 will be denoted by a bar, |.                |
  300.   |                                                                           |
  301.   +---------------------------------------------------------------------------+
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.                                                                               2
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.   WORKFRAME PROGRAMMING INTERFACES FOR COMPILER WRITERS
  340.   _____________________________________________________
  341.  
  342.  
  343.  
  344.  
  345.  
  346.   The WorkFrame supports four application programming interfaces in support of
  347.   "Options/Actions" processing, one interface in support of the Editor, and two
  348.   interfaces in support of the Make file creation process.  Specifically,
  349.  
  350.   1.  Interface to acquire Compiler Options and Invocation String,
  351.  
  352.   2.  Interface to acquire Link Options and Invocation String,
  353.  
  354.   3.  Interface to acquire Debug Options and Invocation String,
  355.  
  356.   4.  Interface to acquire Make Options and Invocation String,
  357.  
  358. | 5.  Interfaces to support compiler error messages,
  359.  
  360. |     o   Interface to parse error messages,
  361.  
  362. |     o   Interface to return the name of the help file,
  363.  
  364. |     o   Interface to return the help resource id corresponding to a given
  365. |         message line.
  366.  
  367.   6.  Interfaces in support of Make file creation
  368.  
  369.       o   Interface to build source file include dependencies,
  370.  
  371.       o   Interface to free acquired memory
  372.  
  373.   The compiler writer may provide one DLL that contains all these interfaces or
  374.   may provide a separate DLL for each of the four Options acquisition inter-
  375. | faces.  The three compiler error message interfaces and the two make file
  376.   creation supporting interfaces MUST be contained in the same DLL as the Com-
  377.   piler Options interface.  The name of the DLL containing each entry point is
  378.   described in the Language Profile (see -- Heading 'LP' unknown --).
  379.  
  380.   The 4 Options interfaces are called in response to the following actions:
  381.  
  382.   o   The user has selected the corresponding menu item from the "Options"
  383.       pulldown and wishes to create/change the set of options associated with
  384.       the current project. This interface can also be called during project
  385.       create/change processing.
  386.  
  387.   o   The user has selected the corresponding menu item from the "Actions"
  388.       pulldown. The WorkFrame will invoke the DLL interface to build an invoca-
  389.       tion string, passing it the options structure previously saved with the
  390.       project.
  391.  
  392.   o   The user is creating or changing a project and selects the option to
  393.       create/change a specific set of options.
  394.  
  395.  
  396.                        WorkFrame Programming Interfaces for Compiler Writers  3
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.   The Compiler Options and Link Options interfaces can also be invoked in
  407.   support of the Make file creation process.
  408.  
  409.   The default DLL shipped with the WorkFrame provides default entry points for
  410.   all these interfaces. The WorkFrame also supplies a DLL that will support the
  411.   OS/2 supplied Linker. For most compiler writers, this DLL and the default DLL
  412.   entry points for Make and Debug are sufficient. However, a unique DLL should
  413.   be provided containing the Compile Options, Editor Support and Make File Cre-
  414.   ation support interfaces.
  415.  
  416.   Each of these interfaces is described in detail in the subsequent sections of
  417.   this document.
  418.  
  419.  
  420.  
  421.   INTERFACE TO ACQUIRE COMPILER OPTIONS AND INVOCATION STRING
  422.   ___________________________________________________________
  423.  
  424.   The entry point "GETCOMPILEOPTS" is invoked under two different circumstances
  425.   in response to a user action bar request. When the user selects
  426.   "Options/Compile" from the action bar, or "Compiler Options" from project
  427.   creation/change, or "Compiler Options" from Make File creation dialog, the
  428.   entry point is invoked to acquire a set of compile options to associate with
  429.   the current project. When the user selects "Actions/Compile" or
  430.   "Actions/Build" from the action bar, the interface is invoked to build a
  431.   string that will be passed to the compiler when it is invoked.
  432.  
  433.   The interface must be provided in a DLL. The interface can be either 32-bit
  434.   or 16-bit (with the caveat that all interfaces in the DLL must be of the same
  435.   type, either all 32-bit or all 16-bit).  The DLL name is provided in the lan-
  436.   guage profile supplied by the language developer.  If the interface is 16-bit
  437.   it must be coded to use the FAR PASCAL linkage convention. If it is 32-bit it
  438.   must abide by the OS/2 V2.0 System linkage conventions.  Pictorially,
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.                        WorkFrame Programming Interfaces for Compiler Writers  4
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.   -----------------------------------------------------------------------------
  474.  
  475.   +-------------------+
  476.   |   |Options|       |
  477.   |---+-------+-------|
  478.   |   |Compile|       |
  479.   |   |       |       |
  480.   |   +-------+       |
  481.   |                   |
  482.   |                   |      +--------+
  483.   |                   |      |Language|
  484.   +-------------------+      |Profile |
  485.       |                      +--------+
  486.       |  (1)                     |
  487.       |                          |
  488.       V                  (2)     V                +----------------+
  489.   +---------+               +----------+   (3)    |Compiler Options|
  490.   | Project |------------>  | Compile  |--------> |     DLL        |
  491.   |   File  |               | Options  |          |                |
  492.   +---------+<--------------| Save Area|<---------|                |
  493.                 (4)         +----------+          +----------------+
  494.  
  495.  
  496.  
  497.   -----------------------------------------------------------------------------
  498.   Figure 1. Compile Options Acquisition.
  499.  
  500.             1.  Once "Options/Compile" is selected, the WorkFrame will read the
  501.                 compile options associated with the current project.
  502.  
  503.             2.  The Language profile is read to acquire the name of the DLL
  504.                 associated with the current language (the WorkFrame ensures
  505.                 that the compile options associated with the project are valid
  506.                 for the current language) and the amount of memory required to
  507.                 hold the compile options and invocation string.
  508.  
  509.             3.  The options are then passed to the entry point in the DLL.  The
  510.                 DLL is expected to display a dialog to obtain compiler options.
  511.                 If a set of options already existed, the dialog should be ini-
  512.                 tialized with existing settings. The DLL must return an updated
  513.                 compile options area and a compiler invocations string (the
  514.                 latter is not pictured in this diagram).
  515.  
  516.             4.  The DLL indicates to the shell whether the changed options
  517.                 should be saved with the project. If so, the project control
  518.                 file is updated.
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.                        WorkFrame Programming Interfaces for Compiler Writers  5
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.   -----------------------------------------------------------------------------
  540.  
  541.   +-------------------+
  542.   |   |Actions|       |
  543.   |---+-------+-------|
  544.   |   |Compile|       |
  545.   |   |       |       |
  546.   |   +-------+       |
  547.   |                   |
  548.   |                   |      +--------+
  549.   |                   |      |Language|
  550.   +-------------------+      |Profile |
  551.       |                      +--------+
  552.       |  (1)                     |
  553.       |                          |
  554.       V                  (2)     V                +----------------+
  555.   +---------+               +----------+   (3)    |Compiler Options|
  556.   | Project |------------>  | Compile  |--------> |     DLL        |
  557.   |   File  |               | Options  |          |                |
  558.   +---------+               | Save Area|          |                |
  559.                             +----------+          +----------------+
  560.                                                          |
  561.    +----------+              +----------+                |
  562.    |          |    (5)       | Compile  |     (4)        |
  563.    | Compiler |<-------------| Invoct'n |<---------------+
  564.    |          |              | String   |
  565.    +----------+              +----------+
  566.  
  567.  
  568.   -----------------------------------------------------------------------------
  569.   Figure 2. Compiler Invocation.
  570.  
  571.             1.  Once "Actions/Compile" is selected, the WorkFrame will read the
  572.                 compile options associated with the current project.
  573.  
  574.             2.  The Language profile is read to find out the name of the DLL
  575.                 associated with the current language (the WorkFrame ensures
  576.                 that the compile options associated with the project are valid
  577.                 for the current language) and the amount of memory required to
  578.                 hold the compile options and the invocation string.
  579.  
  580.             3.  Any existing options are passed to the DLL.
  581.  
  582.             4.  The DLL is invoked to build an output string (and not display
  583.                 the dialog).
  584.  
  585.             5.  If the string is built successfully the WorkFrame will use it
  586.                 to invoke the compiler, the compiler name was extracted from
  587.                 language profile.
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.                        WorkFrame Programming Interfaces for Compiler Writers  6
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.   INVOCATION SYNTAX
  606.  
  607.              LONG GETCOMPILEOPTS(HWND    hWorkFrame,
  608.                                  PVOID   pvCompilerOptions,
  609.                                  ULONG * pulCompOptionsLgth,
  610.                                  PSZ     pszReserved,
  611.                                  PSZ     pszInvocationString,
  612.                                  ULONG   ulInvocationAreaSize
  613.                                  HMODULE hModHandle,
  614.                                  PSZ     pszProject,
  615.                                  PSZ     pszFilename,
  616.                                  ULONG * pulAction)
  617.  
  618.   GETCOMPILEOPTS is invoked with FAR PASCAL linkage if the entry point is spec-
  619.   ified as 16-bit. All pointers must be FAR pointers.  If the interface is
  620.   specified as 32-bit then it will be invoked with OS/2 V2.0 System linkage.
  621.   All pointers are assumed to be FLAT.
  622.  
  623.   The parameters are as follows:
  624.  
  625.   HWORKFRAME          Handle of the WorkFrame primary window.
  626.  
  627.   PVCOMPILEROPTIONS   Pointer to an area containing the existing compiler
  628.                       options.  This area is of size pulCompOptionsLgth. This
  629.                       area contains existing options if the USEDEFAULTS bit in
  630.                       pulAction is NOT set.  This area should be updated with
  631.                       the new compiler options after interaction with the user.
  632.  
  633.   PULCOMPOPTIONSLGTH  This parameter is input/output. On input, it specifies
  634.                       the size of the area provided for storing the options.
  635.                       This size is specified in the Language Profile.  On
  636.                       output, the interface is expected to specify the actual
  637.                       size of the options structure.  This size is used when
  638.                       writing the options to the project file.
  639.  
  640.                       If the size is too small, the interface is expected to
  641.                       display a message box indicating what size is required.
  642.                       The user can take corrective action by increasing the
  643.                       area size in the Language Profile.
  644.  
  645.   PSZRESERVED         This parameter is provided for compatibility reasons. The
  646.                       interface should ignore it.
  647.  
  648.   PSZINVOCATIONSTRING This is the area provided to hold the compiler invocation
  649.                       string.  Its size is ulInvocationAreaSize. This string
  650.                       must be ASCIIZ, ie nul-delimited.
  651.  
  652.   ULINVOCATIONAREASIZE This is an input parameter only. It provides the size of
  653.                       the data area provided to hold the invocation string.
  654.                       This size is specified in the Language Profile.
  655.  
  656.                       If the size is too small, the interface is expected to
  657.                       display a message box indicating what size is required.
  658.  
  659.  
  660.  
  661.                        WorkFrame Programming Interfaces for Compiler Writers  7
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.                       The user can take corrective action by increasing the
  672.                       area size in the Language profile.
  673.  
  674.   HMODHANDLE          This is the handle of the Compiler Options DLL. This
  675.                       parameter should be used to access any resources bound to
  676.                       the DLL (ie string tables, dialogs).
  677.  
  678.   PSZPROJECT          This is the character description (max. 100) of the
  679.                       project for which the compiler options are required. The
  680.                       interface may display this description on its dialogs.
  681.  
  682.   PSZFILENAME         This parameter will be passed only in response to
  683.                       "Actions/Build" or "Actions/Compile". The interface is
  684.                       expected to insert the filename in the appropriate place
  685.                       in the compiler invocation string being built.
  686.  
  687.                       If this parameter is NULL. The invocation string should
  688.                       be built without a filename.
  689.  
  690.   PULACTION           Input/Output area for communicating desired actions with
  691.                       the WorkFrame. The options and the bit settings are as
  692.                       follows:
  693.  
  694.                       o   STOREOPTS   0x0001
  695.  
  696.                           This bit is set by the Compiler DLL if the user has
  697.                           requested that the options be saved with the project.
  698.                           The WorkFrame will test this bit when control is
  699.                           returned during "Options/Compile" processing.
  700.  
  701.                       o   NODLGS      0x0002
  702.  
  703.                           This bit is set if the WorkFrame wishes the interface
  704.                           to not display a dialog, but to simply return an
  705.                           invocation string. This bit is set during
  706.                           "Actions/Compile" and "Actions/Build" processing.
  707.  
  708.                       o   USEDEFAULTS 0x0004
  709.  
  710.                           This bit is set if the compile options have not pre-
  711.                           viously existed for this Project. The area being
  712.                           passed to the interface will be uninitialized. The
  713.                           interface should set up all options based on compiler
  714.                           defaults and return them in the compiler options and
  715.                           invocation string areas. If this bit is off then the
  716.                           compiler options are provided in the area. If bit 2
  717.                           is off (ie not NODLGS) then these options should be
  718.                           used to initialize the dialogs. If bit 2 is on then
  719.                           the options should be analyzed to produce an invoca-
  720.                           tion string.
  721.  
  722.   The returns codes are as follows:
  723.  
  724.       0 - SUCCESS
  725.  
  726.  
  727.                        WorkFrame Programming Interfaces for Compiler Writers  8
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.       1 - CANCEL was pressed
  738.  
  739.       2 - ERROR occurred (the DLL will have displayed an appropriate error
  740.       message).
  741.  
  742.  
  743.   GUIDELINES
  744.  
  745.   1.  The dialogs should all be CUA-conformant.
  746.  
  747.   2.  The interface should attempt to minimize the size of the compiler options
  748.       area, since this area will be written to a project file. (eg one bit for
  749.       each binary option).
  750.  
  751.   3.  The dialogs should be constructed such that a primary dialog (see -- Fig
  752.       'FIG3' unknown --) is created displaying pushbuttons for various catego-
  753.       ries of compiler options and include a check box to specify whether the
  754.       options should be saved with the project or not. Each compiler category
  755.       would have its own dialog which should be created modeless to allow for
  756.       more than one category to be displayed and manipulated concurrently.
  757.  
  758.   4.  The dialogs should contain an OK, DEFAULT, CANCEL, and HELP buttons,
  759.       where the DEFAULT button on the main panel sets the fields for all
  760.       options to their default and DEFAULT on the secondary dialogs sets only
  761.       the options related to the specific category.
  762.  
  763.       The Dialogs my optionally contain a RESET button. This button, would
  764.       reset all options to what they were before the Dialog was invoked. Its
  765.       behavior is the same as pressing CANCEL and re-entering the dialog.
  766.  
  767.   5.  Dismissing the main dialog should dismiss all secondary dialogs.
  768.  
  769.   6.  The interface should provide the user with the option of saving the
  770.       options with the project (see the checkbox in -- Fig 'FIG3' unknown --).
  771.       The state of this choice may be saved between invocations and used to
  772.       initialize the dialog.  If this option is not saved then the dialog
  773.       should initialize the checkbox such that the options are saved by
  774.       default.
  775.  
  776.   7.  Conflict resolution between the secondary dialogs should be conducted
  777.       when the user presses the Ok button on the primary option dialog.
  778.  
  779.   8.  If the Ok button is pressed on the primary dialog but the user has not
  780.       closed the secondary dialogs, an information message should be displayed
  781.       and the user should be forced to terminate each secondary dialog first.
  782.  
  783.   -----------------------------------------------------------------------------
  784.  
  785.  
  786.   -----------------------------------------------------------------------------
  787.   Figure 3. Compiler Options Main Dialog
  788.  
  789.  
  790.  
  791.  
  792.  
  793.                        WorkFrame Programming Interfaces for Compiler Writers  9
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.   INTERFACE TO ACQUIRE LINK OPTIONS AND INVOCATION STRING
  804.   _______________________________________________________
  805.  
  806.   The entrypoint "GETLINKOPTS" is invoked under two different circumstances in
  807.   response to a user action bar request. When the user selects "Options"/"Link"
  808.   from the action bar, or "Linker Options" from project creation/change, or
  809.   "Link Options" from Make File creation dialog, the entry point is invoked to
  810.   acquire a set of link options to associate with the current project. When the
  811.   user selects "Actions/Link" or "Actions/Build" from the action bar, the
  812.   interface is invoked to build a string that will be passed to the linker when
  813.   it is invoked.
  814.  
  815.   The interface must be provided in a DLL. The interface can be either 32-bit
  816.   or 16-bit (with the caveat that all interfaces in the DLL must be of the same
  817.   type, either all 32-bit or all 16-bit).  The DLL name is provided in the Lan-
  818.   guage Profile supplied by the language developer.  If the interface is 16-bit
  819.   it must be coded to use the FAR PASCAL linkage convention. If it is 32-bit it
  820.   must abide by the OS/2 V2.0 System linkage conventions.
  821.  
  822.  
  823.   INVOCATION SYNTAX
  824.  
  825.              LONG  GETLINKOPTS(HWND    hWorkFrame,
  826.                                PVOID   pvLinkerOptions,
  827.                                ULONG * pulLinkOptionsLgth,
  828.                                PSZ     pszExename,
  829.                                PSZ     pszInvocationString,
  830.                                ULONG   ulInvocationAreaSize
  831.                                HMODULE hModHandle,
  832.                                PSZ     pszProject,
  833.                                PSZ   * pszObjects,
  834.                                ULONG * pulAction,
  835.                                ULONG * pulLibraryOffset)
  836.  
  837.  
  838.   GETLINKOPTS is invoked with FAR PASCAL linkage if the entry point is speci-
  839.   fied as 16-bit. All pointers must be FAR pointers.  If the interface is spec-
  840.   ified as 32-bit then it will be invoked with OS/2 V2.0 System linkage. All
  841.   pointers are assumed to be FLAT.
  842.  
  843.   The parameters are as follows:
  844.  
  845.   HWORKFRAME          Handle of the WorkFrame primary window.
  846.  
  847.   PVLINKEROPTIONS     Pointer to an area containing the existing linker
  848.                       options.  This area is of size pulLinkOptionsLgth. This
  849.                       area contains existing options if the USEDEFAULTS bit in
  850.                       pulAction is NOT set.  This area should be updated with
  851.                       the new linker options after interaction with the user.
  852.  
  853.   PULLINKOPTIONSLGTH  This parameter is an input/output field. On input it
  854.                       specifies the size of the area provided for storing the
  855.                       options.  This size is specified in the Language Profile.
  856.                       On output, the interface is expected to specify the
  857.  
  858.  
  859.  
  860.                       WorkFrame Programming Interfaces for Compiler Writers  10
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.                       actual size of the options structure.  This size is used
  871.                       when writing the options to the project file.
  872.  
  873.                       If the size is too small, the interface is expected to
  874.                       display a message box indicating what size is required.
  875.                       The user can take corrective action by increasing the
  876.                       area size in the Language Profile.
  877.  
  878.   PSZEXENAME          This parameter is the target name defined when the
  879.                       project was created. It can be used to initialize the
  880.                       EXENAME or DLLNAME on a dialog.
  881.  
  882.   PSZINVOCATIONSTRING This is the area provided to hold the linker invocation
  883.                       string.  Its size is ulInvocationAreaSize. This string
  884.                       must be ASCIIZ, ie nul-delimited.
  885.  
  886.   ULINVOCATIONAREASIZE This is an input parameter only. It provides the size of
  887.                       the data area provided to hold the invocation string.
  888.                       This size is specified in the Language Profile.
  889.  
  890.                       If the size is too small, the interface is expected to
  891.                       display a message box indicating what size is required.
  892.                       The user can take corrective action by increasing the
  893.                       area size in the Language profile.
  894.  
  895.   HMODHANDLE          This is the handle of the Linker Options DLL. This param-
  896.                       eter should be used to access any resources bound to the
  897.                       DLL (ie string tables, dialogs).
  898.  
  899.   PSZPROJECT          This is the up to 100 character description of the
  900.                       project for which the linker options are required. The
  901.                       interface may display this description on its dialogs.
  902.  
  903.   PSZOBJECTS          This parameter will be passed only in response to
  904.                       "Actions/Build" or "Actions/Link". This parameter con-
  905.                       tains an array of pointers to objects to be linked
  906.                       together. The listed is terminated by a NULL pointer.
  907.                       The interface is expected to insert the objects in the
  908.                       appropriate place in the linker invocation string being
  909.                       built.
  910.  
  911.                       If this parameter is NULL. The invocation string should
  912.                       be built as a string of options only. This string will be
  913.                       used during the the makefile creation processing, where
  914.                       the utility is only interested in a generic linker
  915.                       options.
  916.  
  917.   PULACTION           Input/Output area for communicating desired actions with
  918.                       the WorkFrame. The options and the bit settings are as
  919.                       follows:
  920.  
  921.                       o   STOREOPTS   0x0001
  922.  
  923.  
  924.  
  925.  
  926.                       WorkFrame Programming Interfaces for Compiler Writers  11
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.                           This bit is set by the Linker DLL if the user has
  937.                           requested that the options be saved with the project.
  938.                           The WorkFrame will test this bit when control is
  939.                           returned during "Options/Link" processing.
  940.  
  941.                       o   NODLGS      0x0002
  942.  
  943.                           This bit is set if the WorkFrame wishes the interface
  944.                           to not display a dialog, but to simply return an
  945.                           invocation string. This bit is set during
  946.                           "Actions/Link" and "Actions/Build" processing.
  947.  
  948.                       o   USEDEFAULTS 0x0004
  949.  
  950.                           This bit is set if the link options have not previ-
  951.                           ously existed for this Project. The area being passed
  952.                           to the interface will be uninitialized. The interface
  953.                           should set up all options based on linker defaults
  954.                           and return them in the linker options and invocation
  955.                           string areas. If this bit is off then the linker
  956.                           options are provided in the area. If bit 2 is off (ie
  957.                           not NODLGS) then these options should be used to ini-
  958.                           tialize the dialogs. If bit 2 is on then the options
  959.                           should be analyzed to produce an invocation string.
  960.  
  961.   PULLIBRARYOFFSET    This parameter is an output parameter used in support of
  962.                       Makefile creation. The interface is expected to place in
  963.                       this area the offset within the Link Options area where a
  964.                       null delimited list of library names are. For example:
  965.  
  966.                         OS2.LIB+COMPILER.LIB+USER.LIB
  967.  
  968.                       If a library list is not supplied. The interface must
  969.                       return 0xFFFFFFFF.
  970.  
  971.   The returns codes are as follows:
  972.  
  973.       0 - SUCCESS
  974.  
  975.       1 - CANCEL was pressed
  976.  
  977.       2 - ERROR occurred (the DLL will have displayed an appropriate error
  978.       message).
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.                       WorkFrame Programming Interfaces for Compiler Writers  12
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.   INTERFACE TO ACQUIRE DEBUG OPTIONS AND INVOCATION STRING
  1003.   ________________________________________________________
  1004.  
  1005.   The entrypoint "GETDEBUGOPTS" is invoked under two different circumstances in
  1006.   response to a user action bar request. When the user selects
  1007.   "Options"/"Debug" from the action bar, or "Debug Options" from project
  1008.   creation/change, the entry point is invoked to acquire a set of debug options
  1009.   to associate with the current project. When the user selects "Actions/Debug"
  1010.   from the action bar, the interface is invoked to build a string that will be
  1011.   passed to the linker when it is invoked.  This interface will ONLY be invoked
  1012.   in this situation if debug options have been set for that project. If no
  1013.   options exist then the shell uses the default invocation string provided in
  1014.   the language profile and invokes the debugger.
  1015.  
  1016.   The interface must be provided in a DLL. The interface can be either 32-bit
  1017.   or 16-bit (with the caveat that all interfaces in the DLL must be of the same
  1018.   type, either all 32-bit or all 16-bit).  The DLL name type is provided in the
  1019.   language profile supplied by the language developer.  If the interface is
  1020.   16-bit it must be coded to use the FAR PASCAL linkage convention. If it is
  1021.   32-bit it must abide by the OS/2 V2.0 System linkage conventions.
  1022.  
  1023.  
  1024.   INVOCATION SYNTAX
  1025.  
  1026.              LONG GETDEBUGOPTS(HWND    hWorkFrame,
  1027.                                PVOID   pvDebugOptions,
  1028.                                ULONG * pulDebugOptionsLgth,
  1029.                                PSZ     pszDefaultInvocationString,
  1030.                                PSZ     pszInvocationString,
  1031.                                ULONG   ulInvocationAreaSize
  1032.                                HMODULE hModHandle,
  1033.                                ULONG * pulAction,
  1034.                                PSZ     pszProject)
  1035.  
  1036.  
  1037.   GETDEBUGOPTS is invoked with FAR PASCAL linkage if the entry point is speci-
  1038.   fied as 16-bit. All pointers must be FAR pointers.  If the interface is spec-
  1039.   ified as 32-bit then it will be invoked with OS/2 V2.0 System linkage. All
  1040.   pointers are assumed to be FLAT.
  1041.  
  1042.   The parameters are as follows:
  1043.  
  1044.   HWORKFRAME          Handle of the WorkFrame primary window.
  1045.  
  1046.   PVDEBUGOPTIONS      Pointer to an area containing the existing debugger
  1047.                       options.  This area is of size pulDebugOptionsLgth. This
  1048.                       area contains existing options if the USEDEFAULTS bit in
  1049.                       pulAction is NOT set.  This area should be updated with
  1050.                       the new debugger options after interaction with the user.
  1051.  
  1052.   PULDEBUGOPTIONSLGTH This parameter is an input/output field. On input it
  1053.                       specifies the size of the area provided for storing the
  1054.                       options.  On output, the interface is expected to specify
  1055.                       the actual size of the options structure.  This size is
  1056.                       used when writing the options to the project file.
  1057.  
  1058.  
  1059.                       WorkFrame Programming Interfaces for Compiler Writers  13
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.                       If the size is too small, the interface is expected to
  1070.                       display a message box. In the current release of the
  1071.                       shell the maximum size is fixed at 400 bytes.
  1072.  
  1073.   PSZDEFAULTINVOCATIONSTRING This is the default debugger invocation string
  1074.                       provided in the language profile. It can be used to ini-
  1075.                       tialize any input areas.
  1076.  
  1077.                       The WorkFrame accepts a meta language to support param-
  1078.                       eter substitution.
  1079.  
  1080.                       o   %o - indicates that the current project's target name
  1081.                           should be substituted here
  1082.  
  1083.                       o   %r - indicates that the run options associated with
  1084.                           the current project should be substituted here.
  1085.  
  1086.   PSZINVOCATIONSTRING This is the area provided to hold the debugger invocation
  1087.                       string.  Its size is ulInvocationAreaSize. This string
  1088.                       must be ASCIIZ, ie nul-delimited. It should also include
  1089.                       the substitution tokens described for
  1090.                       pszDefaultInvocationString.
  1091.  
  1092.   ULINVOCATIONAREASIZE This is an input parameter only. It provides the size of
  1093.                       the data area provided to hold the invocation string.
  1094.  
  1095.                       If the size is too small, the interface is expected to
  1096.                       display a message box. In the current release of the
  1097.                       WorkFrame the maximum size is fixed at 400 bytes.
  1098.  
  1099.   HMODHANDLE          This is the handle of the Debug Options DLL. This param-
  1100.                       eter should be used to access any resources bound to the
  1101.                       DLL (ie string tables, dialogs).
  1102.  
  1103.   PULACTION           Input/Output area for communicating desired actions with
  1104.                       the WorkFrame. The options and the bit settings are as
  1105.                       follows:
  1106.  
  1107.                       o   STOREOPTS   0x0001
  1108.  
  1109.                           This bit is set by the Debug DLL if the user has
  1110.                           requested that the options be saved with the project.
  1111.                           The WorkFrame will test this bit when control is
  1112.                           returned during "Options/Debug" processing.
  1113.  
  1114.                       o   NODLGS      0x0002
  1115.  
  1116.                           This bit is set if the WorkFrame wishes the interface
  1117.                           to not display a dialog, but to simply return an
  1118.                           invocation string. This bit is set during
  1119.                           "Actions/Debug" processing.
  1120.  
  1121.                       o   USEDEFAULTS 0x0004
  1122.  
  1123.  
  1124.  
  1125.                       WorkFrame Programming Interfaces for Compiler Writers  14
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.                           This bit is set if the debug options have not previ-
  1136.                           ously existed for this Project. The area being passed
  1137.                           to the interface will be uninitialized. The interface
  1138.                           should set up all options based on the default debug
  1139.                           string passed as a parameter.  This bit is never set
  1140.                           in response to a "Actions/Debug" request. In this
  1141.                           case the WorkFrame uses the default invocation string
  1142.                           provided in the language profile.
  1143.  
  1144.   PSZPROJECT          This is the up to 100 character description of the
  1145.                       project for which the debug options are required. The
  1146.                       interface may display this description on its dialogs.
  1147.  
  1148.   The returns codes are as follows:
  1149.  
  1150.       0 - SUCCESS
  1151.  
  1152.       1 - CANCEL was pressed
  1153.  
  1154.       2 - ERROR occurred (the DLL will have displayed an appropriate error
  1155.       message).
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.                       WorkFrame Programming Interfaces for Compiler Writers  15
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.   INTERFACE TO ACQUIRE MAKE OPTIONS AND INVOCATION STRING
  1202.   _______________________________________________________
  1203.  
  1204.   The entrypoint "GETMAKEOPTS" is invoked under two different circumstances in
  1205.   response to a user action bar request. When the user selects "Options/Make"
  1206.   from the action bar, or "Make Options" from project creation/change, the
  1207.   entry point is invoked to acquire a set of make options to associate with the
  1208.   current project. When the user selects "Actions/Make" from the action bar,
  1209.   the interface is invoked to build a string that will be passed to the make
  1210.   utility when it is invoked.  This interface will ONLY be invoked in this sit-
  1211.   uation if make options have been set for that project. If no options exist
  1212.   then the WorkFrame uses the default invocation string provided in the Lan-
  1213.   guage Profile and invokes the make utility.
  1214.  
  1215.   The interface must be provided in a DLL. The interface can be either 32-bit
  1216.   or 16-bit (with the caveat that all interfaces in the DLL must be of the same
  1217.   type, either all 32-bit or all 16-bit).  The DLL name, and interface type is
  1218.   provided in the language profile supplied by the language developer.  If the
  1219.   interface is 16-bit it must be coded to use the FAR PASCAL linkage conven-
  1220.   tion. If it is 32-bit it must abide by the OS/2 V2.0 System linkage con-
  1221.   ventions.
  1222.  
  1223.  
  1224.   INVOCATION SYNTAX
  1225.  
  1226.              LONG  GETMAKEOPTS(HWND    hWorkFrame,
  1227.                                PVOID   pvMakeOptions,
  1228.                                ULONG * pulMakeOptionsLgth,
  1229.                                PSZ     pszDefaultInvocationString,
  1230.                                PSZ     pszInvocationString,
  1231.                                ULONG   ulInvocationAreaSize
  1232.                                HMODULE hModHandle,
  1233.                                ULONG * pulAction,
  1234.                                PSZ     pszProject)
  1235.  
  1236.  
  1237.   GETMAKEOPTS is invoked with FAR PASCAL linkage if the entry point is speci-
  1238.   fied as 16-bit. All pointers must be FAR pointers.  If the interface is spec-
  1239.   ified as 32-bit then it will be invoked with OS/2 V2.0 System linkage. All
  1240.   pointers are assumed to be FLAT.
  1241.  
  1242.   The parameters are as follows:
  1243.  
  1244.   HWORKFRAME          Handle of the WorkFrame primary window.
  1245.  
  1246.   PVMAKEOPTIONS       Pointer to an area containing the existing make options.
  1247.                       This area is of size pulMakeOptionsLgth. This area con-
  1248.                       tains existing options if the USEDEFAULTS bit in
  1249.                       pulAction is NOT set.  This area should be updated with
  1250.                       the new make options after interaction with the user.
  1251.  
  1252.   PULMAKEOPTIONSLGTH  This parameter is an input/output field. On input it
  1253.                       specifies the size of the area provided for storing the
  1254.                       options.  On output, the interface is expected to specify
  1255.  
  1256.  
  1257.  
  1258.                       WorkFrame Programming Interfaces for Compiler Writers  16
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.                       the actual size of the options structure.  This size is
  1269.                       used when writing the options to the project file.
  1270.  
  1271.                       If the size is too small, the interface is expected to
  1272.                       display a message box. In the current release of the
  1273.                       shell the maximum size is fixed at 400 bytes.
  1274.  
  1275.   PSZDEFAULTINVOCATIONSTRING This is the default make invocation string pro-
  1276.                       vided in the language profile. It can be used to ini-
  1277.                       tialize any input areas.
  1278.  
  1279.                       The shell accepts a meta language to support parameter
  1280.                       substitution.
  1281.  
  1282.                       o   %m - indicates that the current project's make file
  1283.                           name should be substituted here.
  1284.  
  1285.                       o   %o - indicates that the current project's executable
  1286.                           name should be substituted here
  1287.  
  1288.   PSZINVOCATIONSTRING This is the area provided to hold the make invocation
  1289.                       string.  Its size is ulInvocationAreaSize. This string
  1290.                       must be ASCIIZ, ie nul-delimited. It should also include
  1291.                       the substitution tokens described for
  1292.                       pszDefaultInvocationString.
  1293.  
  1294.   ULINVOCATIONAREASIZE This is an input parameter only. It provides the size of
  1295.                       the data area provided to hold the invocation string.
  1296.  
  1297.                       If the size is too small, the interface is expected to
  1298.                       display a message box. In the current release of the
  1299.                       WorkFrame the maximum size is fixed at 400 bytes.
  1300.  
  1301.   HMODHANDLE          This is the handle of the Make Options DLL. This param-
  1302.                       eter should be used to access any resources bound to the
  1303.                       DLL (ie string tables, dialogs).
  1304.  
  1305.   PULACTION           Input/Output area for communicating desired actions with
  1306.                       the WorkFrame. The options and the bit settings are as
  1307.                       follows:
  1308.  
  1309.                       o   STOREOPTS   0x0001
  1310.  
  1311.                           This bit is set by the Make DLL if the user has
  1312.                           requested that the options be saved with the project.
  1313.                           The WorkFrame will test this bit when control is
  1314.                           returned during "Options/Make" processing.
  1315.  
  1316.                       o   NODLGS      0x0002
  1317.  
  1318.                           This bit is set if the WorkFrame wishes the interface
  1319.                           to not display a dialog, but to simply return an
  1320.                           invocation string. This bit is set during
  1321.                           "Actions/Make" processing.
  1322.  
  1323.  
  1324.                       WorkFrame Programming Interfaces for Compiler Writers  17
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.                       o   USEDEFAULTS 0x0004
  1335.  
  1336.                           This bit is set if the make options have not previ-
  1337.                           ously existed for this Project. The area being passed
  1338.                           to the interface will be uninitialized. The interface
  1339.                           should set up all options based on the default make
  1340.                           string passed as a parameter.  This bit is never set
  1341.                           in response to a "Actions/Make" request. In this case
  1342.                           the WorkFrame uses the default invocation string pro-
  1343.                           vided in the language profile.
  1344.  
  1345.   PSZPROJECT          This is the up to 100 character description of the
  1346.                       project for which the debug options are required. The
  1347.                       interface may display this description on its dialogs.
  1348.  
  1349.   The returns codes are as follows:
  1350.  
  1351.       0 - SUCCESS
  1352.  
  1353.       1 - CANCEL was pressed
  1354.  
  1355.       2 - ERROR occurred (the DLL will have displayed an appropriate error
  1356.       message).
  1357.  
  1358.  
  1359.   INTERFACES IN SUPPORT OF COMPILER ERROR MESSAGES.,
  1360.   __________________________________________________
  1361.  
  1362.  
  1363.   INTERFACE TO PARSE A COMPILER ERROR MESSAGE,
  1364.  
  1365.   The entrypoint "PARSEERROR" in the Compiler Options DLL is invoked during
  1366.   processing of the output of a Compile,Make or Build operation. The interface
  1367.   is provided with a line of output from the compiler and is expected to return
  1368.   the filename and line number associated with the error message on that line.
  1369.  
  1370.   The interface must be provided in the Compiler Options DLL.  The interface
  1371.   can in the Compiler Options DLL be the same type.  If the interface is 16-bit
  1372.   it must be coded to use the FAR PASCAL linkage convention. If it is 32-bit it
  1373.   must abide by the OS/2 V2.0 System linkage conventions.
  1374.  
  1375.  
  1376.   Invocation Syntax
  1377.  
  1378. |            LONG PARSEERROR(HWND    hwndErrorBox,
  1379.                             USHORT *pusStartline,
  1380.                             USHORT *pusEndline,
  1381.                             HWND    hwndFilenames,
  1382.                             USHORT *pusCurrentFile,
  1383.                             PVOID   pvCompilerOptions,
  1384.                             ULONG * pulAction)
  1385.  
  1386.   PARSEERROR is invoked with FAR PASCAL linkage if the entry point is specified
  1387.   as 16-bit. All pointers must be FAR pointers.  If the interface is specified
  1388.  
  1389.  
  1390.  
  1391.                       WorkFrame Programming Interfaces for Compiler Writers  18
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.   as 32-bit then it will be invoked with OS/2 V2.0 System linkage. All pointers
  1402.   are assumed to be FLAT.
  1403.  
  1404.   The parameters are as follows:
  1405.  
  1406.   HWNDERRORBOX        The handle of a listbox containing all output from the
  1407.                       Make/Compile or Build operation.
  1408.  
  1409.   PUSSTARTLINE        The first line in hwndErrorBox for which the error infor-
  1410.                       mation applies. The interface must update this field.
  1411.  
  1412.   PUSENDLINE          The last line in hwndErrorBox for which the error infor-
  1413.                       mation applies. The interface must update this field.
  1414.  
  1415.                       The interface may process the entire listbox, in which
  1416.                       case pusStartline would contain zero and pusEndline would
  1417.                       contain the last line in the listbox) or the interface
  1418.                       may restrict the range to a particular range (for
  1419.                       example, a single compile in a listbox that contains the
  1420.                       output of many compilations). The WorkFrame uses this
  1421.                       information in determining whether it should re-invoke
  1422.                       the interface. If the user clicks on a line in this
  1423.                       range, the WorkFrame will process the information. If the
  1424.                       line selected is not in the range the interface will be
  1425.                       re-invoked.
  1426.  
  1427.   HWNDFILENAMES       The handle of a listbox into which the interface should
  1428.                       insert the name of each source file containing errors.
  1429.                       The index returned from the insertion message will be
  1430.                       used in the encoding of the error. This is described
  1431.                       later.                                        .
  1432.  
  1433.   PUSCURRENTFILE      The interface should place the index into hwndFilenames
  1434.                       corresponding to the first selected file in this field.
  1435.                       The editor will be invoked initially for this file.
  1436.  
  1437.   PVCOMPILEROPTIONS   Pointer to an area containing the existing compiler
  1438.                       options.  This area contains existing options if the
  1439.                       USEDEFAULTS bit in pulAction is NOT set.
  1440.  
  1441.   PULACTION           Input area used only to define the validity of the
  1442.                       options.  The options and the bit settings are as
  1443.                       follows:
  1444.  
  1445.                       o   USEDEFAULTS 0x0004
  1446.  
  1447.                           This bit is set if the compile options have not pre-
  1448.                           viously existed for this Project. The area being
  1449.                           passed to the interface will be uninitialized.
  1450.  
  1451.   The returns codes are as follows:
  1452.  
  1453.       0 - SUCCESS
  1454.  
  1455.  
  1456.  
  1457.                       WorkFrame Programming Interfaces for Compiler Writers  19
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.       1 - ERROR occurred (No error message should be displayed)
  1468.  
  1469.   Processing might proceed as follows:
  1470.  
  1471.  
  1472.   The line selected by the user will be available by issuing a WinSendMessage
  1473.   call for LM_QUERYSELECTION. For example,
  1474.  
  1475.  
  1476.        if ((sIndex= SHORT1FROMMR( WinSendMsg(hwndErrorBox,
  1477.                                   LM_QUERYSELECTION,
  1478.                                   (MPARAM)NULL,
  1479.                                   (MPARAM)NULL)))
  1480.                      == LIT_NONE)
  1481.           return ERROR_CODE;
  1482.  
  1483.  
  1484.   The interface can get the text of the line and determine whether it contains
  1485.   a valid error message. For example,
  1486.  
  1487.  
  1488.        WinSendMsg(hwndErrorBox,
  1489.                   LM_QUERYITEMTEXT,
  1490.                   MPFROM2SHORT(sIndex,sizeof(work)),
  1491.                   MPFROMP(work));
  1492.  
  1493.        rc=Parsetheline(work,infostructure);
  1494.  
  1495.   If the line contains an error message, the interface should record the source
  1496.   filename, the line number and the offset within the line. If the latter is
  1497.   not available, zero should be used.  The offset is in bytes, not characters.
  1498.   If tabs are present they are counted only as one byte. The filename should be
  1499.   inserted into the hwndFilenames listbox and the index used in message
  1500.   encoding.  The interface should first ensure that an index was not previously
  1501.   assigned for this file. One way this might be done is:
  1502.  
  1503.        insertIndex = SHORT1FROMMR(
  1504.                        WinSendMsg(hwndFilenames,
  1505.                                   LM_SEARCHSTRING,
  1506.                                   MPFROM2SHORT(LSS_CASESENSITIVE,LIT_FIRST),
  1507.                                   MPFROMP(pszSourceFile)));
  1508.  
  1509.  
  1510.        if (insertIndex == LIT_ERROR)
  1511.           return ERROR_CODE;
  1512.  
  1513.        if (insertIndex == LIT_NONE)
  1514.            insertIndex = SHORT1FROMMR(WinSendMsg(hwndFilenames,
  1515.                                       LM_INSERTITEM,
  1516.                                       MPFROMSHORT(LIT_END),
  1517.                                       (MPARAM)pszSourceFile));
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.                       WorkFrame Programming Interfaces for Compiler Writers  20
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.   The index returned for the first file associated with the selected line
  1534.   should be returned in the pusCurrentFile field.
  1535.  
  1536.   The information about the error is encoded and placed in the tag field asso-
  1537.   ciated with the hwndErrorBox item. The encoding is of the form:
  1538.  
  1539.              USHORT  errorLine  ;
  1540.              UCHAR   offset     ;
  1541.              UCHAR   fileNumber ;
  1542.  
  1543.   Any line not containing an error message should be left alone (ie it will
  1544.   contain a zero in the tag/handle field).
  1545.  
  1546.   For example,
  1547.  
  1548.        typedef  union  _TAGPARAM
  1549.           {
  1550.           unsigned long  tagParam ;
  1551.           struct
  1552.              {
  1553.              USHORT  errorLine  ;
  1554.              char    offset     ;
  1555.              char    fileNumber ;
  1556.              } sub  ;
  1557.           } TAGPARAM;
  1558.  
  1559.        TAGPARAM  mpParam;
  1560.  
  1561.        mpParam.sub.errorLine   = lineNumber  ;
  1562.        mpParam.sub.offset      = 0           ;
  1563.        mpParam.sub.fileNumber  = insertIndex ;
  1564.  
  1565.        WinSendMsg(hwndErrorBox,
  1566.                   LM_SETITEMHANDLE,
  1567.                   MPFROMSHORT(sIndex),
  1568.                   (MPARAM)(ULONG)(mpParam.tagParam));
  1569.  
  1570.  
  1571.   Processing would then continue forward and backward from the selected line,
  1572.   finding a range of lines in the hwndErrorBox for which the item tags are
  1573.   valid. That range should be returned in pusStartline and pusEndline.
  1574.  
  1575.  
  1576. | INTERFACE TO OBTAIN THE ERROR MESSAGE HELP FILE NAME
  1577.  
  1578. | The WorkFrame will invoke the QUERYHELPFILE interface after invoking the DLL
  1579. | to parse the error messages. The interface is expected to place the string
  1580. | representing the IPF .HLP file in the area provided and return TRUE if help
  1581. | is supported. Returning FALSE indicates that error message help is not sup-
  1582. | ported.
  1583.  
  1584.  
  1585. | Invocation Syntax
  1586.  
  1587.  
  1588.  
  1589.                       WorkFrame Programming Interfaces for Compiler Writers  21
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600. |            BOOL QUERYHELPFILE(PSZ  pszLibrary);
  1601.  
  1602.  
  1603. | QUERYHELPFILE is invoked with FAR PASCAL linkage if the entry point is speci-
  1604. | fied as 16-bit. All pointers must be FAR pointers.  If the interface is spec-
  1605. | ified as 32-bit then it will be invoked with OS/2 V2.0 System linkage. All
  1606. | pointers are assumed to be FLAT.
  1607.  
  1608. | The parameter is as follows:
  1609.  
  1610. | PSZLIBRARY          Output area into which the name of the .HLP file is to be
  1611. |                     placed.
  1612.  
  1613. |                     For example, DDE4ERRS.HLP
  1614.  
  1615. | The returns codes are as follows:
  1616.  
  1617. |     TRUE - A library name has been provided
  1618.  
  1619. |     FALSE- A library name has NOT been provided
  1620.  
  1621.  
  1622. | INTERFACE TO PROVIDE A RESOURCE ID FOR A GIVEN ERROR MESSAGE
  1623.  
  1624. | Whenever the WorkFrame requires the resource id corresponding to a particular
  1625. | error message line it will invoke the QUERYRESOURCEID interface to return the
  1626. | resourceid corresponding to the error message contained in the string being
  1627. | passed. It is the responsibility of the interface to parse the error line and
  1628. | determine what resource id should be returned. All resource ids must be
  1629. | greater than 20000 since values lower than that are reserved for use by the
  1630. | editor.
  1631.  
  1632.  
  1633. | Invocation Syntax
  1634.  
  1635.  
  1636. |            ULONG QUERYRESOURCEID(PSZ  pszErrorLine);
  1637.  
  1638.  
  1639. | QUERYRESOURCEID is invoked with FAR PASCAL linkage if the entry point is
  1640. | specified as 16-bit. All pointers must be FAR pointers.  If the interface is
  1641. | specified as 32-bit then it will be invoked with OS/2 V2.0 System linkage.
  1642. | All pointers are assumed to be FLAT.
  1643.  
  1644. | The parameter is as follows:
  1645.  
  1646. | PSZERRORLINE        Input area containing the error message line to be
  1647. |                     parsed.
  1648.  
  1649. |                     For example,
  1650.  
  1651. |                       PMLINES.C(176) XXX4023W Warning,You have an error
  1652.  
  1653.  
  1654.  
  1655.                       WorkFrame Programming Interfaces for Compiler Writers  22
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665. | The returns codes are as follows:
  1666.  
  1667. |     0 - No resourceid is provided
  1668.  
  1669. |     >20000 resouce id to use (by convention it must be greater than 20000 and
  1670. |     correspond to the resource id in the .HLP file).
  1671.  
  1672.  
  1673.   INTERFACES IN SUPPORT OF MAKE FILE CREATION
  1674.   ___________________________________________
  1675.  
  1676.   In order to provide language independence in the make file creation process,
  1677.   the utility must call the language DLL for certain types of processing. When
  1678.   it requires the invocation string it will call the COMPILEOPTS entrypoint in
  1679.   the compiler options DLL. It uses the language mask stored in the Language
  1680.   Profile to identify valid source files. When it needs to parse a file to
  1681.   determine its dependencies (ie included files), it calls the FINDINCLUDE
  1682.   entrypoint in the compiler options DLL. This entrypoint will acquire storage
  1683.   in support of this processing. When the make file creation process is fin-
  1684.   ished, it will call the FREEMEMORY entry point to allow the DLL to free all
  1685.   acquired resources.
  1686.  
  1687.  
  1688.   INTERFACE TO BUILD SOURCE FILE INCLUDE DEPENDENCIES,
  1689.  
  1690.   The entrypoint "FINDINCLUDE" in the Compiler Options DLL is invoked during
  1691.   the creation of a make file to parse a source file for any dependencies. It
  1692.   is expected to return an array of dependent files, an array of included files
  1693.   for which a dependency should not be generated and an array of messages to be
  1694.   displayed.
  1695.  
  1696.   The interface must be provided in the Compiler Options DLL.  The interface
  1697.   can be either 32-bit or 16-bit (with the caveat that all interfaces in the
  1698.   DLL must be of the same type, either all 32-bit or all 16-bit).  If the
  1699.   interface is 16-bit it must be coded to use the FAR PASCAL linkage conven-
  1700.   tion. If it is 32-bit it must abide by the OS/2 V2.0 System linkage con-
  1701.   ventions.
  1702.  
  1703.  
  1704.   INVOCATION SYNTAX
  1705.  
  1706.              LONG  FINDINCLUDE (PSZ * * ppszNonDependentIncludes,
  1707.                                 PSZ * * ppszDependentIncludes,
  1708.                                 PSZ * * ppszErrorMessages,
  1709.                                 PSZ     pszFileName,
  1710.                                 PVOID   pvCompilerOptions);
  1711.  
  1712.  
  1713.   FINDINCLUDE is invoked with FAR PASCAL linkage if the entry point is speci-
  1714.   fied as 16-bit. All pointers must be FAR pointers.  If the interface is spec-
  1715.   ified as 32-bit then it will be invoked with OS/2 V2.0 System linkage. All
  1716.   pointers are assumed to be FLAT.
  1717.  
  1718.   The parameters are as follows:
  1719.  
  1720.  
  1721.  
  1722.                       WorkFrame Programming Interfaces for Compiler Writers  23
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.   PPSZNONDEPENDENTINCLUDES The make file creation will initially set up a 4
  1733.                       byte work area as NULL. The interface is expected to
  1734.                       acquire storage to hold an array of pointers to
  1735.                       filenames. The convention is that the last pointer is
  1736.                       NULL.  Each element is to point to a filename of any
  1737.                       included file that you want displayed in the makefile as
  1738.                       a comment but not included in the dependency list.  In C,
  1739.                       for example, this might correspond to any system include
  1740.                       files, eg <stdlib.h>.
  1741.  
  1742.                       If there are no files included in the source that meet
  1743.                       this criteria then return NULL in the first pointer
  1744.                       location. Refer to -- Fig 'FIG35' unknown --. for a
  1745.                       diagram of this array.  You may reuse this storage on
  1746.                       subsequent invocations.
  1747.  
  1748.                       If the filename is NULL, only the first element of the
  1749.                       array is used.  The make file generation tool assumes
  1750.                       that it points to a search path for the non-dependant
  1751.                       includes, in a syntax acceptable to the make utility, see
  1752.                       -- Heading 'SPTH' unknown -- for a description.
  1753.  
  1754.   PPSZDEPENDENTINCLUDES The make file creation will initially set up a 4 byte
  1755.                       work area as NULL. The interface is expected to acquire
  1756.                       storage to hold an array of pointers to filenames. The
  1757.                       convention is that the last pointer is NULL.  Each
  1758.                       element is to point to a filename of any included file
  1759.                       that you want generated in the makefile as a dependency.
  1760.                       Do not read any of the included files, the interface will
  1761.                       be reinvoked later using each of the dependent files to
  1762.                       find any nested dependencies.
  1763.  
  1764.                       If there are no files included in the source that meet
  1765.                       this criteria then return NULL in the first pointer
  1766.                       location. Refer to -- Fig 'FIG35' unknown --. for a
  1767.                       diagram of this array.  You may reuse this storage on
  1768.                       subsequent invocations.
  1769.  
  1770.                       If the filename is NULL, only the first element of the
  1771.                       array is used.  The make file generation tool assumes
  1772.                       that it points to a search path for the dependant
  1773.                       includes, in a syntax acceptable to the make utility, see
  1774.                       -- Heading 'SPTH' unknown -- for a description.
  1775.  
  1776.   PPSZERRORMESSAGES   The make file creation will initially set up a 4 byte
  1777.                       work area as NULL. The interface is expected to acquire
  1778.                       storage to hold an array of pointers to any error mes-
  1779.                       sages. The convention is that the last pointer is NULL.
  1780.                       Each element is to point to an error message.  If there
  1781.                       are no error messages then return NULL in the first
  1782.                       pointer location and return SUCCESS.  If there are error
  1783.                       messages then return ERROR.
  1784.  
  1785.  
  1786.  
  1787.  
  1788.                       WorkFrame Programming Interfaces for Compiler Writers  24
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.   PSZFILENAME         This is the name of the file to be opened and parsed.
  1799.  
  1800.   PVCOMPILEROPTIONS   This is a pointer to the current compiler options struc-
  1801.                       ture, in case this information is useful in parsing the
  1802.                       file.
  1803.  
  1804.   The returns codes are as follows:
  1805.  
  1806.       0 - SUCCESS
  1807.  
  1808.       1 - ERROR occurred
  1809.  
  1810.  
  1811.   Search Path Specification
  1812.  
  1813.   The search path is a mixture of directory names and environment variables,
  1814.   separated by semicolons. Environment variables are specified as symbolic var-
  1815.   iables as used by the Make utility.  For example,
  1816.  
  1817.   To search the current directory and the directories given by the environment
  1818.   variable "INCLUDE" specify:
  1819.  
  1820.     ;$(INCLUDE)
  1821.  
  1822.   To search directories E:\FRED and F:\GEORGE specify,
  1823.  
  1824.          E:\FRED;F:\GEORGE
  1825.  
  1826.   To search paths given by the environment variables FRED and GEORGE specify,
  1827.  
  1828.          $(FRED);$(GEORGE)
  1829.  
  1830.  
  1831.   INTERFACE TO FREE ACQUIRED MEMORY
  1832.  
  1833.   The entrypoint "FREEMEMORY" in the Compiler Options DLL is invoked after make
  1834.   file creation processing has finished processing.  It passes a pointer to
  1835.   each of the arrays for which storage might have been acquired. The interface
  1836.   should free all acquired memory.
  1837.  
  1838.   The interface must be provided in the Compiler Options DLL.  The interface
  1839.   can be either 32-bit or 16-bit, with the restriction that all interfaces in
  1840.   the Compiler Options DLL be the same type.  If the interface is 16-bit it
  1841.   must be coded to use the FAR PASCAL linkage convention. If it is 32-bit it
  1842.   must abide by the OS/2 V2.0 System linkage conventions.
  1843.  
  1844.  
  1845.  
  1846.   INVOCATION SYNTAX
  1847.  
  1848.               VOID FREEMEMORY  (PSZ *  ppszNonDependentIncludes,
  1849.                                 PSZ *  ppszDependentIncludes,
  1850.                                 PSZ *  ppszErrorMessages);
  1851.  
  1852.  
  1853.  
  1854.                       WorkFrame Programming Interfaces for Compiler Writers  25
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.   FREEMEMORY is invoked with FAR PASCAL linkage if the entry point is specified
  1865.   as 16-bit. All pointers must be FAR pointers.  If the interface is specified
  1866.   as 32-bit then it will be invoked with OS/2 V2.0 System linkage. All pointers
  1867.   are assumed to be FLAT.
  1868.  
  1869.   The parameters are as follows:
  1870.  
  1871.   PPSZNONDEPENDENTINCLUDES A pointer to the array of pointers. Each active
  1872.                       element of the array should be freed, as well as
  1873.                       ppszNonDependentIncludes.
  1874.  
  1875.   PPSZDEPENDENTINCLUDES A pointer to the array of pointers. Each active element
  1876.                       of the array should be freed, as well as
  1877.                       ppszNonDependentIncludes.
  1878.  
  1879.   PPSZERRORMESSAGES   A pointer to the array of pointers. Each active element
  1880.                       of the array should be freed, as well as
  1881.                       ppszNonDependentIncludes.
  1882.  
  1883.   The interface does not return anything.
  1884.  
  1885.  
  1886.   -----------------------------------------------------------------------------
  1887.  
  1888.   Pointer on Stack
  1889.    +--------+
  1890.    |        |
  1891.    +--------+
  1892.        |                   Array of Ptrs
  1893.        |                    acquired by
  1894.        V                    FINDINCLUDE
  1895.    +--------+               +--------+           +-------------------+
  1896.    |        |-------------> |        |---------> |  search path      |
  1897.    +--------+               |--------|           +-------------------+
  1898.                             |        |---------> +-------------------+
  1899.    Pointer                  |--------|           |  filename 1       |
  1900.    in Make                  |  NULL  |           +-------------------+
  1901.    File Create              |--------|
  1902.    Storage                  |        |
  1903.                             |--------|
  1904.                             |        |
  1905.                             |--------|
  1906.                             |        |
  1907.                             +--------+
  1908.  
  1909.  
  1910.   -----------------------------------------------------------------------------
  1911.   Figure 4. FINDINCLUDE Pointer Overview
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.                       WorkFrame Programming Interfaces for Compiler Writers  26
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.   WORKFRAME INTERFACES TO THE EDITOR
  1931.   __________________________________
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.   OVERVIEW OF COMPILER/WORKFRAME/EDITOR ERROR MESSAGE HANDLING
  1938.   ____________________________________________________________
  1939.  
  1940.   The WorkFrame will communicate compilation errors to the Editor by using DDE
  1941.   calls. An overview of the interaction between compiler, WorkFrame and Editor
  1942.   are depicted in -- Fig 'WBEDIT' unknown --
  1943.  
  1944.   1.  In response to a Make/Compile or Build Action, the WorkFrame invokes the
  1945.       Make utility, the Compiler or the Linker via DosExecPgm.
  1946.  
  1947.   2.  The utility writes its output to one of the Standard I/O handles (Stdout
  1948.       or Stderr). These handles have been redirected back to the WorkFrame and
  1949.       the output is displayed in a listbox.
  1950.  
  1951. | 3.  When the user double clicks on an error line(1) in the listbox for the
  1952.       first time, the WorkFrame will invoke the compiler DLL to find all error
  1953.       messages for all files in the listbox.
  1954.  
  1955. | 4.  The compiler DLL returns this information to the WorkFrame, at that point
  1956. |     the WorkFrame will invoke the DLL to determine the name of the error
  1957. |     message help file, if one exists.
  1958.  
  1959.   5.  The WorkFrame then starts the Editor for the source file identified in
  1960. |     the error message clicked upon, (via DosStartSession)(2).  and issues a
  1961.       WinDdeInitiate call to establish a conversation with the Editor.
  1962.  
  1963.   6.  Once the Editor is initialized (having identified itself as the server
  1964.       for that file), it will receive the connection request for that file. It
  1965.       should accept the request by sending a WinDdeRespond message.
  1966.  
  1967.   7.  Once the acceptance of the connection is received, the WorkFrame will
  1968.       send a WM_DDE_EXECUTE message to tell the Editor to Initialize passing it
  1969. |     information about all source lines in error, and the name of the help
  1970. |     file (if one is provided).  This message also implies a WM_DDE_ADVICE
  1971.       message, confirming that the Editor may send WM_DDE_DATA requests (see
  1972.       below).
  1973.  
  1974.   8.  The Editor should send a WM_DDE_ACK message back confirming acceptance of
  1975.       the command.
  1976.  
  1977.  
  1978.   ---------------
  1979.  
  1980. | (1) This process can also be initiated by selecting a line and beginning a
  1981. |     drag operation.
  1982.  
  1983. | (2) If a drag operation is in progress then the WorkFrame will issue a
  1984. |     DrgDrag request and if a drop is accepted, enable itself for DDE communi-
  1985. |     cation
  1986.  
  1987.  
  1988.                                          WorkFrame Interfaces to the Editor  27
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.   9.  As the user continues to double click on different error messages in the
  1999.       listbox, the WorkFrame will send a WM_DDE_EXECUTE message to tell the
  2000.       Editor to "Goto" a particular line (ie original source line), passing it
  2001.       information about that particular line.
  2002.  
  2003.   10. The Editor should send a WM_DDE_ACK message back confirming acceptance of
  2004.       the command.
  2005.  
  2006.   11. The Editor may send a WM_DDE_DATA request to ask for information relating
  2007.       to a particular error line. This will cause the WorkFrame to send a
  2008.       WM_DDE_EXECUTE "Goto" message (see point 9 above).
  2009.  
  2010.   12. If the listbox dialog is terminated by the user, the WorkFrame will send
  2011.       the Editor a WM_DDE_TERMINATE message.  If the user terminates the Edit
  2012.       session the Editor will send the WorkFrame a WM_DDE_TERMINATE message.
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.                                          WorkFrame Interfaces to the Editor  28
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.   +---------------------------------------------------------------------------+
  2065.   |                                                                           |
  2066.   |                    +---------+        +---------+     5.     +---------+  |
  2067.   |                    | Make/   |   1.   |         |----------->|         |  |
  2068.   |   +--------+  2.   | Compiler|<-------|         |     6.     |         |  |
  2069.   |   |        |<------| Linker  |        |         |<-----------|         |  |
  2070.   |   |        |       |         |        |         |            |         |  |
  2071.   |   |Standard|       +---------+        |         |     7.     |         |  |
  2072.   |   |Out/Err |                          |         |----------->|         |  |
  2073.   |   |Listbox |       +---------+        |         |     8.     |         |  |
  2074.   |   |        |       |         |        |         |<-----------|         |  |
  2075.   |   |        |-----> |Compiler |   3.   |  SHELL  |            | EDITOR  |  |
  2076.   |   +--------+       |  Error  |<-------|         |     9.     |         |  |
  2077.   |                    | Parsing |        |         |----------->|         |  |
  2078.   |                    |   DLL   |        |         |    10.     |         |  |
  2079.   |                    |         |        |         |<-----------|         |  |
  2080.   |                    +---------+        |         |            |         |  |
  2081.   |                         |             |         |    11.     |         |  |
  2082.   |                         V 4.          |         |<-----------|         |  |
  2083.   |                    +---------+        |         |            |         |  |
  2084.   |                    | Error   |        |         |    12.     |         |  |
  2085.   |                    | Info.   |------->|         |<---------->|         |  |
  2086.   |                    |         |        |         |            |         |  |
  2087.   |                    +---------+        +---------+            +---------+  |
  2088.   |                                                                           |
  2089.   |                                                                           |
  2090.   +---------------------------------------------------------------------------+
  2091.   Figure 5. Overview of Compiler/WorkFrame/Editor Interaction
  2092.  
  2093.   WORKFRAME/EDITOR INTERACTION FOR COMPILER ERROR MESSAGES
  2094.   ________________________________________________________
  2095.  
  2096.   A description of the interaction and the format of the messages follows:
  2097.  
  2098.   1.  In response to a user action, the WorkFrame will start the editor via
  2099.       DosStartSession, passing it the name of the file to be edited.
  2100.  
  2101.   2.  The Editor must register itself as a Server for that file specifying an
  2102.       application name of "WB Server" and using the filename as the topic name.
  2103.  
  2104.       That is
  2105.  
  2106.               WinDdeInitiate(hwnd, "WB Editor", szBuf);
  2107.  
  2108.               where:
  2109.                      hwnd  - Editor window handle
  2110.                      szBuf - Name of the file being edited.
  2111.  
  2112.   3.  The WorkFrame will then try to establish a DDE session. The request will
  2113.       come to the Editor as a WM_DDE_INITIATE message. Logic can look as
  2114.       follows:
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.                                          WorkFrame Interfaces to the Editor  29
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.  
  2131.             case  WM_DDE_INITIATE :
  2132.             {
  2133.               PDDEINIT pddei = NULL;               /* DDE init struct ptr   */
  2134.                  /* is this our own broadcast? then don't process it */
  2135.               if ((HWND)mp1 == hwnd)
  2136.                 break;
  2137.  
  2138.               pddei = (PDDEINIT)mp2;
  2139.  
  2140.               if (!fConnected)   /* could keep track of whether you are connected
  2141.                                     already and handle only one connection */
  2142.                 {
  2143.  
  2144.            /* check to see if the request is from the WorkFrame */
  2145.                 if ((strcmp("WB Editor", pddei->pszAppName) == 0) &&
  2146.            /* check to see if the request is for the filename stored prev */
  2147.                  (strcmp(szBuf, pddei->pszTopic) == 0))
  2148.                   {
  2149.                     hwndDDEClient = (HWND)mp1; /* store client window handle */
  2150.  
  2151.                     /* reply that the connection is accepted by passing filename
  2152.                        as the topic and "WB Editor" as the application name */
  2153.                     WinDdeRespond((HWND)mp1, hwnd,  "WB Editor", szBuf);
  2154.                     fConnected = TRUE;  /* conversation established   */
  2155.                   }
  2156.                 }
  2157.               DosFreeSeg(PDDEITOSEL(pddei));   /* REQUIRED see msj v4n3 may 89 */
  2158.               break;
  2159.             }
  2160.  
  2161.   4.  Once the WorkFrame receives the acknowledgement it will send an initiate
  2162.       message, passing a list of all the lines in error. The Editor could do
  2163.       such things as initializing variables to keep track of original line
  2164.       numbers or colorizing all lines-in-error.
  2165.  
  2166.       The message will come in as a WM_DDE_EXECUTE.  The format of the message
  2167.       is as follows:
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.                                          WorkFrame Interfaces to the Editor  30
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.  
  2197.             ULONG   cbData;        /* size of structure + item + data */
  2198.             USHORT  fsStatus;      /* can be ignored */
  2199.             USHORT  usFormat;      /* can be ignored */
  2200.             USHORT  offszItemName; /* offset to message type "Initialize" */
  2201.             USHORT  offabData;     /* offset to data */
  2202.             CHAR    message[];     /* "Initialize"   - ASCIIZ */
  2203.             ULONG   errorcount     /* count of number of errors to follow */
  2204.             ERRSTR  errors[] ;     /* list of source lines in error */
  2205. |           ULONG   textlength  ;  /* length of library name   (not including */
  2206. |                                  /* the terminating NULL)                   */
  2207. |           char    libraryname[]; /* Asciiz text of library name          */
  2208.  
  2209.  
  2210.         where ERRSTR is a structure consisting of:
  2211.  
  2212.         typedef _errstr
  2213.            {
  2214.             ULONG errorline;
  2215.             ULONG offset;
  2216.             ULONG length;
  2217.             ULONG magic_cookie;
  2218.            } ERRSTR;
  2219.  
  2220.  
  2221.       The "magic cookie" field is really the first line in the error listbox
  2222.       relating to this error. This field can be used in a message from the
  2223.       Editor to the WorkFrame (a WM_DDE_DATA message) to ask the shell to send
  2224.       a "Goto" message for this error. This mechanism allows the Editor to
  2225.       implement a "Next Error" function amd get the error message text related
  2226.       to that error. The errorline and offset fields are provided by the com-
  2227.       piler error message parser. In the first release the errorline will be in
  2228.       the range 1 through 65535 and the offset will be in the range 0 through
  2229.       255. The length field provides information to aid in error highlighting.
  2230.       It tells the editor to highlight the line starting at offset for length.
  2231. |     In this release the length will always be zero.  The Editor should posi-
  2232. |     tion the cursor at the offset provided within that line (if possible) and
  2233. |     highlight portions of the line beginning at that offset (possibly until
  2234. |     the next blank).
  2235.  
  2236. |     If textlength is not zero then a library name is available.  The editor
  2237. |     should associate this help file with the current help instance. The
  2238. |     resource ids, by convention, contained in this file are greater than
  2239. |     20000, leaving the lower 20000 resource ids for use by the editor.
  2240.  
  2241.       The offszItemName field points to the  message array and the offabData
  2242.       field points to the errorcount field. Two macros are provide by OS/2 to
  2243.       convert these offsets into pointers. The pointers can then be used to
  2244.       access the message type and data areas of the message.
  2245.  
  2246.         #define DDES_PSZITEMNAME(pddes) \
  2247.                 (((PSZ)pddes) + ((PDDESTRUCT)pddes)->offszItemName)
  2248.  
  2249.         #define DDES_PABDATA(pddes)       \
  2250.                 (((PBYTE)pddes) + ((PDDESTRUCT)pddes)->offabData)
  2251.  
  2252.  
  2253.                                          WorkFrame Interfaces to the Editor  31
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.       Sample processing might be:
  2264.  
  2265.             case  WM_DDE_EXECUTE :             /* one time DDE data request         */
  2266.               pddeIn = (PDDESTRUCT)mp2;
  2267.               if (pddeIn == NULL)
  2268.                 return ;
  2269.  
  2270.                  /* Do we have an established conversation with this client? */
  2271.  
  2272.               if (hwndDDEClient == (HWND)mp1)
  2273.               {
  2274.  
  2275.                       /* is it an initialize request */
  2276.                 if (strcmp(DDES_PSZITEMNAME(pddeIn), "Initialize") == 0)
  2277.                 {
  2278.                   ULONG  * worklines;
  2279.  
  2280.                   worklines= (ULONG *)DDES_PABDATA(pddeIn);
  2281.                   errorcount=*worklines;
  2282.                   ++worklines;
  2283.  
  2284.                   /* now use the count of errors and each error line number
  2285.                     to initialize the environment for subsequent goto messages */
  2286.  
  2287.                   /* finally send the client an acknowledgement, it is the
  2288.                      client's (ie WorkFrame's responsibility to free storage)
  2289.  
  2290.                   WinDdePostMsg(hwndDDEClient,hwnd,WM_DDE_ACK,pddeIn);
  2291.                 }
  2292.  
  2293.               return 0;
  2294.               break;                           /* dde_request                       */
  2295.  
  2296.   5.  After the conversation has started and the Editor has been initialized
  2297.       for that file, every time the User double clicks on a line in error in
  2298.       the Errors listbox a "Goto" message will be sent to the Editor. The
  2299.       format of the "Goto" message is as follows:
  2300.  
  2301.             ULONG   cbData;        /* size of structure + item + data */
  2302.             USHORT  fsStatus;      /* can be ignored */
  2303.             USHORT  usFormat;      /* can be ignored */
  2304.             USHORT  offszItemName; /* offset to message type "Goto" */
  2305.             USHORT  offabData;     /* offset to data */
  2306.             CHAR    message[];     /* "Goto"   - ASCIIZ */
  2307.             ULONG   errorline;     /* original source line in error       */
  2308.             ULONG   errorsoffset;  /* offset of start of error within line */
  2309. |           ULONG   resourceid  ;  /* resourceid of help in the help file  */
  2310. |                                  /* corresponding to this message           */
  2311. |           ULONG magic_cookie;
  2312.             ULONG   textlength  ;  /* length of text to follow (not including */
  2313.                                    /* the terminating NULL)                   */
  2314.             char    errortext[];   /* Asciiz text of error message         */
  2315.  
  2316.  
  2317.  
  2318.  
  2319.                                          WorkFrame Interfaces to the Editor  32
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.       The Editor should scroll the Edit session to the line in error and place
  2330.       the mouse pointer at the offset within that line in error (the Editor
  2331.       should allow for any tabs expansion since this offset will make no
  2332.       assumption about tabs, ie a tab character is just another character on
  2333.       the line). The Editor is also passed the text of the message so that it
  2334. |     could be displayed in an information area.  The resource id (if it is not
  2335. |     zero) can be used to display help for that error message (via
  2336. |     WinPostMsg(hwndHelp,HM_DISPLAY_HELP...))
  2337.  
  2338.       Sample code is as follows:
  2339.  
  2340.             case  WM_DDE_EXECUTE :             /* one time DDE data request         */
  2341.               pddeIn = (PDDESTRUCT)mp2;
  2342.               if (pddeIn == NULL)
  2343.                 return ;
  2344.  
  2345.                  /* Do we have an established conversation with this client? */
  2346.  
  2347.               if (hwndDDEClient == (HWND)mp1)
  2348.               {
  2349.  
  2350.                       /* is it a goto request */
  2351.                  if (strcmp(DDES_PSZITEMNAME(pddeIn), "Goto") == 0)
  2352.                  {
  2353.                    USHORT * work;
  2354.  
  2355.                    work = (USHORT *)DDES_PABDATA(pddeIn);
  2356.                    currenterror = *work;
  2357.                    currentoffset = *(work+1);
  2358. |                  currentresid  = *(work+2);
  2359. |                  currentmagic  = *(work+3);
  2360. |                  strcpy(szErrorLine,(PSZ)(work+5));
  2361.                    /* then use the error line, offset and text to position
  2362.                       the mouse pointer and scroll */
  2363.  
  2364.                   /* finally send the client an acknowledgement, it is the
  2365.                      client's (ie WorkFrame's responsibility to free storage)
  2366.  
  2367.                   WinDdePostMsg(hwndDDEClient,hwnd,WM_DDE_ACK,pddeIn);
  2368.                  }
  2369.               }
  2370.               return 0;
  2371.               break;                           /* dde_request                       */
  2372.  
  2373.       In response to a "Next Error" action the Editor can tell the WorkFrame to
  2374.       Send a  "Goto" message containing the text of a particular message. The
  2375.       format of the message is as follows:
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.                                          WorkFrame Interfaces to the Editor  33
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395.             ULONG   cbData;        /* size of structure + item + data */
  2396.             USHORT  fsStatus;      /* can be ignored */
  2397.             USHORT  usFormat;      /* can be ignored */
  2398.             USHORT  offszItemName; /* offset to message type "Goto" */
  2399.             USHORT  offabData;     /* offset to data */
  2400.             CHAR    message[];     /* "SendGoto"   - ASCIIZ */
  2401.             ULONG   magiccookie;   /* identification of which error message */
  2402.                                    /* information is required               */
  2403.  
  2404.       The message must be "SendGoto" and the data must be the magiccookie. This
  2405.       information is used to initialize the DDE structure .  and the
  2406.       WM_DDE_DATA message is sent.
  2407.  
  2408.           SEL sel = NULL;
  2409.           PDDESTRUCT pdde = NULL;
  2410.           USHORT rc = 0;
  2411.           USHORT usSegSize ;
  2412.           USHORT totalsize;
  2413.  
  2414.           /**************************************************************************/
  2415.           /* 1) Allocate a givable memory segment                                   */
  2416.           /**************************************************************************/
  2417.           usDataSize = 4;   /* the size of the magic cookie */
  2418.           usSegSize = (USHORT)strlen("SendGoto")+1;
  2419.           totalsize = sizeof(DDESTRUCT)+usDataSize+usSegSize;
  2420.           rc = DosAllocSeg(totalsize,            // ddestruct + topic
  2421.                            &sel, SEG_GIVEABLE);
  2422.           if (rc && sel)                     // check api return code and selector
  2423.             return  NULL;
  2424.  
  2425.           /**************************************************************************/
  2426.           /* 2) Fill in the new DDE structure                                       */
  2427.           /**************************************************************************/
  2428.  
  2429.           pdde = SELTOPDDES(sel);
  2430.           memset((PVOID)pdde, 0, (size_t)usSegSize); // zero out memory
  2431.           pdde->usFormat = usFormat;/* the WorkFrame doesn't care in R1) */
  2432.           pdde->offszItemName = (USHORT)sizeof(DDESTRUCT);
  2433.           memcpy(DDES_PSZITEMNAME(pdde), "SendGoto",usSegSize);
  2434.           pdde->offabData = (USHORT)sizeof(DDESTRUCT)+usSegSize;
  2435.           memcpy(DDES_PABDATA(pdde), magiccookie,usDataSize);
  2436.           pdde->fsStatus = 0;           // set status flags
  2437.           pdde->cbData = (ULONG)totalsize;
  2438.  
  2439.           WinDdePostMsg(hwndDDEClient,hwnd,WM_DDE_DATA,pdde);
  2440.  
  2441.       When the user terminates the error message listbox the shell will send a
  2442.       terminate message to the Editor, so that the session can be disestab-
  2443.       lished. The request will come in as a WM_DDE_TERMINATE message
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.                                          WorkFrame Interfaces to the Editor  34
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.             case  WM_DDE_TERMINATE :           /* DDE conversation termination
  2462.                                                   request                           */
  2463.               if (hwndDDEClient != (HWND)mp1)
  2464.                                   break;
  2465.               hwndDDEClient = NULL;        /* indicate that session is over */
  2466.                                            /* agree on termination */
  2467.               WinDdePostMsg((HWND)mp1, hwnd, WM_DDE_TERMINATE, NULL, TRUE);
  2468.               fConnected = FALSE;
  2469.               break;
  2470.  
  2471.       If the user terminates the Edit session while the link is still active
  2472.       the Editor must send the WorkFrame a message.
  2473.  
  2474.  
  2475.             case  WM_CLOSE :
  2476.               if (fConnected)
  2477.                 WinDdePostMsg(hwndDDEClient, hwnd, WM_DDE_TERMINATE, NULL,
  2478.                    TRUE);
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.                                          WorkFrame Interfaces to the Editor  35
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.   LANGUAGE PROFILE
  2528.   ________________
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.   The WorkFrame provides a utility for the general user or the Compiler devel-
  2535.   oper to build or change a language profile.
  2536.  
  2537.   The kind of information required is illustrated in -- Fig 'FIG4' unknown --
  2538.   and is as follows:
  2539.  
  2540.   o   File Name
  2541.  
  2542.       The name entered will have the extension .PRF appended to it and should
  2543.       be placed in the WorkFrame home directory. This name must be unique. It
  2544.       is recommended that the filename being used is identical to the Language
  2545.       Eyecatcher which must be unique as well.
  2546.  
  2547.   o   Language Name
  2548.  
  2549.       Any string you wish to use to represent the name of the language profile
  2550.       in WorkFrame pulldowns and messages, for example.
  2551.  
  2552.         IBM C/32 V1.0
  2553.  
  2554.   o   Language Eyecatcher
  2555.  
  2556.       A unique 8 character string to internally identify the language.  This
  2557.       string is stored along with project options in the project control files.
  2558.       This ensures that options are not passed to a language DLL by which they
  2559.       were not created, If the eyecatcher is less than 8 characters it should
  2560.       be padded with trailing spaces.
  2561.  
  2562.       The Workbench project office is responsible for assigning eyecatchers to
  2563.       participating compilers. All eyecatchers beginning with "IBM" are
  2564.       reserved for IBM languages.  For example,
  2565.  
  2566.         "IBMC32  "
  2567.  
  2568.   o   Language Extension
  2569.  
  2570.       This field identifies how the WorkFrame is to identify source files for
  2571.       this compiler.  It must be of the form ".ext" where ext is the file
  2572.       extension by which source file can be identified.  Multiple masks can be
  2573.       specified if the compiler accepts multiple extension types.  In this case
  2574.       the masks must be separated by a blank.  For example.
  2575.  
  2576.  
  2577.            ".c .cpp .cv1"
  2578.  
  2579.  
  2580.        Some extensions and characters are illegal.  The following shows the
  2581.       list of illegal extensions and characters:
  2582.  
  2583.  
  2584.                                                            Language Profile  36
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.       Illegal Extensions:
  2595.  
  2596.             "DEF"  "DEP"  "DLL" "EXE"  "HLP"  "IPF"
  2597.             "LIB"  "MAK"  "MSG" "OBJ"  "RES"  "TXT"
  2598.             "RC"
  2599.  
  2600.       Illegal Characters:
  2601.  
  2602.  
  2603.             <  > \  / *
  2604.  
  2605.   o   Language compiler
  2606.  
  2607.       The name of the executable supplied for the compiler.  For example,
  2608.  
  2609.         CC.EXE
  2610.  
  2611.   o   Compiler Options DLL
  2612.  
  2613.       The name of the DLL supplied to acquire compiler options and invocation
  2614.       string. Enter the name without a .DLL extension.  For example,
  2615.  
  2616.         IBMSDEFL
  2617.  
  2618.   o   Language linker
  2619.  
  2620.       The name of the executable supplied for the linker.  For example,
  2621.  
  2622.         LINK386.EXE
  2623.  
  2624.   o   Linker Options DLL
  2625.  
  2626.       The name of the DLL supplied to acquire link options and invocation
  2627.       string. Enter the name without a .DLL extension.  For example,
  2628.  
  2629.         IBMSLINK
  2630.  
  2631.   o   Language maker
  2632.  
  2633.       The name of the executable supplied for the make utility.  For example,
  2634.  
  2635.         NMAKE.EXE
  2636.  
  2637.   o   Make Options DLL
  2638.  
  2639.       The name of the DLL supplied to acquire make options and invocation
  2640.       string. Enter the name without a .DLL extension.  For example,
  2641.  
  2642.         IBMSDEFL
  2643.  
  2644.   o   Language debugger
  2645.  
  2646.       The name of the executable supplied for the debugger.  For example,
  2647.  
  2648.  
  2649.  
  2650.                                                            Language Profile  37
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.         DEBUG.EXE
  2661.  
  2662.   o   Debug Options DLL
  2663.  
  2664.       The name of the DLL supplied to acquire debug options and invocation
  2665.       string. Enter the name without a .DLL extension.  For example,
  2666.  
  2667.         IBMSDEFL
  2668.  
  2669.   o   Default make string
  2670.  
  2671.       Default string to use, if the make options are not specified for a
  2672.       project. The shell supports the following tokens for substitution.
  2673.  
  2674.       -   %m - indicates that the current project's make file name should be
  2675.           substituted here.
  2676.  
  2677.       -   %o - indicates that the current project's executable name should be
  2678.           substituted here
  2679.  
  2680.   o   Default debug string
  2681.  
  2682.       Default string to use, if the debug options are not specified for a
  2683.       project. The shell supports the following tokens for substitution.
  2684.  
  2685.       -   %o - indicates that the current project's executable name should be
  2686.           substituted here
  2687.  
  2688.       -   %r - indicates that the current project's run options should be sub-
  2689.           stituted here.
  2690.  
  2691.   o   Max Compiler size
  2692.  
  2693.       Amount of storage to allocate to hold compiler options.
  2694.  
  2695.   o   Max Compiler string
  2696.  
  2697.       Amount of storage to allocate to hold compiler invocation string.
  2698.  
  2699.   o   Max Linker size
  2700.  
  2701.       Amount of storage to allocate to hold linker options.
  2702.  
  2703.   o   Max Linker string
  2704.  
  2705.       Amount of storage to allocate to hold linker invocation string.
  2706.  
  2707.   o   Debugger Program Type
  2708.  
  2709.       Select the mode that the Debugger should run in. The WorkFrame starts the
  2710.       debugger via DosStartSession and passes the this option to OS/2.
  2711.  
  2712.   o   Used Eyecatchers
  2713.  
  2714.  
  2715.  
  2716.                                                            Language Profile  38
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.       A list of eyecatchers defined for existing language profiles.
  2727.  
  2728.   o   Include search Path
  2729.  
  2730.       This string will be concatenated in front of the existing INCLUDE envi-
  2731.       ronment variable when invoking compile/make etc.
  2732.  
  2733.   o   Library search Path
  2734.  
  2735.       This string will be concatenated in front of the existing LIB environment
  2736.       variable when invoking link/make etc.
  2737.  
  2738.   -----------------------------------------------------------------------------
  2739.  
  2740.  
  2741.   -----------------------------------------------------------------------------
  2742.   Figure 6. Language Profile Maintenance Dialog
  2743.  
  2744.  
  2745.   -----------------------------------------------------------------------------
  2746.  
  2747.  
  2748.   -----------------------------------------------------------------------------
  2749.   Figure 7. Language Profile Environment Variables
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.                                                            Language Profile  39
  2783.