home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / iwftech.zip / headers / WKFOPT.H < prev    next >
Text File  |  1994-07-21  |  45KB  |  642 lines

  1. /****************************************************************************/
  2. /* Integration Kit for IBM* WorkFrame/2* Version 2.1                        */
  3. /*                                                                          */
  4. /* The integration kit contains an information reference and sample         */
  5. /* programs illustrating application programming interfaces to              */
  6. /* provide assistance with product integration into IBM's                   */
  7. /* WorkFrame/2 Version 2.1.                                                 */
  8. /*                                                                          */
  9. /* The information and sample programs are intended only for                */
  10. /* Version 2.1, and are not applicable to any other IBM product or          */
  11. /* product release.                                                         */
  12. /*                                                                          */
  13. /* The integration kit is provided as is, without any warranty of           */
  14. /* merchantibility of fitness for any particular purpose. The kit           */
  15. /* includes sample code. This code has not been tested, and IBM             */
  16. /* makes no representation of its workability or fitness on any             */
  17. /* system.                                                                  */
  18. /*                                                                          */
  19. /* You are permitted to make copies of the whole of this kit,               */
  20. /* including this notice screen. You are also permitted to copy the         */
  21. /* sample programs, and their source, contained in the kit for the          */
  22. /* purpose of running those programs on your system.                        */
  23. /*                                                                          */
  24. /* You may distribute copies of the whole of this kit, or only of the       */
  25. /* sample programs, in any country recognising the copyright of U.S.        */
  26. /* nationals. Any copies distributed by you must include a copy of          */
  27. /* this notice screen.                                                      */
  28. /*                                                                          */
  29. /* IBM will attempt to make future releases of the WorkFrame/2              */
  30. /* product compatible, but cannot guarantee upward compatibility.           */
  31. /*                                                                          */
  32. /* COPYRIGHT: IBM WorkFrame/2 Version 2.1                                   */
  33. /*            (C) COPYRIGHT IBM CORP 1990, 1991, 1992, 1993, 1994           */
  34. /*            LICENSED MATERIALS - PROPERTY OF IBM                          */
  35. /*            REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083         */
  36. /*                                                                          */
  37. /* ------------------------------------------------------------------------ */
  38. /*                                                                          */
  39. /* MODULE:    WKFOPT.H - Option Support DLL interfaces                      */
  40. /*                                                                          */
  41. /****************************************************************************/
  42.  
  43. #ifndef _WKFOPT_H_
  44.    #define _WKFOPT_H_
  45.  
  46.    /* --------------------------------------------------------------------- */
  47.    /* Version 1 API names for external tools support                        */
  48.    /* --------------------------------------------------------------------- */
  49.    #define WKF_ACTV1_COMPFUNCTIONNAME     "GETCOMPILEOPTS"
  50.    #define WKF_ACTV1_LINKFUNCTIONNAME     "GETLINKOPTS"
  51.    #define WKF_ACTV1_MAKEFUNCTIONNAME     "GETMAKEOPTS"
  52.    #define WKF_ACTV1_DEBUGFUNCTIONNAME    "GETDEBUGOPTS"
  53.  
  54.    /* --------------------------------------------------------------------- */
  55.    /* Version 1 API names for external compiler tools support               */
  56.    /* --------------------------------------------------------------------- */
  57.    #define WKF_ACTV1_PARSEFUNCTIONNAME    "PARSEERROR"
  58.    #define WKF_ACTV1_INCLUDEFUNCTIONNAME  "FINDINCLUDE"
  59.    #define WKF_ACTV1_FREEMEMFUNCTIONNAME  "FREEMEMORY"
  60.    #define WKF_ACTV1_QUERYHELPFILE        "QUERYHELPFILE"
  61.    #define WKF_ACTV1_QUERYRESOURCEID      "QUERYRESOURCEID"
  62.  
  63.    /* --------------------------------------------------------------------- */
  64.    /* Version 2 API names for external tools support                        */
  65.    /* --------------------------------------------------------------------- */
  66.    #define WKF_ACT_PREFIX                 "WKF"
  67.    #define WKF_ACT_PREFIX2                "QUERY"
  68.    #define WKF_ACT_OPTIONS                "OPTIONS"
  69.    #define WKF_ACT_TARGET                 "TARGET"
  70.    #define WKF_ACT_RESOURCEID             "RESOURCEID"
  71.    #define WKF_ACT_HELPFILE               "HELPFILE"
  72.    #define WKF_ACT_TERMINATE              "TERMINATE"
  73.    #define WKF_ACT_PARSEERROR             "PARSEERROR"
  74.  
  75.    /* --------------------------------------------------------------------- */
  76.    /* Version 2 dynamic API name masks for external tools support           */
  77.    /* --------------------------------------------------------------------- */
  78.    #define WKF_MASK_QUERYOPT              "WKFQUERY%sOPTIONS"
  79.    #define WKF_MASK_QUERYTARGET           "WKFQUERY%sTARGET"
  80.    #define WKF_MASK_RESOURCEID            "WKFQUERY%sRESOURCEID"
  81.    #define WKF_MASK_RESOURCEID2           "WKFQUERY%sRESOURCEID2"
  82.    #define WKF_MASK_HELPFILE              "WKFQUERY%sHELPFILE"
  83.    #define WKF_MASK_HELPFILE2             "WKFQUERY%sHELPFILE2"
  84.    #define WKF_MASK_TERMINATE             "WKF%sTERMINATE"
  85.    #define WKF_MASK_PARSEERROR            "WKF%sPARSEERROR"
  86.    #define WKF_MASK_QUERYDDE              "WKF%sQUERYDDE"
  87.  
  88.    /* ---------------------------------------------------------------------- */
  89.    /*                                                                        */
  90.    /* WKF_REALLOC -                                                          */
  91.    /*                                                                        */
  92.    /* Pointer to a callback function which reallocates the buffer passed in. */
  93.    /* If successful, returns a pointer to the new buffer else it returns     */
  94.    /* NULL.                                                                  */
  95.    /* ---------------------------------------------------------------------- */
  96.    typedef PVOID APIENTRY WKF_REALLOC( PVOID pvBuffer, ULONG ulNewSize );
  97.    typedef WKF_REALLOC * PWKF_REALLOC;
  98.  
  99.  
  100.  
  101.    /* ---------------------------------------------------------------------- */
  102.    /*                                                                        */
  103.    /* WKF_PRT_STATUS -                                                       */
  104.    /*                                                                        */
  105.    /* Pointer to a callback function which prints a status message and       */
  106.    /* returns. Use when processing takes some time to complete. Pass only    */
  107.    /* a simple text string -- no formatting will be done.                    */
  108.    /*                                                                        */
  109.    /* ---------------------------------------------------------------------- */
  110.    typedef VOID APIENTRY WKF_PRT_STATUS( PSZ pszStatusMsg );
  111.    typedef WKF_PRT_STATUS * PWKF_PRT_STATUS;
  112.  
  113.  
  114.  
  115.    /* ---------------------------------------------------------------------- */
  116.    /*                                                                        */
  117.    /* WkfQuery...Options -                                                   */
  118.    /*                                                                        */
  119.    /*       The actual entry point called will be named as above, with the   */
  120.    /*       elipsis replaced by the tool class name, and the entire name     */
  121.    /*       upper cased.  For example, when WorkFrame/2 needs to call this   */
  122.    /*       function for a compiler, it will call WKFQUERYCOMPILEOPTIONS().  */
  123.    /*       Any spaces in the class name will be converted to underscores.   */
  124.    /*                                                                        */
  125.    /* Optionally display a dialog and return the user selected options to    */
  126.    /* be saved with the project file.                                        */
  127.    /*                                                                        */
  128.    /* If the pvOptions buffer is too small, then call pWkf_Realloc           */
  129.    /* functions with the pvOptions buffer and the new buffer size required.  */
  130.    /*                                                                        */
  131.    /* ---------------------------------------------------------------------- */
  132.    /*                                                                        */
  133.    /* rc = 0  no errors save file                                            */
  134.    /*      1  no errors don't save file                                      */
  135.    /*      2  CANCEL pressed                                                 */
  136.    /*      8  ERROR (DLL displayed an error message)                         */
  137.    /*                                                                        */
  138.    /* ---------------------------------------------------------------------- */
  139.    /*                                                                        */
  140.    /* Parameters:  Passed to DLL (Input)I/O(Output) Returned from DLL        */
  141.    /*                                                                        */
  142.    /*      HWND         hwndWorkFrame   -  I/   WF/2 frame handle            */
  143.    /*                                           else HWND_DESKTOP if frame   */
  144.    /*                                           handle is not available      */
  145.    /*      HMODULE      hModHandle      -  I/   DLL module handle            */
  146.    /*      PSZ          pszProject      -  I/   project file name            */
  147.    /*      PSZ          pszTitle        -  I/   title to display             */
  148.    /*      PWKF_ACTION  pwkfAction      -  I/   pointer to action structure  */
  149.    /*      ULONG        ulSetting       -  I/   0x01 if default to be used   */
  150.    /*      PULONG       pulOptionsLength-  I/O  initial buffer size (bytes)  */
  151.    /*                                           on exit contains the actual  */
  152.    /*                                           bytes of data                */
  153.    /*      PVOID        pvOptions       -  I/O  options buffer               */
  154.    /*      PWKF_REALLOC pWkf_Realloc    -  I/   realloc function             */
  155.    /*      BOOL         bFileScope      -  I/   TRUE if invoked for file     */
  156.    /*                                           file scoped actions          */
  157.    /* ---------------------------------------------------------------------- */
  158.  
  159.    #define WKF_NOERROR    0
  160.    #define WKF_DONTSAVE   1
  161.    #define WKF_CANCEL     2
  162.    #define WKF_ERROR      8
  163.  
  164.    #define WKF_QO_SETTING_USE_OPTIONS  0x00
  165.    #define WKF_QO_SETTING_USE_DEFAULT  0x01
  166.  
  167.    typedef ULONG APIENTRY WKF_QUERY_OPTIONS( HWND          hwndWorkFrame,
  168.                                              HMODULE       hModHandle,
  169.                                              PSZ           pszProject,
  170.                                              PSZ           pszTitle,
  171.                                              PWKF_ACTION   pwkfAction,
  172.                                              ULONG         ulSetting,
  173.                                              PULONG        pulOptionsLength,
  174.                                              PVOID         pvOptions,
  175.                                              PWKF_REALLOC  pWkf_Realloc,
  176.                                              BOOL          bFileScope );
  177.    typedef WKF_QUERY_OPTIONS * PWKF_QUERY_OPTIONS;
  178.  
  179.  
  180.  
  181.    /* ---------------------------------------------------------------------- */
  182.    /*                                                                        */
  183.    /* WkfQuery...Target -                                                    */
  184.    /*                                                                        */
  185.    /*       The actual entry point called will be named as above, with the   */
  186.    /*       elipsis replaced by the tool class name, and the entire name     */
  187.    /*       upper cased.  For example, when WorkFrame/2 needs to call this   */
  188.    /*       function for a compiler, it will call WKFQUERYCOMPILETARGET().   */
  189.    /*       Any spaces in the class name will be converted to underscores.   */
  190.    /*                                                                        */
  191.    /* Given a list of valid source files selected by the user, and options   */
  192.    /* set by the user, return the following:                                 */
  193.    /*                                                                        */
  194.    /*    1. the command line parameters to be used by this action            */
  195.    /*    2. from the list of input files, mark those which will be utilized  */
  196.    /*       by this action, and those which should be discarded              */
  197.    /*    3. if the target objects list pointer is not NULL, then return a    */
  198.    /*       list of output files generated by this action.  Note: This list  */
  199.    /*       should only include files created by a single invocation of the  */
  200.    /*       action. For example, a LINK action may create .EXE and .MAP      */
  201.    /*       files.                                                           */
  202.    /*    4. if the dependency objects list pointer is not NULL, then return  */
  203.    /*       a list of files which the action of building the TARGET file     */
  204.    /*       depends on (excluding those marked in the list of source files). */
  205.    /*       This list should be complete -- files returned will not be       */
  206.    /*       parsed further by WorkFrame for nested includes.                 */
  207.    /*                                                                        */
  208.    /* NOTE: a) *ppvToolBuffer is a pvoid pointer which can be used by the    */
  209.    /*          called DLL entry to store tool class and tool name specific   */
  210.    /*          information across subsequent calls.  For instance,           */
  211.    /*          information about imbedded dependency files can be saved      */
  212.    /*          so that they would not have to be re-created on each call.    */
  213.    /*          Subsequent calls to this function for the same tool class and */
  214.    /*          name will be passed this value.  If at the end of this        */
  215.    /*          process (e.g. creating make files), the pointer is not NULL,  */
  216.    /*          the function WkfTerminate  will be called to cleanup the      */
  217.    /*          memory used.                                                  */
  218.    /*                                                                        */
  219.    /*       b) cBuffer in both the list of target objects and dependency     */
  220.    /*          objects list must have the form:                              */
  221.    /*                                                                        */
  222.    /*               (filename_1)(filename_2)...(filename_n)\0                */
  223.    /*                                                                        */
  224.    /*          where each filename_x is a null delimited string              */
  225.    /*                                                                        */
  226.    /*       c) ulBufferSize is the number bytes actually allocated to        */
  227.    /*          cBuffer only.                                                 */
  228.    /*                                                                        */
  229.    /*       d) If any one of the output buffers are too small, then call     */
  230.    /*          pWkf_Realloc function  with the field to be adjusted and the  */
  231.    /*          new buffer size required in bytes.                            */
  232.    /*                                                                        */
  233.    /*          The field to be adjust must be one of the following:          */
  234.    /*                                                                        */
  235.    /*             WKF_REALLOC_TARGET                                         */
  236.    /*             WKF_REALLOC_DEPEND                                         */
  237.    /*             WKF_REALLOC_CMDLINE                                        */
  238.    /*                                                                        */
  239.    /*          For the target and depend fields, you do not need to account  */
  240.    /*          for the 2 ULONG fields.  The bytes required should be for     */
  241.    /*          the buffer itself only.                                       */
  242.    /*                                                                        */
  243.    /*       e) If processing takes a significant period of time, the         */
  244.    /*          WKF_PRT_STATUS function should be called periodically to      */
  245.    /*          provide ongoing status information to the user.  If           */
  246.    /*          processing time is very small, use of this function is not    */
  247.    /*          necessary.  Do not use this to report errors - the message    */
  248.    /*          displayed will be temporary.exit                              */
  249.    /*                                                                        */
  250.    /*       f) The CmdLine returned can contain several special characters.  */
  251.    /*          These provide extra flexability where necessary, but in       */
  252.    /*          general should be avoided if possible.                        */
  253.    /*                                                                        */
  254.    /*            WKF_CMDLINE_EXECUTE    - The string returned is normally    */
  255.    /*                                     taken as the parameters of the     */
  256.    /*                                     command to be executed.  If the    */
  257.    /*                                     first characters of the string are */
  258.    /*                                     WKF_CMDLINE_EXECUTE, then the next */
  259.    /*                                     word represents the command to     */
  260.    /*                                     execute, and the rest of the       */
  261.    /*                                     string represents the parameters   */
  262.    /*                                     to be used.  This allows a command */
  263.    /*                                     other than what the user entered   */
  264.    /*                                     in the actions profile to be       */
  265.    /*                                     executed.                          */
  266.    /*                                                                        */
  267.    /*            WKF_CMDLINE_INLINEFILE - WKF_CMDLINE_INLINEFILE must always */
  268.    /*                                     be included in the command string  */
  269.    /*                                     in pairs.  The characters will be  */
  270.    /*                                     removed and replaced by a          */
  271.    /*                                     temporary filename, and all the    */
  272.    /*                                     characters in between will be      */
  273.    /*                                     placed in this file (verbatum - no */
  274.    /*                                     processing will be done on these   */
  275.    /*                                     characters).  The temp file will   */
  276.    /*                                     be deleted after the command has   */
  277.    /*                                     completed execution.  This can be  */
  278.    /*                                     used to execute a command via a    */
  279.    /*                                     response file, and should be used  */
  280.    /*                                     if the output length exceeds 1024  */
  281.    /*                                     characters (which is the most      */
  282.    /*                                     cmd.exe will accept, and thus the  */
  283.    /*                                     most that can be placed in a       */
  284.    /*                                     makefile)                          */
  285.    /*                                                                        */
  286.    /*            WKF_CMDLINE_NEXTCMD    - WKF_CMDLINE_NEXTCMD is used to     */
  287.    /*                                     indicate that multiple commands    */
  288.    /*                                     should be executed.  Unless other  */
  289.    /*                                     special characters are used, each  */
  290.    /*                                     "mini" command line between        */
  291.    /*                                     WKF_CMDLINE_NEXTCMD's will be      */
  292.    /*                                     interpreted exactly as normal -    */
  293.    /*                                     that is, as parameters to the      */
  294.    /*                                     command being executed.  Although  */
  295.    /*                                     the commands will be executed      */
  296.    /*                                     sequentially, they will be treated */
  297.    /*                                     as one command.  For example, the  */
  298.    /*                                     list of targets generated will     */
  299.    /*                                     apply to the command sequence,     */
  300.    /*                                     rather than any single command.    */
  301.    /*                                     This capability should only be     */
  302.    /*                                     used when no alternatives exist.   */
  303.    /*                                                                        */
  304.    /* ---------------------------------------------------------------------- */
  305.    /*                                                                        */
  306.    /* rc = 0  no error                                                       */
  307.    /*     !0  ERROR (DLL displayed an error message - abort processing)      */
  308.    /*                                                                        */
  309.    /* ---------------------------------------------------------------------- */
  310.    /* Parameters:   Passed to DLL (Input)I/O(Output) Returned from DLL       */
  311.    /*                                                                        */
  312.    /*      PVOID          * ppvToolBuffer    -  I/   Buffer created by the   */
  313.    /*                                                tool DLL                */
  314.    /*      HWND             hwndWorkFrame    -  I/   WF/2 frame handle       */
  315.    /*                                                else HWND_DESKTOP if    */
  316.    /*                                                frame handle is not     */
  317.    /*                                                available               */
  318.    /*      HMODULE          hModHandle       -  I/   DLL module handle       */
  319.    /*      PSZ              pszProject       -  I/   project file name       */
  320.    /*      PSZ              pszTitle         -  I/   project title           */
  321.    /*      PWKF_ACTION      pwkfAction       -  I/   pointer to action struct*/
  322.    /*      ULONG            ulOptionsLength  -  I/   options buffer size in  */
  323.    /*                                                bytes                   */
  324.    /*      PVOID            pvOptions        -  I/   options buffer          */
  325.    /*      ULONG            ulCmdLineLength  -  I/   initial size of CmdLine */
  326.    /*                                                buffer                  */
  327.    /*      PSZ              pszCmdLine       -   /O  output command line     */
  328.    /*      ULONG            ulSearchPath     -  I/   initial size of         */
  329.    /*                                                SearchPath buffer       */
  330.    /*      PSZ              pszSearchPath    -  I/O  address of the buffer   */
  331.    /*                                                containing the search   */
  332.    /*                                                path                    */
  333.    /*      LIST_OF_SOURCE  *pstSourceObjects -  I/O  list of selected source */
  334.    /*                                                files                   */
  335.    /*      LIST_OF_TARGET  *pstTargetObjects -  I/   first entry contains    */
  336.    /*                                                a new line delimited    */
  337.    /*                                                string containing the   */
  338.    /*                                                list of valid target    */
  339.    /*                                                file masks (read from   */
  340.    /*                                                the Actions Profile)    */
  341.    /*                                            /O  list of output files    */
  342.    /*      LIST_OF_DEPEND  *pstDependObjects -   /O  list of dependencies    */
  343.    /*      PWKF_REALLOC     pWkf_Realloc     -  I/   realloc function        */
  344.    /*      PWKF_PRT_STATUS  pWkf_PrtStatus   -  I/   print status function   */
  345.    /*      BOOL             bFileScope       -  I/   TRUE if invoked for file*/
  346.    /*                                                file scoped actions     */
  347.    /*                                                                        */
  348.    /* ---------------------------------------------------------------------- */
  349.  
  350.    /* the following are the possible flags for the fUsed field of            */
  351.    /* SOURCE_ENTRY                                                           */
  352.    #define WKF_QT_FILE_NOTUSED 0   /* file not processed                     */
  353.    #define WKF_QT_FILE_USED    1   /* file processed and required for command*/
  354.    #define WKF_QT_FILE_DISCARD 2   /* file processed and to be discarded     */
  355.  
  356.    #define WKF_CMDLINE_EXECUTE    "\xFF\x01"
  357.    #define WKF_CMDLINE_INLINEFILE "\xFF\x02"
  358.    #define WKF_CMDLINE_NEXTCMD    "\xFF\x03"
  359.  
  360.    typedef _Packed struct _SOURCE_ENTRY       /* single source file entry    */
  361.            {
  362.            ULONG  fUsed;                      /* file used flag              */
  363.            PSZ    pszFileName;                /* pointer to filename string  */
  364.            } SOURCE_ENTRY, *pSOURCE_ENTRY;
  365.  
  366.    typedef _Packed struct _LIST_OF_SOURCE     /* source files list structure */
  367.            {
  368.            ULONG         ulNumOfEntries;      /* number of selected files    */
  369.            ULONG         ulNumUsed;           /* number of files used        */
  370.            SOURCE_ENTRY  stObject[1];         /* array of source structures  */
  371.            } LIST_OF_SOURCE, *pLIST_OF_SOURCE;
  372.  
  373.    typedef _Packed struct _LIST_OF_TARGET     /* target files list structure */
  374.            {
  375.            ULONG ulNumOfEntries;              /* number of entries in the buf*/
  376.            ULONG ulBufferSize;                /* size of cBuffer             */
  377.            char  cBuffer[1];                  /* list of files produced      */
  378.            } LIST_OF_TARGET, *pLIST_OF_TARGET;
  379.  
  380.    typedef _Packed struct _LIST_OF_DEPEND     /* dependency files list struc */
  381.            {
  382.            ULONG ulNumOfEntries;              /* number of entries in the buf*/
  383.            ULONG ulBufferSize;                /* size of cBuffer             */
  384.            char  cBuffer[1];                  /* list of dependency files    */
  385.            } LIST_OF_DEPEND, *pLIST_OF_DEPEND;
  386.  
  387.  
  388.    typedef APIRET APIENTRY WKF_QUERY_TARGET( PVOID           *ppvToolBuffer,
  389.                                              HWND             hwndWorkFrame,
  390.                                              HMODULE          hModHandle,
  391.                                              PSZ              pszProject,
  392.                                              PSZ              pszTitle,
  393.                                              PWKF_ACTION      pwkfAction,
  394.                                              ULONG            ulOptionsLength,
  395.                                              VOID            *pvOptions,
  396.                                              ULONG            ulCmdLineLength,
  397.                                              PSZ              pszCmdLine,
  398.                                              ULONG            ulSearchPath,
  399.                                              PSZ              pszSearchPath,
  400.                                              LIST_OF_SOURCE  *pstSourceObjects,
  401.                                              LIST_OF_TARGET  *pstTargetObjects,
  402.                                              LIST_OF_DEPEND  *pstDependObjects,
  403.                                              WKF_REALLOC     *pWkf_Realloc,
  404.                                              WKF_PRT_STATUS  *pWkf_PrtStatus,
  405.                                              BOOL             bFileScope );
  406.    typedef WKF_QUERY_TARGET * PWKF_QUERY_TARGET;
  407.  
  408.  
  409.    /* ---------------------------------------------------------------------- */
  410.    /*                                                                        */
  411.    /* WKF...TERMINATE                                                        */
  412.    /*                                                                        */
  413.    /* If on a call to WkfQuery...Target function *ppvToolBuffer was set      */
  414.    /* to a non-NULL value, at the end of the process (e.g. creating make     */
  415.    /* files), this function will be called with the saved pointer value.     */
  416.    /* This function is expected to free any memory it has allocated and/or   */
  417.    /* display any saved error/warning messages.  Note that error messages    */
  418.    /* should only be displayed if the fDisplayMessages flag is set.  Any     */
  419.    /* aloocated memory should always be freed.                               */
  420.    /*                                                                        */
  421.    /* ---------------------------------------------------------------------- */
  422.    /*                                                                        */
  423.    /* Parameters:      Passed to DLL (Input)I/O(Output) Returned from DLL    */
  424.    /*                                                                        */
  425.    /*      PVOID        pvToolBuffer     -  I/   Buffer created by tool DLL  */
  426.    /*      BOOL         fDisplayMessages -  I/   Should msgs be displayed?   */
  427.    /*      HWND         hwndWorkFrame    -  I/   WF/2 frame handle           */
  428.    /*                                            else HWND_DESKTOP if        */
  429.    /*                                            frame handle is not         */
  430.    /*                                            available                   */
  431.    /*      HMODULE      hModHandle       -  I/   DLL module handle           */
  432.    /*      PSZ          pszTitle         -  I/   project title               */
  433.    /*      PWKF_ACTION  pwkfAction       -  I/   pointer to action struct    */
  434.    /*                                                                        */
  435.    /* Returns:                                                               */
  436.    /*                                                                        */
  437.    /* rc = 0  no error                                                       */
  438.    /*     !0  ERROR (DLL displayed an error message - abort processing)      */
  439.    /*                                                                        */
  440.    /* ---------------------------------------------------------------------- */
  441.  
  442.    typedef APIRET APIENTRY WKF_TERMINATE( PVOID        pvToolBuffer,
  443.                                           BOOL         fDisplayMessages,
  444.                                           HWND         hwndWorkFrame,
  445.                                           HMODULE      hModHandle,
  446.                                           PSZ          pszTitle,
  447.                                           PWKF_ACTION  pwkfAction );
  448.    typedef WKF_TERMINATE * PWKF_TERMINATE;
  449.  
  450.  
  451.  
  452.  
  453.    /* ---------------------------------------------------------------------- */
  454.    /*                                                                        */
  455.    /* Wkf...ParseError                                                       */
  456.    /*                                                                        */
  457.    /*       The actual entry point called will be named as above, with the   */
  458.    /*       elipsis replaced by the tool class name, and the entire name     */
  459.    /*       upper cased.  For example, when WorkFrame/2 needs to call this   */
  460.    /*       function for a compiler, it will call WKFCOMPILEPARSEERROR().    */
  461.    /*       Any spaces in the class name will be converted to underscores.   */
  462.    /*                                                                        */
  463.    /* This entry point in the tool DLL is invoked during processing of the   */
  464.    /* error messages output from the tool.  The interface is provided with   */
  465.    /* a line of output from the tool and is expected to return the filename, */
  466.    /* line number, and column number associated with the error message on    */
  467.    /* that line.                                                             */
  468.    /*                                                                        */
  469.    /* ---------------------------------------------------------------------- */
  470.    /*                                                                        */
  471.    /* rc = 0  no error                                                       */
  472.    /*      1  error                                                          */
  473.    /*      2  line invalid or not recognized                                 */
  474.    /*                                                                        */
  475.    /* ---------------------------------------------------------------------- */
  476.    /*                                                                        */
  477.    /* Parameters:  Passed to DLL (Input)I/O(Output) Returned from DLL        */
  478.    /*                                                                        */
  479.    /*      HWND         hwndErrorBox    -  I/   window handle of the error   */
  480.    /*                                           message listbox              */
  481.    /*      PSZ          pszProject      -  I/   project file name            */
  482.    /*      PUSHORT      pusStartLine    -   /O  pointer to first line        */
  483.    /*                                           containing an error message  */
  484.    /*                                           in listbox                   */
  485.    /*      PUSHORT      pusEndLine      -   /O  pointer to last line         */
  486.    /*                                           containing an error message  */
  487.    /*      HWND         hwndFilenames   -  I/   window handle of listbox to  */
  488.    /*                                           insert filenames into        */
  489.    /*      PUSHORT      pusCurrentFile  -   /O  index of selected filename in*/
  490.    /*                                           filename listbox             */
  491.    /*      PVOID        pvOptions       -  I/   pointer to area containing   */
  492.    /*                                           compiler options             */
  493.    /*      PULONG       pulSetting      -  I/   validity of options          */
  494.    /*                                           (initialized or not)         */
  495.    /*                                                                        */
  496.    /* ---------------------------------------------------------------------- */
  497.  
  498.    #define WKFRC_PARSEERROR_SUCCESS  0
  499.    #define WKFRC_PARSEERROR_ERROR    1
  500.    #define WKFRC_PARSEERROR_INVALID  2
  501.  
  502.    #define WKF_SETTING_USE_OPTIONS  0x00
  503.    #define WKF_SETTING_USE_DEFAULT  0x01
  504.  
  505.    typedef ULONG APIENTRY WKF_PARSEERROR( HWND    hwndErrorBox,
  506.                                           PSZ     pszProject,
  507.                                           PUSHORT pusStartLine,
  508.                                           PUSHORT pusEndLine,
  509.                                           HWND    hwndFilenames,
  510.                                           PUSHORT pusCurrentFile,
  511.                                           PVOID   pvOptions,
  512.                                           PULONG  pulSetting );
  513.    typedef WKF_PARSEERROR * PWKF_PARSEERROR;
  514.  
  515.  
  516.    typedef  union  _WKF_TAGPARAM
  517.             {
  518.             unsigned long  tagParam ;
  519.             struct {
  520.                    USHORT           errorLine  ;
  521.                    unsigned char    offset ;
  522.                    char             fileNumber ;
  523.                    } sub  ;
  524.             } WKF_TAGPARAM;
  525.  
  526.  
  527.  
  528.  
  529.    /* ---------------------------------------------------------------------- */
  530.    /*                                                                        */
  531.    /* WkfQuery...HelpFile                                                    */
  532.    /*                                                                        */
  533.    /*       The actual entry point called will be named as above, with the   */
  534.    /*       ellipsis replaced by the tool class name, and the entire name    */
  535.    /*       upper cased.  For example, when WorkFrame/2 needs to call this   */
  536.    /*       function for a compiler, it will call WKFQUERYCOMPILEHELPFILE(). */
  537.    /*       Any spaces in the class name will be converted to underscores.   */
  538.    /*                                                                        */
  539.    /*                                                                        */
  540.    /*  This interface obtains the error message help file. The WorkFrame/2   */
  541.    /*  will invoke this interface after invoking the DLL to parse the error  */
  542.    /*  message.  The interface is expected to place the string representing  */
  543.    /*  the IPF .HLP file in the area provided and return TRUE (1) if help    */
  544.    /*  is supported.  Returning FALSE (0) indicates that error message help  */
  545.    /*  is not supported.                                                     */
  546.    /*                                                                        */
  547.    /* ---------------------------------------------------------------------- */
  548.    /*                                                                        */
  549.    /* rc = FALSE   no help file support                                      */
  550.    /*      TRUE    help file returned in pszHelpFile                         */
  551.    /*                                                                        */
  552.    /* ---------------------------------------------------------------------- */
  553.    /*                                                                        */
  554.    /* Parameters:  Passed to DLL (Input)I/O(Output) Returned from DLL        */
  555.    /*                                                                        */
  556.    /*      HWND         hwndErrorBox    -  I/   Window handle of error       */
  557.    /*                                           message listbox              */
  558.    /*      PSZ          pszProject      -  I/   Name of project file         */
  559.    /*      PSZ          pszHelpFile     -   /O  IPF help (.HLP) file name    */
  560.    /*                                                                        */
  561.    /* ---------------------------------------------------------------------- */
  562.  
  563.    typedef BOOL APIENTRY WKF_QUERYHELPFILE(PSZ pszHelpFile);
  564.    typedef WKF_QUERYHELPFILE * PWKF_QUERYHELPFILE;
  565.  
  566.    typedef ULONG APIENTRY WKF_QUERYHELPFILE2( HWND    hwndErrorBox,
  567.                                               PSZ     pszProject,
  568.                                               PSZ     pszHelpFile);
  569.    typedef WKF_QUERYHELPFILE2 * PWKF_QUERYHELPFILE2;
  570.  
  571.  
  572.  
  573.    /* ---------------------------------------------------------------------- */
  574.    /*                                                                        */
  575.    /* WkfQuery...ResourceID                                                  */
  576.    /*                                                                        */
  577.    /*      The actual entry point called will be named as above, with the    */
  578.    /*      ellipsis replaced by the tool class name, and the entire name     */
  579.    /*      upper cased.  For example, when WorkFrame/2 needs to call this    */
  580.    /*      function for a compiler, it will call WKFQUERYCOMPILERESOURCEID().*/
  581.    /*      Any spaces in the class name will be converted to underscores.    */
  582.    /*                                                                        */
  583.    /*  This interface is invoked whenever a resource id corresponding to a   */
  584.    /*  particular error message is required.  The function must parse the    */
  585.    /*  error message string and return the corresponding resource id within  */
  586.    /*  the help file (obtained through the WkfQuery...HelpFile).             */
  587.    /*  All resource ids must be greater than 20000 since values lower than   */
  588.    /*  that are reserved for use by the editor.                              */
  589.    /*                                                                        */
  590.    /* ---------------------------------------------------------------------- */
  591.    /*                                                                        */
  592.    /* Returns:                                                               */
  593.    /*                                                                        */
  594.    /* ULONG   0       no corresponding resource id                           */
  595.    /*         >20000  help file resource id for the error message passed     */
  596.    /*                                                                        */
  597.    /* ---------------------------------------------------------------------- */
  598.    /*                                                                        */
  599.    /* Parameters:  Passed to DLL (Input)I/O(Output) Returned from DLL        */
  600.    /*                                                                        */
  601.    /*      PSZ          pszErrorLine    -  I/   Error message for which help */
  602.    /*                                           was requested                */
  603.    /* ---------------------------------------------------------------------- */
  604.  
  605.    typedef ULONG APIENTRY WKF_QUERYRESOURCEID(PSZ pszErrorLine);
  606.    typedef WKF_QUERYRESOURCEID * PWKF_QUERYRESOURCEID;
  607.  
  608.    typedef ULONG APIENTRY WKF_QUERYRESOURCEID2( HWND    hwndErrorBox,
  609.                                                 PSZ     pszProject,
  610.                                                 PSZ     pszErrorLine);
  611.    typedef WKF_QUERYRESOURCEID2 * PWKF_QUERYRESOURCEID2;
  612.  
  613.    /* ---------------------------------------------------------------------- */
  614.    /*                                                                        */
  615.    /* WkfQuery...DDE                                                         */
  616.    /*                                                                        */
  617.    /*  This interface is invoked to determine if a DDE session can be started*/
  618.    /*  with a tool.  Currently this interface is supported only for EDIT     */
  619.    /*  class tools. DDE sessions will be started with editors by the         */
  620.    /*  WorkFrame/2 monitor when a file is selected for editing by selecting  */
  621.    /*  an error message.                                                     */
  622.    /*                                                                        */
  623.    /* ---------------------------------------------------------------------- */
  624.    /*                                                                        */
  625.    /* Returns:                                                               */
  626.    /*                                                                        */
  627.    /*  BOOL                                                                  */
  628.    /*                                                                        */
  629.    /* ---------------------------------------------------------------------- */
  630.    /*                                                                        */
  631.    /*                                                                        */
  632.    /* Parameters:  Passed to DLL (Input)I/O(Output) Returned from DLL        */
  633.    /*                                                                        */
  634.    /*      VOID                                                              */
  635.    /*                                                                        */
  636.    /* ---------------------------------------------------------------------- */
  637.  
  638.    typedef BOOL APIENTRY WKF_QUERYDDE( PVOID pvOptions );
  639.    typedef WKF_QUERYDDE * PWKF_QUERYDDE;
  640.  
  641. #endif
  642.