home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / wf_expl / ibmccomp.c < prev    next >
C/C++ Source or Header  |  1992-05-05  |  101KB  |  3,030 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /* COPYRIGHT IBM CORP., 1992                                                */
  4. /*                                                                          */
  5. /****************************************************************************/
  6. #define INCL_DOSDEVICES
  7. #define INCL_DOSMISC
  8. #define INCL_ERRORS
  9. #define INCL_WINHELP
  10. #define INCL_DOSFILEMGR
  11. #define INCL_WIN
  12. #define INCL_GPI
  13. #define INCL_NLS
  14. #include <os2.h>
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17. #include <string.h>
  18. #include "IBMCCOMP.H"
  19.  
  20. BOOL OptActive;
  21. BOOL CGenActive;
  22. BOOL CtlActive;
  23. BOOL PrepActive;
  24. BOOL OutfActive;
  25. BOOL ListActive;
  26. BOOL SctlActive;
  27. HAB   hab;                              /* anchor block handle          */
  28. HWND  handleWise;
  29. HMODULE handleDLL;
  30. RECTL parent;
  31. RECTL child;
  32. RECTL tb;
  33.  
  34. /* The following variables are used to define the state of the options */
  35.  
  36. static ULONG * complen;
  37. static ULONG outlen;
  38. static COMPOPTIONS * ivs;
  39. static PSZ outstring;
  40. static PSZ saveFilename;
  41. /* Used by Optimization Dialog */
  42. static HWND hwndOptAll, hwndOptNone,hwndOptions[9];
  43. static BOOL Optall,OptNone,OptOptions[9];
  44.  
  45. /* Used By Code Gen (and storage customization) Dialogs */
  46. static HWND hwndGenNstack;
  47. static BOOL GenPascal,GenPm,GenNstack,GenConst,Genthresh;
  48. static char Genthreshamount[10];
  49. static short GenModelix,GenFloatix,GenCustCodeix,GenCustDataix,GenCustSegmix;
  50.  
  51. /* Used by Control Dialog */
  52. static short CtlObjTypeix;
  53. static BOOL CtlDebNone,CtlDebSym,CtlDebLine, CtlDefLib;
  54. static HWND hwndDebNone,hwndDebSym,hwndDebLine;
  55. static char CtlNameLen[4],CtlVersion[256],CtlDataSeg[41],CtlCodeSeg[41];
  56. static BOOL CtlUseB1;
  57.  
  58. /* Used by Preprocessor Dialog */
  59.  
  60. static BOOL boolLstFile, boolListSOWL, boolListSONL,boolPrepComment,boolPrepExclude;
  61. static BOOL boolPrepUndAll;
  62. static char PrepIncludeDir[15][260];
  63. static int    PrepInclCount;
  64. static int    PrepDefCount;
  65. static int    PrepUnDefCount;
  66. static char PrepDefines[15][260];
  67. static char PrepUndefines[5][260];
  68.  
  69. /* used by Outfile Dialog */
  70.  
  71. static BOOL OutSrcList, OutMap, OutObjList, OutAsmList, OutComList;
  72. static char OutSrcName[260],OutExeName[260],OutObjName[260],OutMapName[260],OutObjFname[260];
  73.  
  74. /* Used by Listing Dialog */
  75. static short LstWarnix;
  76. static char LstLine[4];
  77. static char LstPage[4];
  78. static char LstTitle[100];
  79. static char LstSubTitle[100];
  80.  
  81. /* Used by Source Control Dialog */
  82.  
  83. BOOL SctlDext, SctlSyntax, SctlDecl, SctlConly, SctlJ, SctlCaseI;
  84. short SctlPackix;
  85.  
  86. ULONG  * SaveAction;
  87.  
  88. LONG returncode;
  89.  
  90. LONG APIENTRY GETCOMPILEOPTS(HWND hWise,PVOID Parms, ULONG *MaxParml, PSZ PgmName, PSZ Outstring, ULONG Outlen,HMODULE hModHandle, PSZ Profile, PSZ File, ULONG * Action);
  91. MRESULT EXPENTRY MAINPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2);
  92. MRESULT EXPENTRY OPTPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2);
  93. MRESULT EXPENTRY GENPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2);
  94. MRESULT EXPENTRY GENCUSTPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2);
  95. MRESULT EXPENTRY CTLPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2);
  96. MRESULT EXPENTRY PREPPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2);
  97. MRESULT EXPENTRY OUTFPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2);
  98. MRESULT EXPENTRY LISTPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2);
  99. MRESULT EXPENTRY SCTLPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2);
  100.  
  101. /* internal functions */
  102.  
  103. static void Disable_ALL_Checks(void);
  104. static void Enable_ALL_Checks(void) ;
  105. static void ReturnOutputString(void);
  106.  
  107. LONG APIENTRY GETCOMPILEOPTS(HWND hWise,PVOID Parms, ULONG *MaxParml, PSZ PgmName, PSZ Outstring, ULONG Outlen,HMODULE hModHandle, PSZ Profile, PSZ Filename, ULONG * Action)
  108. {
  109.    char * work;
  110.    char * work2;
  111.    int i;
  112.   handleWise = hWise;
  113.   handleDLL  = hModHandle;
  114.   saveFilename = Filename;
  115.   outstring= Outstring;
  116.   complen=MaxParml;
  117.   outlen = Outlen;
  118.  
  119.   returncode = SUCCESS;
  120.  
  121.      if ( *MaxParml < sizeof(COMPOPTIONS) )
  122.      {
  123.         char msg[100];
  124.  
  125.         WinLoadString ( HWND_DESKTOP, hModHandle, MSG_CMPOPTSMALL, 100, msg);
  126.  
  127.         WinMessageBox(  HWND_DESKTOP,
  128.                         hWise,
  129.                         msg,
  130.                         NULL,
  131.                         MSG_CMPOPTSMALL,
  132.                         MB_MOVEABLE | MB_OK | MB_ERROR |  MB_APPLMODAL);
  133.  
  134.          return ERRORCONDITION;
  135.      }
  136.  
  137. /*  WinQueryWindowRect(handleWise,&parent); */
  138.   WinQueryWindowRect(HWND_DESKTOP,&parent);
  139.      OptActive = FALSE;
  140.      CGenActive = FALSE;
  141.      CtlActive = FALSE;
  142.      PrepActive = FALSE;
  143.      OutfActive = FALSE;
  144.      ListActive = FALSE;
  145.      SctlActive = FALSE;
  146.  
  147.    ivs=(COMPOPTIONS *)Parms;
  148.  
  149.    if (*Action & USEDEFAULTS)
  150.    {
  151.      Optall=0;
  152.      OptNone=0;
  153.      OptOptions[0]=1;
  154.      for (i=1;i<9;i++)
  155.         OptOptions[i]=0;
  156.      GenPascal=GenPm=GenNstack=GenConst=Genthresh=0;
  157.      GenModelix=0;
  158.      GenFloatix=3;
  159.      GenCustCodeix=GenCustDataix=GenCustSegmix=0;
  160.      Genthreshamount[0]='\0';
  161.  
  162.      CtlObjTypeix=0;
  163.      CtlDefLib=0;
  164.      CtlUseB1=0;
  165.      CtlDebNone=1,
  166.      CtlDebSym=CtlDebLine=0;
  167.      strcpy(CtlNameLen,"31");
  168.      CtlVersion[0]=CtlDataSeg[0]=CtlCodeSeg[0]='\0';
  169.  
  170.      boolLstFile = 0;
  171.      boolListSOWL= 0;
  172.      boolListSONL= 0;
  173.      boolPrepComment= 0;
  174.      boolPrepExclude= 0;
  175.      boolPrepUndAll = 0;
  176.      PrepInclCount=0;
  177.      PrepDefCount =0;
  178.      PrepUnDefCount =0;
  179.  
  180.      OutSrcList=0;
  181.      OutMap  =0;
  182.      OutObjList=0;
  183.      OutAsmList=0;
  184.      OutComList=0;
  185.  
  186.      OutSrcName[0]=OutExeName[0]=OutObjName[0]=OutMapName[0]=OutObjFname[0]= '\0';
  187.  
  188.  
  189.      LstWarnix = 2;
  190.      LstLine[0]= LstPage[0]= LstTitle[0] = LstSubTitle[0] = '\0';
  191.  
  192.  
  193.      SctlDext=0;
  194.      SctlSyntax=0;
  195.      SctlDecl=0;
  196.      SctlConly=0;
  197.      SctlJ=0;
  198.      SctlCaseI=0;
  199.      SctlPackix=2;
  200.     }
  201.     else
  202.     {
  203.      Optall=ivs->optmax;
  204.      OptNone=ivs->optnone;
  205.      OptOptions[0]=ivs->optspeed    ;
  206.      OptOptions[1]=ivs->optloop     ;
  207.      OptOptions[2]=ivs->optprecise  ;
  208.      OptOptions[3]=ivs->optaliasfn  ;
  209.      OptOptions[4]=ivs->optspace    ;
  210.      OptOptions[5]=ivs->optialias   ;
  211.      OptOptions[6]=ivs->optintrins  ;
  212.      OptOptions[7]=ivs->optunsafe   ;
  213.      OptOptions[8]=ivs->optinliner  ;
  214.      GenPascal= ivs->PascalLink     ;
  215.      GenPm=     ivs->PMLink         ;
  216.      GenNstack= ivs->NoStackPrb     ;
  217.      GenConst=  ivs->StringinCs     ;
  218.      Genthresh= ivs->DataThresh     ;
  219.      GenModelix=ivs->MemoryModel    ;
  220.      GenFloatix=ivs->FloatOption    ;
  221.      GenCustCodeix=ivs->CustModelCode;
  222.      GenCustDataix=ivs->CustModelData;
  223.      GenCustSegmix=ivs->CustModelSetS;
  224.      if (ivs->DataThreshAmt==0)
  225.         Genthreshamount[0]='\0';
  226.      else
  227.         sprintf(Genthreshamount,"%d",ivs->DataThreshAmt);
  228.  
  229.      CtlObjTypeix=ivs->ObjectisExe;
  230.      CtlDefLib=ivs->RemoveDefLib;
  231.      CtlUseB1=ivs->UseB1;
  232.      CtlDebLine=ivs->DebLineNum;
  233.      CtlDebSym= ivs->DebSymDeb ;
  234.      if (ivs->DebLineNum==0 && ivs->DebSymDeb==0)
  235.        CtlDebNone=1;
  236.      else
  237.        CtlDebNone=0;
  238.      if (ivs->ExternNameLgth==0)
  239.        strcpy(CtlNameLen,"31");
  240.      else
  241.         sprintf(CtlNameLen,"%d",ivs->ExternNameLgth);
  242.      strcpy(CtlVersion,ivs->stringtablestart+ivs->VersionStringoff);
  243.      strcpy(CtlDataSeg,ivs->stringtablestart+ivs->DsegNameoff);
  244.      strcpy(CtlCodeSeg,ivs->stringtablestart+ivs->CsegNameoff);
  245.  
  246.      if (ivs->Prepoutput==1)
  247.         boolLstFile = 1;
  248.      else
  249.         boolLstFile = 0;
  250.      if (ivs->Prepoutput==2)
  251.         boolListSOWL= 1;
  252.      else
  253.         boolListSOWL= 0;
  254.      if (ivs->Prepoutput==3)
  255.         boolListSONL= 1;
  256.      else
  257.         boolListSONL= 0;
  258.      boolPrepComment= ivs->SaveComments;
  259.  
  260.      boolPrepExclude= ivs->ExcludeStd ;
  261.      boolPrepUndAll = ivs->UndefineAll;
  262.  
  263.      PrepInclCount= ivs->NumIncludePaths;
  264.  
  265.      work = ivs->stringtablestart+ivs->IncludePathoff;
  266.      for (i=0;i<PrepInclCount;i++)
  267.      {
  268.        work2=PrepIncludeDir[i];
  269.        while (*work != '\0')
  270.         {
  271.            *work2=*work;
  272.            ++work;
  273.            ++work2;
  274.         }
  275.  
  276.         *work2='\0';
  277.         strcat(work2,CRLF);
  278.         ++work ;
  279.      }
  280.      PrepDefCount = ivs->NumDefinedMacros;
  281.      work = ivs->stringtablestart+ivs->DefinedMacrooff;
  282.      for (i=0;i<PrepDefCount;i++)
  283.      {
  284.        work2=PrepDefines[i];
  285.        while (*work != '\0')
  286.         {
  287.            *work2=*work;
  288.            ++work;
  289.            ++work2;
  290.         }
  291.         *work2='\0';
  292.         strcat(work2,CRLF);
  293.         ++work ;
  294.      }
  295.  
  296.      PrepUnDefCount=ivs->NumUnDefinedMacros;
  297.      work = ivs->stringtablestart+ivs->UnDefinedMacrooff;
  298.      for (i=0;i<PrepUnDefCount;i++)
  299.      {
  300.        work2=PrepUndefines[i];
  301.        while (*work != '\0')
  302.         {
  303.            *work2=*work;
  304.            ++work;
  305.            ++work2;
  306.         }
  307.         *work2='\0';
  308.         strcat(work2,CRLF);
  309.         ++work ;
  310.      }
  311.      OutSrcList=ivs->SrcListRequired ;
  312.      OutMap    =ivs->MapFileRequired ;
  313.      if (ivs->ObjectListReq == 1)
  314.        OutObjList=1;
  315.      else
  316.        OutObjList=0;
  317.      if (ivs->ObjectListReq ==2)
  318.        OutAsmList=1;
  319.      else
  320.        OutAsmList=0;
  321.      if (ivs->ObjectListReq ==3)
  322.        OutComList=1;
  323.      else
  324.        OutComList=0;
  325.  
  326.      strcpy(OutSrcName, ivs->stringtablestart+ivs->SrcListFileoff );
  327.      strcpy(OutMapName, ivs->stringtablestart+ivs->MapListFileoff );
  328.      strcpy(OutObjFname,ivs->stringtablestart+ivs->ObjListFileoff );
  329.      strcpy(OutObjName, ivs->stringtablestart+ivs->ObjFileNameoff );
  330.      strcpy(OutExeName,ivs->stringtablestart+ivs->ExeFileNameoff );
  331.  
  332.  
  333.      LstWarnix = ivs->WarningLevel;
  334.      if (ivs->LineWidth==0)
  335.        LstLine[0]= '\0';
  336.      else
  337.        sprintf(LstLine,"%d",ivs->LineWidth);
  338.      if (ivs->PageLength==0)
  339.        LstPage[0]= '\0';
  340.      else
  341.        sprintf(LstPage,"%d",ivs->PageLength);
  342.      strcpy(LstTitle,ivs->stringtablestart+ivs->Titlestringoff );
  343.      strcpy(LstSubTitle,ivs->stringtablestart+ivs->SubTitlestringoff );
  344.  
  345.  
  346.      SctlConly=  ivs->CompileOnly    ;
  347.      SctlSyntax= ivs->SyntaxCheck    ;
  348.      SctlDecl=   ivs->GenerateDecl   ;
  349.      SctlDext=   ivs->DisableExten   ;
  350.      SctlJ=      ivs->CharisUnsigned ;
  351.      SctlCaseI=  ivs->CaseInsensitive;
  352.      SctlPackix= ivs->StructPack     ;
  353.     }
  354.    if (*Action & NODLGS)
  355.      {
  356.          ReturnOutputString();
  357.          return returncode;
  358.       }
  359.    hab = WinInitialize((USHORT)NULL);            /* initialize                      */
  360.  
  361.   SaveAction=Action;
  362.   if (WinDlgBox( HWND_DESKTOP,
  363.              handleWise,
  364.              MAINPROC,
  365.              handleDLL,
  366.              MAINDLG,
  367.              NULL ) == TRUE)
  368.       {
  369.          WinTerminate(hab);
  370.          return returncode;
  371.       }
  372.    else
  373.     {
  374.          WinTerminate(hab);
  375.          return CANCEL;
  376.     }
  377. }
  378.  
  379.  
  380.  
  381.  
  382. MRESULT EXPENTRY MAINPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2)
  383. {
  384.    switch (msg) {
  385.    case WM_INITDLG:
  386.       WinQueryWindowRect(WinWindowFromID(hwndDlg,FID_TITLEBAR),&tb);
  387.       WinSetWindowPos(hwndDlg,HWND_TOP,(short)(parent.xLeft+5L),(short)(parent.yBottom+5L),
  388.                0,0,SWP_MOVE | SWP_SHOW);
  389.       break;
  390.    case WM_COMMAND:
  391.  
  392.       switch (SHORT1FROMMP(mp1)) {
  393.       case PRPRDLG:
  394.         WinEnableWindow(WinWindowFromID(hwndDlg,PRPRDLG),
  395.                    FALSE);
  396.         WinDlgBox( HWND_DESKTOP,
  397.                    handleWise,
  398.                    PREPPROC,
  399.                    handleDLL,
  400.                    PREPDLG,
  401.                    NULL );
  402.         WinEnableWindow(WinWindowFromID(hwndDlg,PRPRDLG),
  403.                    TRUE);
  404.          break;
  405.       case LSTDLG:
  406.         WinEnableWindow(WinWindowFromID(hwndDlg,LSTDLG),
  407.                    FALSE);
  408.         WinDlgBox( HWND_DESKTOP,
  409.                    handleWise,
  410.                    LISTPROC,
  411.                    handleDLL,
  412.                    LISTDLG,
  413.                    NULL );
  414.         WinEnableWindow(WinWindowFromID(hwndDlg,LSTDLG),
  415.                    TRUE);
  416.          break;
  417.       case SORCDLG:
  418.         WinEnableWindow(WinWindowFromID(hwndDlg,SORCDLG),
  419.                    FALSE);
  420.         WinDlgBox( HWND_DESKTOP,
  421.                    handleWise,
  422.                    SCTLPROC,
  423.                    handleDLL,
  424.                    SCTLDLG,
  425.                    NULL );
  426.         WinEnableWindow(WinWindowFromID(hwndDlg,SORCDLG),
  427.                    TRUE);
  428.          break;
  429.       case FILEDLG:
  430.         WinEnableWindow(WinWindowFromID(hwndDlg,FILEDLG),
  431.                    FALSE);
  432.         WinDlgBox( HWND_DESKTOP,
  433.                    handleWise,
  434.                    OUTFPROC,
  435.                    handleDLL,
  436.                    OUTFDLG,
  437.                    NULL );
  438.         WinEnableWindow(WinWindowFromID(hwndDlg,FILEDLG),
  439.                    TRUE);
  440.          break;
  441.       case CTLDLG:
  442.         WinEnableWindow(WinWindowFromID(hwndDlg,CTLDLG),
  443.                    FALSE);
  444.         WinDlgBox( HWND_DESKTOP,
  445.                    handleWise,
  446.                    CTLPROC,
  447.                    handleDLL,
  448.                    CTLDLG,
  449.                    NULL );
  450.         WinEnableWindow(WinWindowFromID(hwndDlg,CTLDLG),
  451.                    TRUE);
  452.          break;
  453.       case CGENDLG:
  454.         WinEnableWindow(WinWindowFromID(hwndDlg,CGENDLG),
  455.                    FALSE);
  456.         WinDlgBox( HWND_DESKTOP,
  457.                    handleWise,
  458.                    GENPROC,
  459.                    handleDLL,
  460.                    CGENDLG,
  461.                    NULL );
  462.         WinEnableWindow(WinWindowFromID(hwndDlg,CGENDLG),
  463.                    TRUE);
  464.          break;
  465.       case OPTMDLG:
  466.         WinEnableWindow(WinWindowFromID(hwndDlg,OPTMDLG),
  467.                    FALSE);
  468.         WinDlgBox( HWND_DESKTOP,
  469.                    handleWise,
  470.                    OPTPROC,
  471.                    handleDLL,
  472.                    OPTMDLG,
  473.                    NULL );
  474.         WinEnableWindow(WinWindowFromID(hwndDlg,OPTMDLG),
  475.                    TRUE);
  476.          break;
  477.       case DID_OK:
  478.          ReturnOutputString();
  479.          *SaveAction |=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,SAVELSE ),
  480.                        BM_QUERYCHECK,
  481.                        NULL,
  482.                        NULL));
  483.          WinDismissDlg(hwndDlg,TRUE);   /* Returns TRUE to WinDlgBox in the Window */
  484.            break;
  485.       case DID_CANCEL:
  486.          WinDismissDlg(hwndDlg,FALSE);  /* Returns FALSE to WinDlgBox in the Window */
  487.          break;
  488.       default:
  489.          break;
  490.       } /* endswitch */
  491.       break;
  492.    default:
  493.       return WinDefDlgProc( hwndDlg, msg, mp1, mp2 );
  494.    } /* endswitch */
  495.    return FALSE;
  496. }
  497.  
  498.  
  499. MRESULT EXPENTRY OPTPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2)
  500. {
  501.   USHORT checkbox;
  502.   int i;
  503.   short Adjust;
  504.    switch (msg) {
  505.    case WM_INITDLG:
  506.       WinQueryWindowRect(hwndDlg,&child);
  507.       Adjust=(OptActive+CGenActive+CtlActive+PrepActive
  508.                       +OutfActive+ListActive+SctlActive)*(USHORT)tb.yTop;
  509.  
  510.       WinSetWindowPos(hwndDlg,HWND_TOP,(short)(parent.xRight-child.xRight-1)
  511.                       ,(short)(parent.yTop-tb.yTop-Adjust-child.yTop)
  512.                       ,0,0,SWP_MOVE | SWP_SHOW);
  513.  
  514.       hwndOptNone = WinWindowFromID(hwndDlg,OPT_NOPT);
  515.       hwndOptAll = WinWindowFromID(hwndDlg,OPT_MAX);
  516.       hwndOptions[0] = WinWindowFromID(hwndDlg,OPT_SPEED  );
  517.       hwndOptions[1] = WinWindowFromID(hwndDlg,OPT_LOOP   );
  518.       hwndOptions[2] = WinWindowFromID(hwndDlg,OPT_PREC   );
  519.       hwndOptions[3] = WinWindowFromID(hwndDlg,OPT_ALIAS  );
  520.       hwndOptions[4] = WinWindowFromID(hwndDlg,OPT_SPACE  );
  521.       hwndOptions[5] = WinWindowFromID(hwndDlg,OPT_IALIAS );
  522.       hwndOptions[6] = WinWindowFromID(hwndDlg,OPT_INTRIN );
  523.       hwndOptions[7] = WinWindowFromID(hwndDlg,OPT_SAFE   );
  524.       hwndOptions[8] = WinWindowFromID(hwndDlg,OPT_DINLNE );
  525.       WinSendMsg(hwndOptNone,
  526.                  BM_SETCHECK,
  527.                  MPFROMSHORT(OptNone),
  528.                  NULL);
  529.       WinSendMsg(hwndOptAll,
  530.                  BM_SETCHECK,
  531.                  MPFROMSHORT(Optall),
  532.                  NULL);
  533.       if (Optall ==1 || OptNone ==1)
  534.                Disable_ALL_Checks();
  535.       else
  536.          {
  537.            for (i=0;i<9;i++)
  538.             {
  539.              WinSendMsg(hwndOptions[i],
  540.                        BM_SETCHECK,
  541.                       MPFROMSHORT(OptOptions[i]),
  542.                       NULL);
  543.             }
  544.          }
  545.      OptActive = TRUE;
  546.  
  547.       break;
  548.    case WM_CONTROL:
  549.        if  (HIUSHORT(mp1)==BN_CLICKED)
  550.           {
  551.             switch (LOUSHORT((ULONG)mp1)) {
  552.               case OPT_NOPT:
  553.                     OptNone = (OptNone ^1) &1;
  554.                     WinSendMsg(hwndOptNone,
  555.                                BM_SETCHECK,
  556.                                MPFROMSHORT(OptNone),
  557.                                NULL);
  558.                     /* Clear All option */
  559.                     if (OptNone ==1)
  560.                      {
  561.                       Optall = 0;
  562.                       WinSendMsg(hwndOptAll,
  563.                                  BM_SETCHECK,
  564.                                  MPFROMSHORT(0),
  565.                                  NULL);
  566.                       Disable_ALL_Checks();
  567.                      }
  568.                    else
  569.                       Enable_ALL_Checks();
  570.                 break;
  571.               case OPT_MAX:
  572.                     Optall  = (Optall ^1) &1;
  573.                     WinSendMsg(hwndOptAll,
  574.                                BM_SETCHECK,
  575.                                MPFROMSHORT(Optall),
  576.                                NULL);
  577.                     if (Optall ==1)
  578.                      {
  579.                       OptNone = 0;
  580.                       WinSendMsg(hwndOptNone,
  581.                                  BM_SETCHECK,
  582.                                  MPFROMSHORT(0),
  583.                                  NULL);
  584.                       Disable_ALL_Checks();
  585.                       CtlDebNone = TRUE;
  586.                       CtlDebSym  = FALSE;
  587.                       CtlDebLine = FALSE;
  588.                       if (CtlActive==TRUE)
  589.                       {
  590.                        WinSendMsg(hwndDebNone,
  591.                                   BM_SETCHECK,
  592.                                   MPFROMSHORT(CtlDebNone),
  593.                                   NULL);
  594.                        WinSendMsg(hwndDebSym ,
  595.                                   BM_SETCHECK,
  596.                                   MPFROMSHORT(0),
  597.                                   NULL);
  598.                        WinSendMsg(hwndDebLine,
  599.                                   BM_SETCHECK,
  600.                                   MPFROMSHORT(0),
  601.                                   NULL);
  602.                       }
  603.                       GenNstack = 1;
  604.                       if (CGenActive==TRUE)
  605.                       {
  606.                        WinSendMsg(hwndGenNstack,
  607.                                   BM_SETCHECK,
  608.                                   MPFROMSHORT(1),
  609.                                   NULL);
  610.                       }
  611.                      }
  612.                    else
  613.                       Enable_ALL_Checks();
  614.                 break;
  615.              default:
  616.                     checkbox = LOUSHORT((ULONG)mp1)-OPT_SPEED;
  617.                     OptOptions[checkbox] = (OptOptions[checkbox] ^1) &1;
  618.                     WinSendMsg(hwndOptions[checkbox],
  619.                                BM_SETCHECK,
  620.                                MPFROMSHORT(OptOptions[checkbox]),
  621.                                NULL);
  622.                       if (CtlActive == TRUE && CtlDebNone == FALSE)
  623.                       {
  624.                        WinSendMsg(hwndDebNone,
  625.                                   BM_SETCHECK,
  626.                                   MPFROMSHORT(1),
  627.                                   NULL);
  628.                        WinSendMsg(hwndDebSym ,
  629.                                   BM_SETCHECK,
  630.                                   MPFROMSHORT(0),
  631.                                   NULL);
  632.                        WinSendMsg(hwndDebLine,
  633.                                   BM_SETCHECK,
  634.                                   MPFROMSHORT(0),
  635.                                   NULL);
  636.                       }
  637.                       CtlDebNone = TRUE;
  638.                       CtlDebSym  = FALSE;
  639.                       CtlDebLine = FALSE;
  640.                 break;
  641.              }
  642.           }
  643.         else
  644.             return(WinDefDlgProc(hwndDlg,
  645.                                   msg,
  646.                                   mp1,
  647.                                   mp2));
  648.       break;
  649.    case WM_COMMAND:
  650.  
  651.       switch (SHORT1FROMMP(mp1)) {
  652.       case DID_OK:
  653.          OptActive = FALSE;
  654.          WinDismissDlg(hwndDlg,TRUE);   /* Returns TRUE to WinDlgBox in the Window */
  655.            break;
  656.       case DID_CANCEL:
  657.          OptActive = FALSE;
  658.          WinDismissDlg(hwndDlg,FALSE);   /* Returns TRUE to WinDlgBox in the Window */
  659.          break;
  660.       case OPTION_DEFAULT:
  661.           if (Optall ==1 || OptNone ==1)
  662.                    Enable_ALL_Checks();
  663.           Optall=0;
  664.           OptNone=0;
  665.           OptOptions[0]=1;
  666.           for (i=1;i<9;i++)
  667.              OptOptions[i]=0;
  668.           WinSendMsg(hwndOptNone,
  669.                      BM_SETCHECK,
  670.                      MPFROMSHORT(0),
  671.                      NULL);
  672.           WinSendMsg(hwndOptAll,
  673.                      BM_SETCHECK,
  674.                      MPFROMSHORT(0),
  675.                      NULL);
  676.            for (i=0;i<9;i++)
  677.              {
  678.               WinSendMsg(hwndOptions[i],
  679.                         BM_SETCHECK,
  680.                        MPFROMSHORT(OptOptions[i]),
  681.                        NULL);
  682.              }
  683.              break;
  684.       case OPTION_RESET:
  685.          break;
  686.       default:
  687.          break;
  688.       } /* endswitch */
  689.       break;
  690.    default:
  691.       return WinDefDlgProc( hwndDlg, msg, mp1, mp2 );
  692.    } /* endswitch */
  693.    return FALSE;
  694. }
  695.  
  696.  
  697. static void Disable_ALL_Checks(void)
  698. {
  699.    int i;
  700.    for (i=0;i<9 ;i++ ) {
  701.       if (OptOptions[i]==1)
  702.        {
  703.           OptOptions[i]=0;
  704.           WinSendMsg(hwndOptions[i],
  705.                     BM_SETCHECK,
  706.                     MPFROMSHORT(0),
  707.                     NULL);
  708.        }
  709.       /* set the checkbox gray */
  710.       WinEnableWindow(hwndOptions[i],
  711.                  FALSE);
  712.  
  713.    } /* endfor */
  714. }
  715. static void Enable_ALL_Checks(void)
  716. {
  717.    int i;
  718.    for (i=0;i<9 ;i++ ) {
  719.       /* set the checkbox gray */
  720.       WinEnableWindow(hwndOptions[i],
  721.                  TRUE);
  722.  
  723.    } /* endfor */
  724. }
  725. MRESULT EXPENTRY GENPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2)
  726. {
  727.    short Adjust;
  728.    switch (msg) {
  729.    case WM_INITDLG:
  730.       WinQueryWindowRect(hwndDlg,&child);
  731.       Adjust=(OptActive+CGenActive+CtlActive+PrepActive
  732.                       +OutfActive+ListActive+SctlActive)*(USHORT)tb.yTop;
  733.  
  734.       WinSetWindowPos(hwndDlg,HWND_TOP,(short)(parent.xRight-child.xRight-1)
  735.                       ,(short)(parent.yTop-tb.yTop-Adjust-child.yTop)
  736.                       ,0,0,SWP_MOVE | SWP_SHOW);
  737.  
  738.       WinSendMsg(WinWindowFromID(hwndDlg,GENFLOATST+GenFloatix),
  739.                  BM_SETCHECK,
  740.                  MPFROMSHORT(1),
  741.                  NULL);
  742.       WinSendMsg(WinWindowFromID(hwndDlg,GENMODELST + GenModelix),
  743.                  BM_SETCHECK,
  744.                  MPFROMSHORT(1),
  745.                  NULL);
  746.       WinSendMsg(WinWindowFromID(hwndDlg,GENPASCAL ),
  747.                  BM_SETCHECK,
  748.                  MPFROMSHORT(GenPascal),
  749.                  NULL);
  750.       WinSendMsg(WinWindowFromID(hwndDlg,GENPM     ),
  751.                  BM_SETCHECK,
  752.                  MPFROMSHORT(GenPm),
  753.                  NULL);
  754.       hwndGenNstack =  WinWindowFromID(hwndDlg,GENSTACK  );
  755.       WinSendMsg(WinWindowFromID(hwndDlg,GENSTACK  ),
  756.                  BM_SETCHECK,
  757.                  MPFROMSHORT(GenNstack),
  758.                  NULL);
  759.       WinSendMsg(WinWindowFromID(hwndDlg,GENCONST  ),
  760.                  BM_SETCHECK,
  761.                  MPFROMSHORT(GenConst ),
  762.                  NULL);
  763.       WinSendMsg(WinWindowFromID(hwndDlg,GENTHRESH ),
  764.                  BM_SETCHECK,
  765.                  MPFROMSHORT(Genthresh),
  766.                  NULL);
  767.       WinSendMsg(WinWindowFromID(hwndDlg,GENTHRESH_ENTRY ),
  768.                  EM_SETTEXTLIMIT,
  769.                  MPFROMSHORT(8),
  770.                  NULL);
  771.       WinSetWindowText(WinWindowFromID(hwndDlg,GENTHRESH_ENTRY), Genthreshamount);
  772.      CGenActive = TRUE;
  773.  
  774.       break;
  775.      case WM_CONTROL:
  776.        if  (HIUSHORT(mp1)==BN_CLICKED)
  777.           {
  778.             if (LOUSHORT((ULONG)mp1)==GENMODELCUST)
  779.               {
  780.                WinDlgBox( HWND_DESKTOP,
  781.                           hwndDlg,
  782.                           GENCUSTPROC,
  783.                           handleDLL,
  784.                           GENCUSTDLG,
  785.                           NULL );
  786.               }
  787.           }
  788.       break;
  789.      case WM_COMMAND:
  790.  
  791.       switch (SHORT1FROMMP(mp1)) {
  792.          case DID_OK:
  793.             GenFloatix=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,GENFLOATST),
  794.                        BM_QUERYCHECKINDEX,
  795.                        NULL,
  796.                        NULL));
  797.              --GenFloatix;
  798.             GenModelix=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,GENMODELST),
  799.                        BM_QUERYCHECKINDEX,
  800.                        NULL,
  801.                        NULL));
  802.              --GenModelix;
  803.             GenPascal=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,GENPASCAL ),
  804.                        BM_QUERYCHECK,
  805.                        NULL,
  806.                        NULL));
  807.             GenPm=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,GENPM     ),
  808.                        BM_QUERYCHECK,
  809.                        NULL,
  810.                        NULL));
  811.             GenNstack=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,GENSTACK  ),
  812.                        BM_QUERYCHECK,
  813.                        NULL,
  814.                        NULL));
  815.             GenConst=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,GENCONST  ),
  816.                        BM_QUERYCHECK,
  817.                        NULL,
  818.                        NULL));
  819.             Genthresh=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,GENTHRESH ),
  820.                        BM_QUERYCHECK,
  821.                        NULL,
  822.                        NULL));
  823.              if (Genthresh)
  824.                 {
  825.                  WinQueryWindowText(WinWindowFromID(hwndDlg,GENTHRESH_ENTRY ),
  826.                       10,
  827.                       Genthreshamount);
  828.                 }
  829.              else
  830.                 Genthreshamount[0]='\0';
  831.              CGenActive = FALSE;
  832.              WinDismissDlg(hwndDlg,TRUE);   /* Returns TRUE to WinDlgBox in the Window */
  833.               break;
  834.          case DID_CANCEL:
  835.             CGenActive = FALSE;
  836.             WinDismissDlg(hwndDlg,FALSE);   /* Returns TRUE to WinDlgBox in the Window */
  837.             break;
  838.          case OPTION_DEFAULT:
  839.              GenPascal=GenPm=GenNstack=GenConst=Genthresh=0;
  840.              GenModelix=0;
  841.              GenFloatix=3;
  842.              Genthreshamount[0]='\0';
  843.              WinSendMsg(WinWindowFromID(hwndDlg,GENMODELST+GenModelix),
  844.                         BM_SETCHECK,
  845.                         MPFROMSHORT(1),
  846.                         NULL);
  847.              WinSendMsg(WinWindowFromID(hwndDlg,GENFLOATST+GenFloatix),
  848.                         BM_SETCHECK,
  849.                         MPFROMSHORT(1),
  850.                         NULL);
  851.              WinSendMsg(WinWindowFromID(hwndDlg,GENPASCAL ),
  852.                         BM_SETCHECK,
  853.                         MPFROMSHORT(GenPascal),
  854.                         NULL);
  855.              WinSendMsg(WinWindowFromID(hwndDlg,GENPM     ),
  856.                         BM_SETCHECK,
  857.                         MPFROMSHORT(GenPm),
  858.                         NULL);
  859.              WinSendMsg(WinWindowFromID(hwndDlg,GENSTACK  ),
  860.                         BM_SETCHECK,
  861.                         MPFROMSHORT(GenNstack),
  862.                         NULL);
  863.              WinSendMsg(WinWindowFromID(hwndDlg,GENCONST  ),
  864.                         BM_SETCHECK,
  865.                         MPFROMSHORT(GenConst ),
  866.                         NULL);
  867.              WinSendMsg(WinWindowFromID(hwndDlg,GENTHRESH ),
  868.                         BM_SETCHECK,
  869.                         MPFROMSHORT(Genthresh),
  870.                         NULL);
  871.              WinSendMsg(WinWindowFromID(hwndDlg,GENTHRESH_ENTRY ),
  872.                         EM_SETTEXTLIMIT,
  873.                         MPFROMSHORT(8),
  874.                         NULL);
  875.              WinSetWindowText(WinWindowFromID(hwndDlg,GENTHRESH_ENTRY), Genthreshamount);
  876.             break;
  877.          case OPTION_RESET:
  878.            break;
  879.          default:
  880.          break;
  881.          } /* endswitch */
  882.       break;
  883.      default:
  884.       return WinDefDlgProc( hwndDlg, msg, mp1, mp2 );
  885.    } /* endswitch */
  886.    return FALSE;
  887. }
  888. MRESULT EXPENTRY GENCUSTPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2)
  889. {
  890.    short Adjust;
  891.    switch (msg) {
  892.      case WM_INITDLG:
  893.       WinQueryWindowRect(hwndDlg,&child);
  894.       Adjust=(OptActive+CGenActive+CtlActive+PrepActive
  895.                       +OutfActive+ListActive+SctlActive)*(USHORT)tb.yTop;
  896.  
  897.  
  898.       WinSetWindowPos(hwndDlg,HWND_TOP,(short)(parent.xRight-child.xRight-1)
  899.                       ,(short)(parent.yTop-tb.yTop-Adjust-child.yTop)
  900.                       ,0,0,SWP_MOVE | SWP_SHOW);
  901.       WinSendMsg(WinWindowFromID(hwndDlg,GENCUSTSHRT+GenCustCodeix),
  902.                  BM_SETCHECK,
  903.                  MPFROMSHORT(1),
  904.                  NULL);
  905.       WinSendMsg(WinWindowFromID(hwndDlg,GENCUSTNEAR+GenCustDataix),
  906.                  BM_SETCHECK,
  907.                  MPFROMSHORT(1),
  908.                  NULL);
  909.       WinSendMsg(WinWindowFromID(hwndDlg,GENCUSTSSDS+GenCustSegmix),
  910.                  BM_SETCHECK,
  911.                  MPFROMSHORT(1),
  912.                  NULL);
  913.       break;
  914.      case WM_COMMAND:
  915.  
  916.       switch (SHORT1FROMMP(mp1)) {
  917.          case DID_OK:
  918.             GenCustCodeix=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,GENCUSTSHRT),
  919.                        BM_QUERYCHECKINDEX,
  920.                        NULL,
  921.                        NULL));
  922.              --GenCustCodeix;
  923.             GenCustDataix=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,GENCUSTNEAR),
  924.                        BM_QUERYCHECKINDEX,
  925.                        NULL,
  926.                        NULL));
  927.              --GenCustDataix;
  928.             GenCustSegmix=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,GENCUSTSSDS),
  929.                        BM_QUERYCHECKINDEX,
  930.                        NULL,
  931.                        NULL));
  932.              --GenCustSegmix;
  933.              break;
  934.          default:
  935.              break;
  936.          } /* endswitch */
  937.      default:
  938.       return WinDefDlgProc( hwndDlg, msg, mp1, mp2 );
  939.    } /* endswitch */
  940.    return FALSE;
  941. }
  942. MRESULT EXPENTRY CTLPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2)
  943. {
  944.   short Adjust;
  945.   int i;
  946.    switch (msg) {
  947.    case WM_INITDLG:
  948.       WinQueryWindowRect(hwndDlg,&child);
  949.       Adjust=(OptActive+CGenActive+CtlActive+PrepActive
  950.                       +OutfActive+ListActive+SctlActive)*(USHORT)tb.yTop;
  951.  
  952.       WinSetWindowPos(hwndDlg,HWND_TOP,(short)(parent.xRight-child.xRight-1)
  953.                       ,(short)(parent.yTop-tb.yTop-Adjust-child.yTop)
  954.                       ,0,0,SWP_MOVE | SWP_SHOW);
  955.       hwndDebNone = WinWindowFromID(hwndDlg,CTLDEBNONE);
  956.       hwndDebSym  = WinWindowFromID(hwndDlg,CTLDEBSYM );
  957.       hwndDebLine = WinWindowFromID(hwndDlg,CTLDEBLINE);
  958.       WinSendMsg(WinWindowFromID(hwndDlg,CTLTYPEEXE+CtlObjTypeix),
  959.                  BM_SETCHECK,
  960.                  MPFROMSHORT(1),
  961.                  NULL);
  962.       WinSendMsg(hwndDebNone,
  963.                  BM_SETCHECK,
  964.                  MPFROMSHORT(CtlDebNone),
  965.                  NULL);
  966.       WinSendMsg(hwndDebLine,
  967.                  BM_SETCHECK,
  968.                  MPFROMSHORT(CtlDebLine),
  969.                  NULL);
  970.       WinSendMsg(hwndDebSym,
  971.                  BM_SETCHECK,
  972.                  MPFROMSHORT(CtlDebSym),
  973.                  NULL);
  974.       WinSendMsg(WinWindowFromID(hwndDlg,CTLNMLGTH ),
  975.                  EM_SETTEXTLIMIT,
  976.                  MPFROMSHORT(3),
  977.                  NULL);
  978.       WinSendMsg(WinWindowFromID(hwndDlg,CTLDEFLIB),
  979.                  BM_SETCHECK,
  980.                  MPFROMSHORT(CtlDefLib),
  981.                  NULL);
  982.       WinSendMsg(WinWindowFromID(hwndDlg,CTLUSEB1 ),
  983.                  BM_SETCHECK,
  984.                  MPFROMSHORT(CtlUseB1),
  985.                  NULL);
  986.  
  987.       WinSetWindowText(WinWindowFromID(hwndDlg,CTLNMLGTH  ), CtlNameLen  );
  988.       WinSendMsg(WinWindowFromID(hwndDlg,CTLVERSION),
  989.                  EM_SETTEXTLIMIT,
  990.                  MPFROMSHORT(255),
  991.                  NULL);
  992.       WinSetWindowText(WinWindowFromID(hwndDlg,CTLVERSION ), CtlVersion  );
  993.       WinSendMsg(WinWindowFromID(hwndDlg,CTLDATASEG),
  994.                  EM_SETTEXTLIMIT,
  995.                  MPFROMSHORT(40),
  996.                  NULL);
  997.       WinSetWindowText(WinWindowFromID(hwndDlg,CTLDATASEG ), CtlDataSeg  );
  998.       WinSendMsg(WinWindowFromID(hwndDlg,CTLCODESEG),
  999.                  EM_SETTEXTLIMIT,
  1000.                  MPFROMSHORT(40),
  1001.                  NULL);
  1002.       WinSetWindowText(WinWindowFromID(hwndDlg,CTLCODESEG ), CtlCodeSeg  );
  1003.  
  1004.      CtlActive = TRUE ;
  1005.       break;
  1006.      case WM_CONTROL:
  1007.        if  (HIUSHORT(mp1)==BN_CLICKED)
  1008.           {
  1009.             switch (LOUSHORT((ULONG)mp1))
  1010.               {
  1011.                case CTLDEBNONE:
  1012.                   CtlDebNone= (CtlDebNone ^1) &1;
  1013.                   WinSendMsg(hwndDebNone,
  1014.                              BM_SETCHECK,
  1015.                              MPFROMSHORT(CtlDebNone),
  1016.                              NULL);
  1017.                   if (CtlDebNone)
  1018.                   {
  1019.                      if (CtlDebSym==1)
  1020.                       {
  1021.                         CtlDebSym=0;
  1022.                         WinSendMsg(hwndDebSym,
  1023.                                    BM_SETCHECK,
  1024.                                    MPFROMSHORT(0),
  1025.                                    NULL);
  1026.                       }
  1027.                      if (CtlDebLine==1)
  1028.                       {
  1029.                         CtlDebLine=0;
  1030.                         WinSendMsg(hwndDebLine,
  1031.                                    BM_SETCHECK,
  1032.                                    MPFROMSHORT(0),
  1033.                                    NULL);
  1034.                       }
  1035.                    }
  1036.                   break;
  1037.                case CTLDEBLINE:
  1038.                   CtlDebLine= (CtlDebLine ^1) &1;
  1039.                   WinSendMsg(hwndDebLine,
  1040.                              BM_SETCHECK,
  1041.                              MPFROMSHORT(CtlDebLine),
  1042.                              NULL);
  1043.                   if (CtlDebNone==1)
  1044.                    {
  1045.                      CtlDebNone=0;
  1046.                      WinSendMsg(hwndDebNone,
  1047.                                 BM_SETCHECK,
  1048.                                 MPFROMSHORT(0),
  1049.                                 NULL);
  1050.                      if (OptNone == FALSE)
  1051.                      {
  1052.                       OptNone = TRUE;
  1053.                       Optall = FALSE;
  1054.                       if (OptActive)
  1055.                       {
  1056.                               WinSendMsg(hwndOptNone,
  1057.                                        BM_SETCHECK,
  1058.                                        MPFROMSHORT(OptNone),
  1059.                                        NULL);
  1060.                               WinSendMsg(hwndOptAll,
  1061.                                          BM_SETCHECK,
  1062.                                          MPFROMSHORT(0),
  1063.                                          NULL);
  1064.                               Disable_ALL_Checks();
  1065.                       } /* endif */
  1066.                       else
  1067.                         for (i=0;i<9 ;i++ )
  1068.                            OptOptions[i]=0;
  1069.                      }
  1070.                    }
  1071.                   break;
  1072.                case CTLDEBSYM:
  1073.                   CtlDebSym= (CtlDebSym ^1) &1;
  1074.                   WinSendMsg(hwndDebSym ,
  1075.                              BM_SETCHECK,
  1076.                              MPFROMSHORT(CtlDebSym),
  1077.                              NULL);
  1078.                   if (CtlDebNone==1)
  1079.                    {
  1080.                      CtlDebNone=0;
  1081.                      WinSendMsg(hwndDebNone,
  1082.                                 BM_SETCHECK,
  1083.                                 MPFROMSHORT(0),
  1084.                                 NULL);
  1085.                      if (OptNone == FALSE)
  1086.                      {
  1087.                       OptNone = TRUE;
  1088.                       Optall = FALSE;
  1089.                       if (OptActive)
  1090.                       {
  1091.                               WinSendMsg(hwndOptNone,
  1092.                                        BM_SETCHECK,
  1093.                                        MPFROMSHORT(OptNone),
  1094.                                        NULL);
  1095.                               WinSendMsg(hwndOptAll,
  1096.                                          BM_SETCHECK,
  1097.                                          MPFROMSHORT(0),
  1098.                                          NULL);
  1099.                               Disable_ALL_Checks();
  1100.                       } /* endif */
  1101.                       else
  1102.                         for (i=0;i<9 ;i++ )
  1103.                            OptOptions[i]=0;
  1104.                      }
  1105.                    }
  1106.                   break;
  1107.                default :
  1108.                   break;
  1109.               }
  1110.           }
  1111.       break;
  1112.      case WM_COMMAND:
  1113.  
  1114.       switch (SHORT1FROMMP(mp1)) {
  1115.          case DID_OK:
  1116.             CtlObjTypeix=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,CTLTYPEEXE),
  1117.                        BM_QUERYCHECKINDEX,
  1118.                        NULL,
  1119.                        NULL));
  1120.              --CtlObjTypeix;
  1121.  
  1122.              CtlDefLib=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,CTLDEFLIB),
  1123.                        BM_QUERYCHECK,
  1124.                        NULL,
  1125.                        NULL));
  1126.              CtlUseB1 =SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,CTLUSEB1 ),
  1127.                        BM_QUERYCHECK,
  1128.                        NULL,
  1129.                        NULL));
  1130.              WinQueryWindowText(WinWindowFromID(hwndDlg,CTLNMLGTH ),
  1131.                      4,
  1132.                      CtlNameLen );
  1133.              WinQueryWindowText(WinWindowFromID(hwndDlg,CTLVERSION),
  1134.                      256,
  1135.                      CtlVersion );
  1136.              WinQueryWindowText(WinWindowFromID(hwndDlg,CTLDATASEG),
  1137.                      41,
  1138.                      CtlDataSeg );
  1139.              WinQueryWindowText(WinWindowFromID(hwndDlg,CTLCODESEG),
  1140.                      41,
  1141.                      CtlCodeSeg );
  1142.              CtlActive = FALSE;
  1143.              WinDismissDlg(hwndDlg,TRUE);   /* Returns TRUE to WinDlgBox in the Window */
  1144.               break;
  1145.          case DID_CANCEL:
  1146.             CtlActive = FALSE;
  1147.             WinDismissDlg(hwndDlg,FALSE);   /* Returns TRUE to WinDlgBox in the Window */
  1148.             break;
  1149.          case OPTION_DEFAULT:
  1150.              CtlObjTypeix=0;
  1151.              CtlDebNone=1,
  1152.              CtlDefLib=0;
  1153.              CtlUseB1 =0;
  1154.              CtlDebSym=CtlDebLine=0;
  1155.              strcpy(CtlNameLen,"31");
  1156.              CtlVersion[0]=CtlDataSeg[0]=CtlCodeSeg[0]='\0';
  1157.             WinSendMsg(WinWindowFromID(hwndDlg,CTLDEFLIB),
  1158.                  BM_SETCHECK,
  1159.                  MPFROMSHORT(CtlDefLib),
  1160.                  NULL);
  1161.             WinSendMsg(WinWindowFromID(hwndDlg,CTLUSEB1 ),
  1162.                  BM_SETCHECK,
  1163.                  MPFROMSHORT(CtlUseB1 ),
  1164.                  NULL);
  1165.              WinSendMsg(WinWindowFromID(hwndDlg,CTLTYPEEXE+CtlObjTypeix),
  1166.                         BM_SETCHECK,
  1167.                         MPFROMSHORT(1),
  1168.                         NULL);
  1169.              WinSendMsg(WinWindowFromID(hwndDlg,CTLDEBNONE),
  1170.                         BM_SETCHECK,
  1171.                         MPFROMSHORT(CtlDebNone),
  1172.                         NULL);
  1173.              WinSendMsg(WinWindowFromID(hwndDlg,CTLDEBLINE),
  1174.                         BM_SETCHECK,
  1175.                         MPFROMSHORT(CtlDebLine),
  1176.                         NULL);
  1177.              WinSendMsg(WinWindowFromID(hwndDlg,CTLDEBSYM ),
  1178.                         BM_SETCHECK,
  1179.                         MPFROMSHORT(CtlDebSym),
  1180.                         NULL);
  1181.              WinSetWindowText(WinWindowFromID(hwndDlg,CTLNMLGTH  ), CtlNameLen  );
  1182.              WinSetWindowText(WinWindowFromID(hwndDlg,CTLVERSION ), CtlVersion  );
  1183.              WinSetWindowText(WinWindowFromID(hwndDlg,CTLDATASEG ), CtlDataSeg  );
  1184.              WinSetWindowText(WinWindowFromID(hwndDlg,CTLCODESEG ), CtlCodeSeg  );
  1185.          case OPTION_RESET:
  1186.            break;
  1187.          default:
  1188.          break;
  1189.          } /* endswitch */
  1190.       break;
  1191.      default:
  1192.       return WinDefDlgProc( hwndDlg, msg, mp1, mp2 );
  1193.    } /* endswitch */
  1194.    return FALSE;
  1195. }
  1196. MRESULT EXPENTRY PREPPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2)
  1197. {
  1198.    IPT x,y;
  1199.    int i;
  1200.    HWND hwndDependMLE;
  1201.    short Adjust;
  1202.    switch (msg) {
  1203.      case WM_INITDLG:
  1204.       WinQueryWindowRect(hwndDlg,&child);
  1205.       Adjust=(OptActive+CGenActive+CtlActive+PrepActive
  1206.                       +OutfActive+ListActive+SctlActive)*(USHORT)tb.yTop;
  1207.  
  1208.       WinSetWindowPos(hwndDlg,HWND_TOP,(short)(parent.xRight-child.xRight-1)
  1209.                       ,(short)(parent.yTop-tb.yTop-Adjust-child.yTop)
  1210.                       ,0,0,SWP_MOVE | SWP_SHOW);
  1211.       WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTFILE),
  1212.                  BM_SETCHECK,
  1213.                  MPFROMSHORT(boolLstFile),
  1214.                  NULL);
  1215.       WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTSOWL),
  1216.                  BM_SETCHECK,
  1217.                  MPFROMSHORT(boolListSOWL),
  1218.                  NULL);
  1219.       WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTSONL),
  1220.                  BM_SETCHECK,
  1221.                  MPFROMSHORT(boolListSONL),
  1222.                  NULL);
  1223.       WinSendMsg(WinWindowFromID(hwndDlg,PREPCOMMENT),
  1224.                  BM_SETCHECK,
  1225.                  MPFROMSHORT(boolPrepComment),
  1226.                  NULL);
  1227.       WinSendMsg(WinWindowFromID(hwndDlg,PREPEXCLUDE),
  1228.                  BM_SETCHECK,
  1229.                  MPFROMSHORT(boolPrepExclude),
  1230.                  NULL);
  1231.       WinSendMsg(WinWindowFromID(hwndDlg,PREPUNDALL),
  1232.                  BM_SETCHECK,
  1233.                  MPFROMSHORT(boolPrepUndAll),
  1234.                  NULL);
  1235.       hwndDependMLE=WinWindowFromID(hwndDlg,PREPINCLUDE);
  1236.      for (i=0;i<PrepInclCount;i++)
  1237.       {
  1238.         x= (IPT)WinSendMsg(hwndDependMLE,
  1239.                    MLM_CHARFROMLINE,
  1240.                    MPFROMSHORT(i),
  1241.                    0L);
  1242.            WinSendMsg(hwndDependMLE,
  1243.                    MLM_SETSEL,
  1244.                    MPFROMLONG(x),
  1245.                    MPFROMLONG(x));
  1246.            WinSendMsg(hwndDependMLE,
  1247.                    MLM_INSERT,
  1248.                    PrepIncludeDir[i],
  1249.                    NULL);
  1250.       }
  1251.       hwndDependMLE=WinWindowFromID(hwndDlg,PREPDEFINE );
  1252.      for (i=0;i<PrepDefCount;i++)
  1253.       {
  1254.         x= (IPT)WinSendMsg(hwndDependMLE,
  1255.                    MLM_CHARFROMLINE,
  1256.                    MPFROMSHORT(i),
  1257.                    0L);
  1258.            WinSendMsg(hwndDependMLE,
  1259.                    MLM_SETSEL,
  1260.                    MPFROMLONG(x),
  1261.                    MPFROMLONG(x));
  1262.            WinSendMsg(hwndDependMLE,
  1263.                    MLM_INSERT,
  1264.                    PrepDefines[i],
  1265.                    NULL);
  1266.       }
  1267.       hwndDependMLE=WinWindowFromID(hwndDlg,PREPUNDEFINE );
  1268.      for (i=0;i<PrepUnDefCount;i++)
  1269.       {
  1270.         x= (IPT)WinSendMsg(hwndDependMLE,
  1271.                    MLM_CHARFROMLINE,
  1272.                    MPFROMSHORT(i),
  1273.                    0L);
  1274.            WinSendMsg(hwndDependMLE,
  1275.                    MLM_SETSEL,
  1276.                    MPFROMLONG(x),
  1277.                    MPFROMLONG(x));
  1278.            WinSendMsg(hwndDependMLE,
  1279.                    MLM_INSERT,
  1280.                    PrepUndefines[i],
  1281.                    NULL);
  1282.       }
  1283.      PrepActive = TRUE ;
  1284.       break;
  1285.  
  1286.      case WM_CONTROL:
  1287.        if  (HIUSHORT(mp1)==BN_CLICKED)
  1288.           {
  1289.             switch (LOUSHORT((ULONG)mp1))
  1290.               {
  1291.                case PREPLSTFILE :
  1292.                   if (WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTFILE),
  1293.                             BM_QUERYCHECK,
  1294.                             NULL,
  1295.                             NULL))
  1296.                   {
  1297.                    WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTSOWL),
  1298.                               BM_SETCHECK,
  1299.                               MPFROMSHORT(0),
  1300.                               NULL);
  1301.                    WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTSONL),
  1302.                               BM_SETCHECK,
  1303.                               MPFROMSHORT(0),
  1304.                               NULL);
  1305.                   }
  1306.                   break;
  1307.                case PREPLSTSOWL :
  1308.                   if (WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTSOWL),
  1309.                             BM_QUERYCHECK,
  1310.                             NULL,
  1311.                             NULL))
  1312.                   {
  1313.                    WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTFILE),
  1314.                               BM_SETCHECK,
  1315.                               MPFROMSHORT(0),
  1316.                               NULL);
  1317.                    WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTSONL),
  1318.                               BM_SETCHECK,
  1319.                               MPFROMSHORT(0),
  1320.                               NULL);
  1321.                   }
  1322.                   break;
  1323.                case PREPLSTSONL :
  1324.                   if (WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTSONL),
  1325.                             BM_QUERYCHECK,
  1326.                             NULL,
  1327.                             NULL))
  1328.                   {
  1329.                    WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTFILE),
  1330.                               BM_SETCHECK,
  1331.                               MPFROMSHORT(0),
  1332.                               NULL);
  1333.                    WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTSOWL),
  1334.                               BM_SETCHECK,
  1335.                               MPFROMSHORT(0),
  1336.                               NULL);
  1337.                   }
  1338.                   break;
  1339.                default :
  1340.                   break;
  1341.               }
  1342.           }
  1343.       break;
  1344.    case WM_COMMAND:
  1345.       switch (SHORT1FROMMP(mp1)) {
  1346.          case DID_OK:
  1347.             boolLstFile=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTFILE ),
  1348.                        BM_QUERYCHECK,
  1349.                        NULL,
  1350.                        NULL));
  1351.             boolListSOWL=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTSOWL),
  1352.                        BM_QUERYCHECK,
  1353.                        NULL,
  1354.                        NULL));
  1355.             boolListSONL=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTSONL),
  1356.                        BM_QUERYCHECK,
  1357.                        NULL,
  1358.                        NULL));
  1359.             boolPrepComment=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,PREPCOMMENT),
  1360.                        BM_QUERYCHECK,
  1361.                        NULL,
  1362.                        NULL));
  1363.             boolPrepExclude=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,PREPEXCLUDE),
  1364.                        BM_QUERYCHECK,
  1365.                        NULL,
  1366.                        NULL));
  1367.             boolPrepUndAll=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,PREPUNDALL),
  1368.                        BM_QUERYCHECK,
  1369.                        NULL,
  1370.                        NULL));
  1371.             hwndDependMLE=WinWindowFromID(hwndDlg,PREPINCLUDE);
  1372.             PrepInclCount= SHORT1FROMMP(WinSendMsg(hwndDependMLE,
  1373.                            MLM_QUERYLINECOUNT,
  1374.                            NULL,
  1375.                            0L));
  1376.             if (PrepInclCount > 15)
  1377.                PrepInclCount = 15;
  1378.             for (i=0;i<PrepInclCount;i++)
  1379.             {
  1380.                   x= (IPT)WinSendMsg(hwndDependMLE,
  1381.                              MLM_CHARFROMLINE,
  1382.                              MPFROMSHORT(i),
  1383.                              0L);
  1384.                   y= (IPT)WinSendMsg(hwndDependMLE,
  1385.                              MLM_CHARFROMLINE,
  1386.                              MPFROMSHORT(i+1),
  1387.                              0L);
  1388.                   WinSendMsg(hwndDependMLE,
  1389.                           MLM_SETSEL,
  1390.                           MPFROMLONG(x),
  1391.                           MPFROMLONG(y));
  1392.                   WinSendMsg(hwndDependMLE,
  1393.                           MLM_QUERYSELTEXT,
  1394.                           MPFROMLONG(PrepIncludeDir[i]),
  1395.                           NULL);
  1396.              }
  1397.             hwndDependMLE=WinWindowFromID(hwndDlg,PREPDEFINE );
  1398.             PrepDefCount= SHORT1FROMMP(WinSendMsg(hwndDependMLE,
  1399.                            MLM_QUERYLINECOUNT,
  1400.                            NULL,
  1401.                            0L));
  1402.             if (PrepDefCount > 15)
  1403.                PrepDefCount = 15;
  1404.             for (i=0;i<PrepDefCount;i++)
  1405.             {
  1406.                   x= (IPT)WinSendMsg(hwndDependMLE,
  1407.                              MLM_CHARFROMLINE,
  1408.                              MPFROMSHORT(i),
  1409.                              0L);
  1410.                   y= (IPT)WinSendMsg(hwndDependMLE,
  1411.                              MLM_CHARFROMLINE,
  1412.                              MPFROMSHORT(i+1),
  1413.                              0L);
  1414.                   WinSendMsg(hwndDependMLE,
  1415.                           MLM_SETSEL,
  1416.                           MPFROMLONG(x),
  1417.                           MPFROMLONG(y));
  1418.                   WinSendMsg(hwndDependMLE,
  1419.                           MLM_QUERYSELTEXT,
  1420.                           MPFROMLONG(PrepDefines[i]),
  1421.                           NULL);
  1422.              }
  1423.              hwndDependMLE=WinWindowFromID(hwndDlg,PREPUNDEFINE );
  1424.             PrepUnDefCount= SHORT1FROMMP(WinSendMsg(hwndDependMLE,
  1425.                            MLM_QUERYLINECOUNT,
  1426.                            NULL,
  1427.                            0L));
  1428.             if (PrepUnDefCount > 15)
  1429.                PrepUnDefCount = 15;
  1430.             for (i=0;i<PrepUnDefCount;i++)
  1431.             {
  1432.                   x= (IPT)WinSendMsg(hwndDependMLE,
  1433.                              MLM_CHARFROMLINE,
  1434.                              MPFROMSHORT(i),
  1435.                              0L);
  1436.                   y= (IPT)WinSendMsg(hwndDependMLE,
  1437.                              MLM_CHARFROMLINE,
  1438.                              MPFROMSHORT(i+1),
  1439.                              0L);
  1440.                   WinSendMsg(hwndDependMLE,
  1441.                           MLM_SETSEL,
  1442.                           MPFROMLONG(x),
  1443.                           MPFROMLONG(y));
  1444.                   WinSendMsg(hwndDependMLE,
  1445.                           MLM_QUERYSELTEXT,
  1446.                           MPFROMLONG(PrepUndefines[i]),
  1447.                           NULL);
  1448.              }
  1449.              PrepActive = FALSE ;
  1450.  
  1451.              WinDismissDlg(hwndDlg,TRUE);   /* Returns TRUE to WinDlgBox in the Window */
  1452.               break;
  1453.          case DID_CANCEL:
  1454.             PrepActive = FALSE ;
  1455.             WinDismissDlg(hwndDlg,FALSE);   /* Returns TRUE to WinDlgBox in the Window */
  1456.             break;
  1457.          case OPTION_DEFAULT:
  1458.             boolLstFile = 0;
  1459.             boolListSOWL= 0;
  1460.             boolListSONL= 0;
  1461.             boolPrepComment= 0;
  1462.             boolPrepExclude= 0;
  1463.             boolPrepUndAll = 0;
  1464.             WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTFILE),
  1465.                        BM_SETCHECK,
  1466.                        MPFROMSHORT(boolLstFile),
  1467.                        NULL);
  1468.             WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTSOWL),
  1469.                        BM_SETCHECK,
  1470.                        MPFROMSHORT(boolListSOWL),
  1471.                        NULL);
  1472.             WinSendMsg(WinWindowFromID(hwndDlg,PREPLSTSONL),
  1473.                        BM_SETCHECK,
  1474.                        MPFROMSHORT(boolListSONL),
  1475.                        NULL);
  1476.             WinSendMsg(WinWindowFromID(hwndDlg,PREPCOMMENT),
  1477.                        BM_SETCHECK,
  1478.                        MPFROMSHORT(boolPrepComment),
  1479.                        NULL);
  1480.             WinSendMsg(WinWindowFromID(hwndDlg,PREPEXCLUDE),
  1481.                        BM_SETCHECK,
  1482.                        MPFROMSHORT(boolPrepExclude),
  1483.                        NULL);
  1484.             WinSendMsg(WinWindowFromID(hwndDlg,PREPUNDALL),
  1485.                        BM_SETCHECK,
  1486.                        MPFROMSHORT(boolPrepUndAll),
  1487.                        NULL);
  1488.  
  1489.               hwndDependMLE=WinWindowFromID(hwndDlg,PREPINCLUDE);
  1490.               PrepInclCount= SHORT1FROMMP(WinSendMsg(hwndDependMLE,
  1491.                            MLM_QUERYLINECOUNT,
  1492.                            NULL,
  1493.                            0L));
  1494.                   x= (IPT)WinSendMsg(hwndDependMLE,
  1495.                              MLM_CHARFROMLINE,
  1496.                              MPFROMSHORT(0),
  1497.                              0L);
  1498.                   y= (IPT)WinSendMsg(hwndDependMLE,
  1499.                              MLM_CHARFROMLINE,
  1500.                              MPFROMSHORT(PrepInclCount),
  1501.                              0L);
  1502.                   WinSendMsg(hwndDependMLE,
  1503.                           MLM_SETSEL,
  1504.                           MPFROMLONG(x),
  1505.                           MPFROMLONG(y));
  1506.                   WinSendMsg(hwndDependMLE,
  1507.                           MLM_CLEAR,
  1508.                           NULL,
  1509.                           NULL);
  1510.             hwndDependMLE=WinWindowFromID(hwndDlg,PREPDEFINE );
  1511.             PrepDefCount= SHORT1FROMMP(WinSendMsg(hwndDependMLE,
  1512.                            MLM_QUERYLINECOUNT,
  1513.                            NULL,
  1514.                            0L));
  1515.                   x= (IPT)WinSendMsg(hwndDependMLE,
  1516.                              MLM_CHARFROMLINE,
  1517.                              MPFROMSHORT(0),
  1518.                              0L);
  1519.                   y= (IPT)WinSendMsg(hwndDependMLE,
  1520.                              MLM_CHARFROMLINE,
  1521.                              MPFROMSHORT(PrepDefCount),
  1522.                              0L);
  1523.                   WinSendMsg(hwndDependMLE,
  1524.                           MLM_SETSEL,
  1525.                           MPFROMLONG(x),
  1526.                           MPFROMLONG(y));
  1527.                   WinSendMsg(hwndDependMLE,
  1528.                           MLM_CLEAR,
  1529.                           NULL,
  1530.                           NULL);
  1531.              hwndDependMLE=WinWindowFromID(hwndDlg,PREPUNDEFINE );
  1532.             PrepUnDefCount= SHORT1FROMMP(WinSendMsg(hwndDependMLE,
  1533.                            MLM_QUERYLINECOUNT,
  1534.                            NULL,
  1535.                            0L));
  1536.                   x= (IPT)WinSendMsg(hwndDependMLE,
  1537.                              MLM_CHARFROMLINE,
  1538.                              MPFROMSHORT(0),
  1539.                              0L);
  1540.                   y= (IPT)WinSendMsg(hwndDependMLE,
  1541.                              MLM_CHARFROMLINE,
  1542.                              MPFROMSHORT(PrepUnDefCount),
  1543.                              0L);
  1544.                   WinSendMsg(hwndDependMLE,
  1545.                           MLM_SETSEL,
  1546.                           MPFROMLONG(x),
  1547.                           MPFROMLONG(y));
  1548.                   WinSendMsg(hwndDependMLE,
  1549.                           MLM_CLEAR,
  1550.                           NULL,
  1551.                           NULL);
  1552.  
  1553.             PrepInclCount=0;
  1554.             PrepDefCount =0;
  1555.             PrepUnDefCount =0;
  1556.                   break;
  1557.                case OPTION_RESET:
  1558.                  break;
  1559.                default:
  1560.                break;
  1561.                } /* endswitch */
  1562.       break;
  1563.      default:
  1564.       return WinDefDlgProc( hwndDlg, msg, mp1, mp2 );
  1565.    } /* endswitch */
  1566.    return FALSE;
  1567. }
  1568. MRESULT EXPENTRY OUTFPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2)
  1569. {
  1570.    short Adjust;
  1571.    switch (msg) {
  1572.    case WM_INITDLG:
  1573.       WinQueryWindowRect(hwndDlg,&child);
  1574.       Adjust=(OptActive+CGenActive+CtlActive+PrepActive
  1575.                       +OutfActive+ListActive+SctlActive)*(USHORT)tb.yTop;
  1576.  
  1577.       WinSetWindowPos(hwndDlg,HWND_TOP,(short)(parent.xRight-child.xRight-1)
  1578.                       ,(short)(parent.yTop-tb.yTop-Adjust-child.yTop)
  1579.                       ,0,0,SWP_MOVE | SWP_SHOW);
  1580.       WinSendMsg(WinWindowFromID(hwndDlg,OUTSRCOPT),
  1581.                  BM_SETCHECK,
  1582.                  MPFROMSHORT(OutSrcList),
  1583.                  NULL);
  1584.       WinSendMsg(WinWindowFromID(hwndDlg,OUTMAPOPT),
  1585.                  BM_SETCHECK,
  1586.                  MPFROMSHORT(OutMap    ),
  1587.                  NULL);
  1588.       WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJOBJ),
  1589.                  BM_SETCHECK,
  1590.                  MPFROMSHORT(OutObjList),
  1591.                  NULL);
  1592.       WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJASM),
  1593.                  BM_SETCHECK,
  1594.                  MPFROMSHORT(OutAsmList),
  1595.                  NULL);
  1596.       WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJCOM),
  1597.                  BM_SETCHECK,
  1598.                  MPFROMSHORT(OutComList),
  1599.                  NULL);
  1600.       WinSendMsg(WinWindowFromID(hwndDlg,OUTSRCNAME  ),
  1601.                  EM_SETTEXTLIMIT,
  1602.                  MPFROMSHORT(260),
  1603.                  NULL);
  1604.       WinSetWindowText(WinWindowFromID(hwndDlg,OUTSRCNAME ), OutSrcName  );
  1605.       WinSendMsg(WinWindowFromID(hwndDlg,OUTMAPNAME  ),
  1606.                  EM_SETTEXTLIMIT,
  1607.                  MPFROMSHORT(260),
  1608.                  NULL);
  1609.       WinSetWindowText(WinWindowFromID(hwndDlg,OUTMAPNAME ), OutMapName  );
  1610.       WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJFNAME  ),
  1611.                  EM_SETTEXTLIMIT,
  1612.                  MPFROMSHORT(260),
  1613.                  NULL);
  1614.       WinSetWindowText(WinWindowFromID(hwndDlg,OUTOBJFNAME ), OutObjFname );
  1615.       WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJNAME  ),
  1616.                  EM_SETTEXTLIMIT,
  1617.                  MPFROMSHORT(260),
  1618.                  NULL);
  1619.       WinSetWindowText(WinWindowFromID(hwndDlg,OUTOBJNAME ), OutObjName );
  1620.       WinSendMsg(WinWindowFromID(hwndDlg,OUTEXENAME  ),
  1621.                  EM_SETTEXTLIMIT,
  1622.                  MPFROMSHORT(260),
  1623.                  NULL);
  1624.       WinSetWindowText(WinWindowFromID(hwndDlg,OUTEXENAME ), OutExeName );
  1625.       OutfActive = TRUE ;
  1626.       break;
  1627.      case WM_CONTROL:
  1628.        if  (HIUSHORT(mp1)==BN_CLICKED)
  1629.           {
  1630.             switch (LOUSHORT((ULONG)mp1))
  1631.               {
  1632.                case OUTOBJOBJ:
  1633.                   if (WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJOBJ  ),
  1634.                             BM_QUERYCHECK,
  1635.                             NULL,
  1636.                             NULL))
  1637.                   {
  1638.                     WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJASM  ),
  1639.                               BM_SETCHECK,
  1640.                               MPFROMSHORT(0),
  1641.                               NULL);
  1642.                     WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJCOM  ),
  1643.                               BM_SETCHECK,
  1644.                               MPFROMSHORT(0),
  1645.                               NULL);
  1646.                    }
  1647.                break;
  1648.                case OUTOBJASM:
  1649.                   if (WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJASM  ),
  1650.                             BM_QUERYCHECK,
  1651.                             NULL,
  1652.                             NULL))
  1653.                   {
  1654.                     WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJOBJ  ),
  1655.                               BM_SETCHECK,
  1656.                               MPFROMSHORT(0),
  1657.                               NULL);
  1658.                     WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJCOM  ),
  1659.                               BM_SETCHECK,
  1660.                               MPFROMSHORT(0),
  1661.                               NULL);
  1662.                    }
  1663.                break;
  1664.                case OUTOBJCOM:
  1665.                   if (WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJCOM  ),
  1666.                             BM_QUERYCHECK,
  1667.                             NULL,
  1668.                             NULL))
  1669.                   {
  1670.                     WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJOBJ  ),
  1671.                               BM_SETCHECK,
  1672.                               MPFROMSHORT(0),
  1673.                               NULL);
  1674.                     WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJASM  ),
  1675.                               BM_SETCHECK,
  1676.                               MPFROMSHORT(0),
  1677.                               NULL);
  1678.                    }
  1679.                break;
  1680.               }
  1681.           }
  1682.       break;
  1683.    case WM_COMMAND:
  1684.       switch (SHORT1FROMMP(mp1)) {
  1685.          case DID_OK:
  1686.             OutSrcList =SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,OUTSRCOPT   ),
  1687.                        BM_QUERYCHECK,
  1688.                        NULL,
  1689.                        NULL));
  1690.             OutMap     =SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,OUTMAPOPT   ),
  1691.                        BM_QUERYCHECK,
  1692.                        NULL,
  1693.                        NULL));
  1694.             OutObjList =SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJOBJ   ),
  1695.                        BM_QUERYCHECK,
  1696.                        NULL,
  1697.                        NULL));
  1698.             OutAsmList =SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJASM   ),
  1699.                        BM_QUERYCHECK,
  1700.                        NULL,
  1701.                        NULL));
  1702.             OutComList =SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJCOM   ),
  1703.                        BM_QUERYCHECK,
  1704.                        NULL,
  1705.                        NULL));
  1706.             WinQueryWindowText(WinWindowFromID(hwndDlg,OUTSRCNAME      ),
  1707.                       260,
  1708.                       OutSrcName     );
  1709.             WinQueryWindowText(WinWindowFromID(hwndDlg,OUTMAPNAME      ),
  1710.                       260,
  1711.                       OutMapName     );
  1712.             WinQueryWindowText(WinWindowFromID(hwndDlg,OUTOBJFNAME      ),
  1713.                       260,
  1714.                       OutObjFname     );
  1715.             WinQueryWindowText(WinWindowFromID(hwndDlg,OUTOBJNAME      ),
  1716.                       260,
  1717.                       OutObjName     );
  1718.             WinQueryWindowText(WinWindowFromID(hwndDlg,OUTEXENAME      ),
  1719.                       260,
  1720.                       OutExeName     );
  1721.              OutfActive = FALSE;
  1722.              WinDismissDlg(hwndDlg,TRUE);   /* Returns TRUE to WinDlgBox in the Window */
  1723.               break;
  1724.          case DID_CANCEL:
  1725.              OutfActive = FALSE;
  1726.             WinDismissDlg(hwndDlg,FALSE);   /* Returns TRUE to WinDlgBox in the Window */
  1727.             break;
  1728.          case OPTION_DEFAULT:
  1729.             OutSrcList=0;
  1730.             OutMap  =0;
  1731.             OutObjList=0;
  1732.             OutAsmList=0;
  1733.             OutComList=0;
  1734.             OutSrcName[0]=OutExeName[0]=OutObjName[0]=OutMapName[0]=OutObjFname[0]= '\0';
  1735.             WinSendMsg(WinWindowFromID(hwndDlg,OUTSRCOPT),
  1736.                        BM_SETCHECK,
  1737.                        MPFROMSHORT(OutSrcList),
  1738.                        NULL);
  1739.             WinSendMsg(WinWindowFromID(hwndDlg,OUTMAPOPT),
  1740.                        BM_SETCHECK,
  1741.                        MPFROMSHORT(OutMap    ),
  1742.                        NULL);
  1743.             WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJOBJ),
  1744.                        BM_SETCHECK,
  1745.                        MPFROMSHORT(OutObjList),
  1746.                        NULL);
  1747.             WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJASM),
  1748.                        BM_SETCHECK,
  1749.                        MPFROMSHORT(OutAsmList),
  1750.                        NULL);
  1751.             WinSendMsg(WinWindowFromID(hwndDlg,OUTOBJCOM),
  1752.                        BM_SETCHECK,
  1753.                        MPFROMSHORT(OutComList),
  1754.                        NULL);
  1755.             WinSetWindowText(WinWindowFromID(hwndDlg,OUTSRCNAME ), OutSrcName  );
  1756.             WinSetWindowText(WinWindowFromID(hwndDlg,OUTMAPNAME ), OutMapName  );
  1757.             WinSetWindowText(WinWindowFromID(hwndDlg,OUTOBJFNAME ), OutObjFname );
  1758.             WinSetWindowText(WinWindowFromID(hwndDlg,OUTOBJNAME ), OutObjName );
  1759.             WinSetWindowText(WinWindowFromID(hwndDlg,OUTEXENAME ), OutExeName );
  1760.          case OPTION_RESET:
  1761.            break;
  1762.          default:
  1763.          break;
  1764.          } /* endswitch */
  1765.       break;
  1766.      default:
  1767.       return WinDefDlgProc( hwndDlg, msg, mp1, mp2 );
  1768.    } /* endswitch */
  1769.    return FALSE;
  1770. }
  1771.  
  1772. MRESULT EXPENTRY LISTPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2)
  1773. {
  1774.    short Adjust;
  1775.    switch (msg) {
  1776.    case WM_INITDLG:
  1777.       WinQueryWindowRect(hwndDlg,&child);
  1778.       Adjust=(OptActive+CGenActive+CtlActive+PrepActive
  1779.                       +OutfActive+ListActive+SctlActive)*(USHORT)tb.yTop;
  1780.  
  1781.       WinSetWindowPos(hwndDlg,HWND_TOP,(short)(parent.xRight-child.xRight-1)
  1782.                       ,(short)(parent.yTop-tb.yTop-Adjust-child.yTop)
  1783.                       ,0,0,SWP_MOVE | SWP_SHOW);
  1784.       WinSendMsg(WinWindowFromID(hwndDlg,LSTWARN0+LstWarnix),
  1785.                  BM_SETCHECK,
  1786.                  MPFROMSHORT(1),
  1787.                  NULL);
  1788.       WinSendMsg(WinWindowFromID(hwndDlg,LSTLINE ),
  1789.                  EM_SETTEXTLIMIT,
  1790.                  MPFROMSHORT(3),
  1791.                  NULL);
  1792.       WinSetWindowText(WinWindowFromID(hwndDlg,LSTLINE), LstLine);
  1793.       WinSendMsg(WinWindowFromID(hwndDlg,LSTPAGE ),
  1794.                  EM_SETTEXTLIMIT,
  1795.                  MPFROMSHORT(3),
  1796.                  NULL);
  1797.       WinSetWindowText(WinWindowFromID(hwndDlg,LSTPAGE), LstPage);
  1798.       WinSendMsg(WinWindowFromID(hwndDlg,LSTTITLE),
  1799.                  EM_SETTEXTLIMIT,
  1800.                  MPFROMSHORT(99),
  1801.                  NULL);
  1802.       WinSetWindowText(WinWindowFromID(hwndDlg,LSTTITLE), LstTitle);
  1803.       WinSendMsg(WinWindowFromID(hwndDlg,LSTSUBTITLE),
  1804.                  EM_SETTEXTLIMIT,
  1805.                  MPFROMSHORT(99),
  1806.                  NULL);
  1807.       WinSetWindowText(WinWindowFromID(hwndDlg,LSTSUBTITLE), LstSubTitle);
  1808.       ListActive = TRUE;
  1809.  
  1810.       break;
  1811.      case WM_COMMAND:
  1812.  
  1813.       switch (SHORT1FROMMP(mp1)) {
  1814.          case DID_OK:
  1815.             LstWarnix=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,LSTWARN0),
  1816.                        BM_QUERYCHECKINDEX,
  1817.                        NULL,
  1818.                        NULL));
  1819.              --LstWarnix;
  1820.             WinQueryWindowText(WinWindowFromID(hwndDlg,LSTLINE ),
  1821.                      4,
  1822.                      LstLine );
  1823.             WinQueryWindowText(WinWindowFromID(hwndDlg,LSTPAGE ),
  1824.                      4,
  1825.                      LstPage );
  1826.             WinQueryWindowText(WinWindowFromID(hwndDlg,LSTTITLE),
  1827.                      100,
  1828.                      LstTitle);
  1829.             WinQueryWindowText(WinWindowFromID(hwndDlg,LSTSUBTITLE),
  1830.                      100,
  1831.                      LstSubTitle);
  1832.             ListActive = FALSE;
  1833.             WinDismissDlg(hwndDlg,TRUE);   /* Returns TRUE to WinDlgBox in the Window */
  1834.            break;
  1835.       case DID_CANCEL:
  1836.             ListActive = FALSE;
  1837.             WinDismissDlg(hwndDlg,FALSE);   /* Returns TRUE to WinDlgBox in the Window */
  1838.          break;
  1839.       case OPTION_DEFAULT:
  1840.             LstWarnix = 2;
  1841.             LstLine[0]= LstPage[0]= LstTitle[0] = LstSubTitle[0] = '\0';
  1842.             WinSendMsg(WinWindowFromID(hwndDlg,LSTWARN0+LstWarnix),
  1843.                        BM_SETCHECK,
  1844.                        MPFROMSHORT(1),
  1845.                        NULL);
  1846.             WinSetWindowText(WinWindowFromID(hwndDlg,LSTLINE), LstLine);
  1847.             WinSetWindowText(WinWindowFromID(hwndDlg,LSTPAGE), LstPage);
  1848.             WinSetWindowText(WinWindowFromID(hwndDlg,LSTTITLE), LstTitle);
  1849.             WinSetWindowText(WinWindowFromID(hwndDlg,LSTSUBTITLE), LstSubTitle);
  1850.              break;
  1851.       case OPTION_RESET:
  1852.          break;
  1853.       default:
  1854.          break;
  1855.       } /* endswitch */
  1856.       break;
  1857.    default:
  1858.       return WinDefDlgProc( hwndDlg, msg, mp1, mp2 );
  1859.    } /* endswitch */
  1860.    return FALSE;
  1861. }
  1862.  
  1863. MRESULT EXPENTRY SCTLPROC( HWND hwndDlg, USHORT msg, MPARAM mp1, MPARAM mp2)
  1864. {
  1865.    short Adjust;
  1866.    switch (msg) {
  1867.    case WM_INITDLG:
  1868.       WinQueryWindowRect(hwndDlg,&child);
  1869.       Adjust=(OptActive+CGenActive+CtlActive+PrepActive
  1870.                       +OutfActive+ListActive+SctlActive)*(USHORT)tb.yTop;
  1871.  
  1872.       WinSetWindowPos(hwndDlg,HWND_TOP,(short)(parent.xRight-child.xRight-1)
  1873.                       ,(short)(parent.yTop-tb.yTop-Adjust-child.yTop)
  1874.                       ,0,0,SWP_MOVE | SWP_SHOW);
  1875.       WinSendMsg(WinWindowFromID(hwndDlg,SCTLPACK1+SctlPackix),
  1876.                  BM_SETCHECK,
  1877.                  MPFROMSHORT(1),
  1878.                  NULL);
  1879.       WinSendMsg(WinWindowFromID(hwndDlg,SCTLDEXT  ),
  1880.                  BM_SETCHECK,
  1881.                  MPFROMSHORT(SctlDext ),
  1882.                  NULL);
  1883.       WinSendMsg(WinWindowFromID(hwndDlg,SCTLSYNTAX),
  1884.                  BM_SETCHECK,
  1885.                  MPFROMSHORT(SctlSyntax),
  1886.                  NULL);
  1887.       WinSendMsg(WinWindowFromID(hwndDlg,SCTLDECL  ),
  1888.                  BM_SETCHECK,
  1889.                  MPFROMSHORT(SctlDecl  ),
  1890.                  NULL);
  1891.       WinSendMsg(WinWindowFromID(hwndDlg,SCTLCONLY ),
  1892.                  BM_SETCHECK,
  1893.                  MPFROMSHORT(SctlConly ),
  1894.                  NULL);
  1895.       WinSendMsg(WinWindowFromID(hwndDlg,SCTLJ     ),
  1896.                  BM_SETCHECK,
  1897.                  MPFROMSHORT(SctlJ     ),
  1898.                  NULL);
  1899.       WinSendMsg(WinWindowFromID(hwndDlg,SCTLCASEI ),
  1900.                  BM_SETCHECK,
  1901.                  MPFROMSHORT(SctlCaseI  ),
  1902.                  NULL);
  1903.       SctlActive = TRUE;
  1904.       break;
  1905.      case WM_COMMAND:
  1906.  
  1907.       switch (SHORT1FROMMP(mp1)) {
  1908.          case DID_OK:
  1909.             SctlPackix=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,SCTLPACK1),
  1910.                        BM_QUERYCHECKINDEX,
  1911.                        NULL,
  1912.                        NULL));
  1913.              --SctlPackix;
  1914.             SctlDext =SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,SCTLDEXT  ),
  1915.                        BM_QUERYCHECK,
  1916.                        NULL,
  1917.                        NULL));
  1918.             SctlSyntax=SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,SCTLSYNTAX),
  1919.                        BM_QUERYCHECK,
  1920.                        NULL,
  1921.                        NULL));
  1922.             SctlDecl  =SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,SCTLDECL  ),
  1923.                        BM_QUERYCHECK,
  1924.                        NULL,
  1925.                        NULL));
  1926.             SctlConly =SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,SCTLCONLY ),
  1927.                        BM_QUERYCHECK,
  1928.                        NULL,
  1929.                        NULL));
  1930.             SctlJ     =SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,SCTLJ     ),
  1931.                        BM_QUERYCHECK,
  1932.                        NULL,
  1933.                        NULL));
  1934.             SctlCaseI =SHORT1FROMMP(WinSendMsg(WinWindowFromID(hwndDlg,SCTLCASEI ),
  1935.                        BM_QUERYCHECK,
  1936.                        NULL,
  1937.                        NULL));
  1938.             SctlActive = FALSE;
  1939.             WinDismissDlg(hwndDlg,TRUE );   /* Returns TRUE to WinDlgBox in the Window */
  1940.             break;
  1941.          case DID_CANCEL:
  1942.             SctlActive = FALSE;
  1943.             WinDismissDlg(hwndDlg,FALSE);   /* Returns TRUE to WinDlgBox in the Window */
  1944.             break;
  1945.          case OPTION_DEFAULT:
  1946.             SctlDext=0;
  1947.             SctlSyntax=0;
  1948.             SctlDecl=0;
  1949.             SctlConly=0;
  1950.             SctlJ=0;
  1951.             SctlCaseI=0;
  1952.             SctlPackix=2;
  1953.             WinSendMsg(WinWindowFromID(hwndDlg,SCTLPACK1+SctlPackix),
  1954.                        BM_SETCHECK,
  1955.                        MPFROMSHORT(1),
  1956.                        NULL);
  1957.             WinSendMsg(WinWindowFromID(hwndDlg,SCTLDEXT  ),
  1958.                        BM_SETCHECK,
  1959.                        MPFROMSHORT(SctlDext ),
  1960.                        NULL);
  1961.             WinSendMsg(WinWindowFromID(hwndDlg,SCTLSYNTAX),
  1962.                        BM_SETCHECK,
  1963.                        MPFROMSHORT(SctlSyntax),
  1964.                        NULL);
  1965.             WinSendMsg(WinWindowFromID(hwndDlg,SCTLDECL  ),
  1966.                        BM_SETCHECK,
  1967.                        MPFROMSHORT(SctlDecl  ),
  1968.                        NULL);
  1969.             WinSendMsg(WinWindowFromID(hwndDlg,SCTLCONLY ),
  1970.                        BM_SETCHECK,
  1971.                        MPFROMSHORT(SctlConly ),
  1972.                        NULL);
  1973.             WinSendMsg(WinWindowFromID(hwndDlg,SCTLJ     ),
  1974.                        BM_SETCHECK,
  1975.                        MPFROMSHORT(SctlJ     ),
  1976.                        NULL);
  1977.             WinSendMsg(WinWindowFromID(hwndDlg,SCTLCASEI ),
  1978.                        BM_SETCHECK,
  1979.                        MPFROMSHORT(SctlCaseI  ),
  1980.                        NULL);
  1981.  
  1982.             break;
  1983.          case OPTION_RESET:
  1984.            break;
  1985.          default:
  1986.          break;
  1987.          } /* endswitch */
  1988.       break;
  1989.      default:
  1990.       return WinDefDlgProc( hwndDlg, msg, mp1, mp2 );
  1991.    } /* endswitch */
  1992.    return FALSE;
  1993. }
  1994.  
  1995. #define CheckOutlen(increment)                                                 \
  1996. {                                                                              \
  1997.    if ( (ULONG)(outstring+increment-outstringstart) > outlen )                 \
  1998.    {                                                                           \
  1999.       char msg[100];                                                           \
  2000.                                                                                \
  2001.       WinLoadString ( HWND_DESKTOP, handleDLL, MSG_CMPSTRINGSMALL, 100, msg);  \
  2002.                                                                                \
  2003.       WinMessageBox(  HWND_DESKTOP,                                            \
  2004.                       handleWise,                                              \
  2005.                       msg,                                                     \
  2006.                       NULL,                                                    \
  2007.                       MSG_CMPSTRINGSMALL,                                      \
  2008.                       MB_MOVEABLE | MB_OK | MB_ERROR |  MB_APPLMODAL);         \
  2009.                                                                                \
  2010.        returncode = ERRORCONDITION;                                            \
  2011.        return;                                                                 \
  2012.    }                                                                           \
  2013. }
  2014.  
  2015. #define Checkcomplen(increment)                                                \
  2016. {                                                                              \
  2017.    if ( (ULONG)((ULONG)stringtable+increment-(ULONG)ivs) > *complen )          \
  2018.    {                                                                           \
  2019.       char msg[100];                                                           \
  2020.                                                                                \
  2021.       WinLoadString ( HWND_DESKTOP, handleDLL, MSG_CMPOPTSMALL, 100, msg);     \
  2022.                                                                                \
  2023.       WinMessageBox(  HWND_DESKTOP,                                            \
  2024.                       handleWise,                                              \
  2025.                       msg,                                                     \
  2026.                       NULL,                                                    \
  2027.                       MSG_CMPOPTSMALL,                                         \
  2028.                       MB_MOVEABLE | MB_OK | MB_ERROR |  MB_APPLMODAL);         \
  2029.                                                                                \
  2030.        returncode = ERRORCONDITION;                                            \
  2031.        return;                                                                 \
  2032.    }                                                                           \
  2033. }
  2034.  
  2035. static void ReturnOutputString(void)
  2036. {
  2037.      USHORT offset;
  2038.      int i, invcount;
  2039.      char * work;
  2040.      char * work2;
  2041.      char * stringtable;
  2042.      char * stringstart;
  2043.      char * outstringstart;
  2044.      ivs->stringtablestart[0]='\0';
  2045.      outstringstart = outstring;
  2046.      stringtable = ivs->stringtablestart+1;
  2047.      stringstart = ivs->stringtablestart;
  2048.      ivs->optmax    = Optall;
  2049.      ivs->optnone   = OptNone;
  2050.      ivs->optspeed  = OptOptions[0] ;
  2051.      ivs->optloop   = OptOptions[1] ;
  2052.      ivs->optprecise= OptOptions[2] ;
  2053.      ivs->optaliasfn= OptOptions[3] ;
  2054.      ivs->optspace  = OptOptions[4] ;
  2055.      ivs->optialias = OptOptions[5] ;
  2056.      ivs->optintrins= OptOptions[6] ;
  2057.      ivs->optunsafe = OptOptions[7] ;
  2058.      ivs->optinliner= OptOptions[8] ;
  2059.      if (ivs->optmax    )
  2060.        {
  2061.         CheckOutlen(4);
  2062.         strcpy(outstring,"/Ox ");
  2063.         outstring +=4;
  2064.        }
  2065.      else if (ivs->optnone   )
  2066.        {
  2067.         CheckOutlen(4);
  2068.         strcpy(outstring,"/Od ");
  2069.         outstring +=4;
  2070.        }
  2071.      else
  2072.       {
  2073.        CheckOutlen(2);
  2074.        strcpy(outstring,"/O");
  2075.        outstring +=2;
  2076.        if (ivs->optspeed  )
  2077.         {
  2078.           CheckOutlen(1);
  2079.           *outstring='t';
  2080.           ++outstring;
  2081.         }
  2082.        if (ivs->optloop   )
  2083.         {
  2084.           CheckOutlen(1);
  2085.           *outstring='l';
  2086.           ++outstring;
  2087.         }
  2088.        if (ivs->optprecise)
  2089.         {
  2090.           CheckOutlen(1);
  2091.           *outstring='p';
  2092.           ++outstring;
  2093.         }
  2094.        if (ivs->optaliasfn)
  2095.         {
  2096.           CheckOutlen(1);
  2097.           *outstring='w';
  2098.           ++outstring;
  2099.         }
  2100.        if (ivs->optspace  )
  2101.         {
  2102.           CheckOutlen(1);
  2103.           *outstring='s';
  2104.           ++outstring;
  2105.         }
  2106.        if (ivs->optialias )
  2107.         {
  2108.           CheckOutlen(1);
  2109.           *outstring='a';
  2110.           ++outstring;
  2111.         }
  2112.        if (ivs->optintrins)
  2113.         {
  2114.           CheckOutlen(1);
  2115.           *outstring='i';
  2116.           ++outstring;
  2117.         }
  2118.        if (ivs->optunsafe )
  2119.         {
  2120.           CheckOutlen(1);
  2121.           *outstring='n';
  2122.           ++outstring;
  2123.         }
  2124.        if (ivs->optinliner)
  2125.         {
  2126.           CheckOutlen(1);
  2127.           *outstring='r';
  2128.           ++outstring;
  2129.         }
  2130.        CheckOutlen(1);
  2131.        *outstring =' ';
  2132.        ++outstring;
  2133.       }
  2134.      ivs->PascalLink = GenPascal    ;
  2135.      ivs->PMLink     = GenPm        ;
  2136.      ivs->NoStackPrb = GenNstack    ;
  2137.      ivs->StringinCs = GenConst     ;
  2138.      ivs->DataThresh = Genthresh    ;
  2139.      ivs->MemoryModel= GenModelix   ;
  2140.      ivs->FloatOption= GenFloatix   ;
  2141.      ivs->CustModelCode=GenCustCodeix;
  2142.      ivs->CustModelData=GenCustDataix;
  2143.      ivs->CustModelSetS=GenCustSegmix;
  2144.      if (Genthresh==0 || Genthreshamount[0]=='\0')
  2145.          ivs->DataThreshAmt=0;
  2146.      else
  2147.          ivs->DataThreshAmt=(USHORT)atoi(Genthreshamount);
  2148.  
  2149.      if (GenPascal  )
  2150.       {
  2151.         CheckOutlen(4);
  2152.         strcpy(outstring,"/Gc ");
  2153.         outstring+=4;
  2154.       }
  2155.      if (GenPm      )
  2156.       {
  2157.         CheckOutlen(4);
  2158.         strcpy(outstring,"/Gw ");
  2159.         outstring+=4;
  2160.       }
  2161.      if (GenNstack  )
  2162.       {
  2163.         CheckOutlen(5);
  2164.         strcpy(outstring,"/G2s ");
  2165.         outstring+=5;
  2166.       }
  2167.      else
  2168.       {
  2169.         CheckOutlen(4);
  2170.         strcpy(outstring,"/G2 ");
  2171.         outstring+=4;
  2172.       }
  2173.      if (GenConst   )
  2174.       {
  2175.         CheckOutlen(4);
  2176.         strcpy(outstring,"/Gm ");
  2177.         outstring+=4;
  2178.       }
  2179.      if (Genthresh  )
  2180.       {
  2181.         CheckOutlen(3);
  2182.         strcpy(outstring,"/Gt");
  2183.         outstring+=3;
  2184.         if (ivs->DataThreshAmt!=0)
  2185.          {
  2186.           CheckOutlen(strlen(Genthreshamount));
  2187.           strcat(outstring,Genthreshamount);
  2188.           outstring += strlen(Genthreshamount);
  2189.          }
  2190.         CheckOutlen(1);
  2191.         *outstring = ' ';
  2192.         outstring++;
  2193.       }
  2194.  
  2195.       switch (ivs->MemoryModel)
  2196.       {
  2197.           case 0:
  2198.              break;
  2199.           case 1:
  2200.             CheckOutlen(4);
  2201.             strcpy(outstring,"/AM ");
  2202.             outstring+=4;
  2203.              break;
  2204.           case 2:
  2205.             CheckOutlen(4);
  2206.             strcpy(outstring,"/AC ");
  2207.             outstring+=4;
  2208.              break;
  2209.           case 3:
  2210.             CheckOutlen(4);
  2211.             strcpy(outstring,"/AL ");
  2212.             outstring+=4;
  2213.              break;
  2214.           case 4:
  2215.             CheckOutlen(4);
  2216.             strcpy(outstring,"/AH ");
  2217.             outstring+=4;
  2218.              break;
  2219.           case 5:
  2220.             CheckOutlen(2);
  2221.              strcpy(outstring,"/A");
  2222.              outstring+=2;
  2223.              if (ivs->CustModelCode==0)
  2224.                {
  2225.                  CheckOutlen(1);
  2226.                  *outstring='s';
  2227.                  ++outstring;
  2228.                }
  2229.              else
  2230.                {
  2231.                  CheckOutlen(1);
  2232.                  *outstring='l';
  2233.                  ++outstring;
  2234.                }
  2235.              if (ivs->CustModelData==0)
  2236.                {
  2237.                  CheckOutlen(1);
  2238.                  *outstring='n';
  2239.                  ++outstring;
  2240.                }
  2241.              else if (ivs->CustModelData==1)
  2242.                   {
  2243.                     CheckOutlen(1);
  2244.                     *outstring='f';
  2245.                     ++outstring;
  2246.                   }
  2247.                   else
  2248.                   {
  2249.                     CheckOutlen(1);
  2250.                     *outstring='h';
  2251.                     ++outstring;
  2252.                   }
  2253.              if (ivs->CustModelSetS==0)
  2254.                {
  2255.                  CheckOutlen(1);
  2256.                  *outstring='d';
  2257.                  ++outstring;
  2258.                }
  2259.              else if (ivs->CustModelSetS==1)
  2260.                   {
  2261.                     CheckOutlen(1);
  2262.                     *outstring='u';
  2263.                     ++outstring;
  2264.                   }
  2265.                   else
  2266.                   {
  2267.                     CheckOutlen(1);
  2268.                     *outstring='w';
  2269.                     ++outstring;
  2270.                   }
  2271.              CheckOutlen(1);
  2272.              *outstring =' ';
  2273.              outstring++;
  2274.              break;
  2275.       }
  2276.       switch (ivs->FloatOption )
  2277.       {
  2278.          case 0:
  2279.            CheckOutlen(5);
  2280.            strcpy(outstring,"/FPa ");
  2281.            outstring+=5;
  2282.            break;
  2283.          case 1:
  2284.            CheckOutlen(5);
  2285.            strcpy(outstring,"/FPc ");
  2286.            outstring+=5;
  2287.            break;
  2288.          case 2:
  2289.            CheckOutlen(7);
  2290.            strcpy(outstring,"/FPc87 ");
  2291.            outstring+=7;
  2292.            break;
  2293.          case 3:
  2294.            break;
  2295.          case 4:
  2296.            CheckOutlen(7);
  2297.            strcpy(outstring,"/FPi87 ");
  2298.            outstring+=7;
  2299.            break;
  2300.       }
  2301.  
  2302.  
  2303.  
  2304.  
  2305.      ivs->ObjectisExe =CtlObjTypeix ;
  2306.      ivs->RemoveDefLib=CtlDefLib    ;
  2307.      ivs->UseB1       =CtlUseB1     ;
  2308.      ivs->DebLineNum  =CtlDebLine   ;
  2309.      ivs->DebSymDeb   =CtlDebSym    ;
  2310.      if (ivs->ObjectisExe==1)
  2311.       {
  2312.         CheckOutlen(6);
  2313.         strcpy(outstring,"/DDLL ");
  2314.         outstring+=6;
  2315.       }
  2316.      if (ivs->RemoveDefLib)
  2317.       {
  2318.         CheckOutlen(4);
  2319.         strcpy(outstring,"/Zl ");
  2320.         outstring+=4;
  2321.       }
  2322.      if (ivs->UseB1       )
  2323.       {
  2324.         CheckOutlen(12);
  2325.         strcpy(outstring,"/B1 C1L.EXE ");
  2326.         outstring+=12;
  2327.       }
  2328.      if (ivs->DebLineNum  )
  2329.       {
  2330.         CheckOutlen(4);
  2331.         strcpy(outstring,"/Zd ");
  2332.         outstring+=4;
  2333.       }
  2334.      if (ivs->DebSymDeb   )
  2335.       {
  2336.         CheckOutlen(4);
  2337.         strcpy(outstring,"/Zi ");
  2338.         outstring+=4;
  2339.       }
  2340.  
  2341.       ivs->ExternNameLgth=atoi(CtlNameLen);
  2342.       if (ivs->ExternNameLgth !=0 && ivs->ExternNameLgth != 31)
  2343.        {
  2344.         CheckOutlen(2);
  2345.         strcpy(outstring,"/H");
  2346.         outstring+=2;
  2347.         CheckOutlen(strlen(CtlNameLen));
  2348.         strcpy(outstring,CtlNameLen);
  2349.         outstring+=strlen(CtlNameLen);
  2350.        }
  2351.  
  2352.  
  2353.      if (CtlVersion[0]=='\0')
  2354.         ivs->VersionStringoff= 0;
  2355.      else
  2356.        {
  2357.         CheckOutlen(2);
  2358.         strcpy(outstring,"/V");
  2359.         outstring +=2;
  2360.         CheckOutlen(strlen(CtlVersion));
  2361.         strcpy(outstring,CtlVersion);
  2362.         outstring +=strlen(CtlVersion);
  2363.         CheckOutlen(1);
  2364.         *outstring = ' ';
  2365.         ++outstring;
  2366.         offset = (USHORT)(stringtable-stringstart);
  2367.         Checkcomplen(strlen(CtlVersion)+1);
  2368.         work = CtlVersion;
  2369.         while (*work != '\0')
  2370.          {
  2371.            *stringtable=*work;
  2372.            ++stringtable;
  2373.            ++work;
  2374.          }
  2375.            *stringtable='\0';
  2376.            ++stringtable;
  2377.         ivs->VersionStringoff= offset;
  2378.  
  2379.        }
  2380.      if (CtlDataSeg[0]=='\0')
  2381.         ivs->DsegNameoff= 0;
  2382.      else
  2383.        {
  2384.         CheckOutlen(3);
  2385.         strcpy(outstring,"/ND");
  2386.         outstring +=3;
  2387.         CheckOutlen(strlen(CtlDataSeg));
  2388.         strcpy(outstring,CtlDataSeg);
  2389.         outstring +=strlen(CtlDataSeg);
  2390.         CheckOutlen(1);
  2391.         *outstring = ' ';
  2392.         ++outstring;
  2393.         offset = (USHORT)(stringtable-stringstart);
  2394.         Checkcomplen(strlen(CtlDataSeg)+1);
  2395.         work = CtlDataSeg;
  2396.         while (*work != '\0')
  2397.          {
  2398.            *stringtable=*work;
  2399.            ++stringtable;
  2400.            ++work;
  2401.          }
  2402.            *stringtable='\0';
  2403.            ++stringtable;
  2404.         ivs->DsegNameoff= offset;
  2405.  
  2406.        }
  2407.      if (CtlCodeSeg[0]=='\0')
  2408.         ivs->CsegNameoff= 0;
  2409.      else
  2410.        {
  2411.         CheckOutlen(3);
  2412.         strcpy(outstring,"/NT");
  2413.         outstring +=3;
  2414.         CheckOutlen(strlen(CtlCodeSeg));
  2415.         strcpy(outstring,CtlCodeSeg);
  2416.         outstring +=strlen(CtlCodeSeg);
  2417.         CheckOutlen(1);
  2418.         *outstring = ' ';
  2419.         ++outstring;
  2420.         offset = (USHORT)(stringtable-stringstart);
  2421.         Checkcomplen(strlen(CtlCodeSeg)+1);
  2422.         work = CtlCodeSeg;
  2423.         while (*work != '\0')
  2424.          {
  2425.            *stringtable=*work;
  2426.            ++stringtable;
  2427.            ++work;
  2428.          }
  2429.            *stringtable='\0';
  2430.            ++stringtable;
  2431.         ivs->CsegNameoff= offset;
  2432.  
  2433.        }
  2434.  
  2435.      if (boolLstFile==1)
  2436.         {
  2437.         ivs->Prepoutput=1;
  2438.         CheckOutlen(3);
  2439.         strcpy(outstring,"/P ");
  2440.         outstring+=3;
  2441.         }
  2442.      else
  2443.        if (boolListSOWL==1)
  2444.         {
  2445.         ivs->Prepoutput=2;
  2446.         CheckOutlen(3);
  2447.         strcpy(outstring,"/E ");
  2448.         outstring+=3;
  2449.         }
  2450.      else
  2451.        if (boolListSONL==1)
  2452.         {
  2453.         ivs->Prepoutput=3;
  2454.         CheckOutlen(4);
  2455.         strcpy(outstring,"/EP ");
  2456.         outstring+=4;
  2457.         }
  2458.         else
  2459.           ivs->Prepoutput=0;
  2460.  
  2461.  
  2462.  
  2463.      ivs->SaveComments= boolPrepComment;
  2464.      ivs->ExcludeStd  = boolPrepExclude;
  2465.      ivs->UndefineAll = boolPrepUndAll ;
  2466.  
  2467.      if (ivs->SaveComments)
  2468.       {
  2469.         CheckOutlen(3);
  2470.         strcpy(outstring,"/C ");
  2471.         outstring+=3;
  2472.       }
  2473.      if (ivs->ExcludeStd  )
  2474.       {
  2475.         CheckOutlen(3);
  2476.         strcpy(outstring,"/X ");
  2477.         outstring+=3;
  2478.       }
  2479.      if (ivs->UndefineAll )
  2480.       {
  2481.         CheckOutlen(3);
  2482.         strcpy(outstring,"/x ");
  2483.         outstring+=3;
  2484.       }
  2485.  
  2486.  
  2487.      ivs->NumIncludePaths=PrepInclCount ;
  2488.      if (ivs->NumIncludePaths==0)
  2489.        ivs->IncludePathoff = 0;
  2490.      else
  2491.       {
  2492.        offset=(USHORT)(stringtable-stringstart);
  2493.        i=0;
  2494.        invcount=0;
  2495.        while (i<PrepInclCount)
  2496.        {
  2497.          work2=PrepIncludeDir[i];
  2498.          if (*work2 == '\0' || *work2 == 0x0D || *work2 == 0x0D)
  2499.          {
  2500.             ++invcount;
  2501.          } /* endif */
  2502.          else
  2503.          {
  2504.            CheckOutlen(2);
  2505.            strcpy(outstring,"/I");
  2506.            outstring+=2;
  2507.            while (*work2 != '\0' && *work2 != 0x0D && *work2 != 0x0D)
  2508.             {
  2509.                CheckOutlen(1);
  2510.                Checkcomplen(1);
  2511.                *outstring=*work2;
  2512.                *stringtable=*work2;
  2513.                ++outstring;
  2514.                ++stringtable;
  2515.                ++work2;
  2516.             }
  2517.             Checkcomplen(1);
  2518.             *stringtable='\0';
  2519.             ++stringtable;
  2520.             CheckOutlen(1);
  2521.             *outstring  =' ';
  2522.             ++outstring  ;
  2523.          }
  2524.             ++i;
  2525.        ivs->IncludePathoff=offset;
  2526.        }
  2527.        ivs->NumIncludePaths -=invcount;
  2528.       }
  2529.  
  2530.  
  2531.      ivs->NumDefinedMacros = PrepDefCount  ;
  2532.  
  2533.      if (ivs->NumDefinedMacros ==0)
  2534.        ivs->DefinedMacrooff= 0;
  2535.      else
  2536.       {
  2537.        offset =(USHORT)(stringtable-stringstart);
  2538.        i=0;
  2539.        invcount=0;
  2540.        while ((USHORT)i<ivs->NumDefinedMacros)
  2541.        {
  2542.          work2=PrepDefines[i];
  2543.          if (*work2 == '\0' || *work2 == 0x0D || *work2 == 0x0D)
  2544.          {
  2545.             ++invcount;
  2546.          } /* endif */
  2547.          else
  2548.          {
  2549.            CheckOutlen(2);
  2550.            strcpy(outstring,"/D");
  2551.            outstring+=2;
  2552.            while (*work2 != '\0' && *work2 != 0x0D && *work2 != 0x0D)
  2553.             {
  2554.                CheckOutlen(1);
  2555.                Checkcomplen(1);
  2556.                *outstring=*work2;
  2557.                *stringtable=*work2;
  2558.                ++outstring;
  2559.                ++stringtable;
  2560.                ++work2;
  2561.             }
  2562.             Checkcomplen(1);
  2563.             *stringtable='\0';
  2564.             ++stringtable;
  2565.             CheckOutlen(1);
  2566.             *outstring  =' ';
  2567.             ++outstring  ;
  2568.           }
  2569.             ++i;
  2570.        ivs->DefinedMacrooff =offset;
  2571.        }
  2572.        ivs->NumDefinedMacros -=invcount;
  2573.       }
  2574.  
  2575.  
  2576.      ivs->NumUnDefinedMacros = PrepUnDefCount ;
  2577.      if (ivs->NumUnDefinedMacros ==0)
  2578.        ivs->UnDefinedMacrooff= 0;
  2579.      else
  2580.       {
  2581.        offset =(USHORT)(stringtable-stringstart);
  2582.        i=0;
  2583.        invcount=0;
  2584.        while ((USHORT)i<ivs->NumUnDefinedMacros)
  2585.        {
  2586.          work2=PrepUndefines[i];
  2587.          if (*work2 == '\0' || *work2 == 0x0D || *work2 == 0x0D)
  2588.          {
  2589.             ++invcount;
  2590.          } /* endif */
  2591.          else
  2592.          {
  2593.            CheckOutlen(2);
  2594.            strcpy(outstring,"/U");
  2595.            outstring+=2;
  2596.            while (*work2 != '\0' && *work2 != 0x0D && *work2 != 0x0D)
  2597.             {
  2598.                CheckOutlen(1);
  2599.                Checkcomplen(1);
  2600.                *outstring=*work2;
  2601.                *stringtable=*work2;
  2602.                ++outstring;
  2603.                ++stringtable;
  2604.                ++work2;
  2605.             }
  2606.             Checkcomplen(1);
  2607.             *stringtable='\0';
  2608.             ++stringtable;
  2609.             CheckOutlen(1);
  2610.             *outstring  =' ';
  2611.             ++outstring  ;
  2612.           }
  2613.             ++i;
  2614.        ivs->UnDefinedMacrooff =offset;
  2615.        }
  2616.        ivs->NumUnDefinedMacros -=invcount;
  2617.       }
  2618.  
  2619.  
  2620.  
  2621.      ivs->SrcListRequired=OutSrcList ;
  2622.      ivs->MapFileRequired=OutMap     ;
  2623.      if (ivs->SrcListRequired)
  2624.       {
  2625.         CheckOutlen(3);
  2626.         strcpy(outstring,"/Fs");
  2627.         outstring+=3;
  2628.         if (OutSrcName[0]=='\0')
  2629.         {
  2630.          ivs->SrcListFileoff = 0;
  2631.         }
  2632.         else
  2633.         {
  2634.          offset = (USHORT)(stringtable-stringstart);
  2635.          work2=OutSrcName;
  2636.          while (*work2 != '\0')
  2637.           {
  2638.              CheckOutlen(1);
  2639.              Checkcomplen(1);
  2640.              *outstring=*work2;
  2641.              *stringtable=*work2;
  2642.              ++outstring;
  2643.              ++stringtable;
  2644.              ++work2;
  2645.           }
  2646.           Checkcomplen(1);
  2647.           *stringtable='\0';
  2648.           ++stringtable;
  2649.          ivs->SrcListFileoff = offset;
  2650.         }
  2651.         CheckOutlen(1);
  2652.         *outstring=' ';
  2653.         ++outstring;
  2654.       }
  2655.      else
  2656.       {
  2657.       ivs->SrcListFileoff = 0;
  2658.       }
  2659.  
  2660.      if (ivs->MapFileRequired)
  2661.       {
  2662.         CheckOutlen(3);
  2663.         strcpy(outstring,"/Fm");
  2664.         outstring+=3;
  2665.         if (OutMapName[0]=='\0')
  2666.         {
  2667.          ivs->MapListFileoff = 0;
  2668.         }
  2669.         else
  2670.         {
  2671.          offset = (USHORT)(stringtable-stringstart);
  2672.          work2=OutMapName;
  2673.          while (*work2 != '\0')
  2674.           {
  2675.              CheckOutlen(1);
  2676.              Checkcomplen(1);
  2677.              *outstring=*work2;
  2678.              *stringtable=*work2;
  2679.              ++outstring;
  2680.              ++stringtable;
  2681.              ++work2;
  2682.           }
  2683.           Checkcomplen(1);
  2684.           *stringtable='\0';
  2685.           ++stringtable;
  2686.           ivs->MapListFileoff = offset;
  2687.         }
  2688.         CheckOutlen(1);
  2689.         *outstring=' ';
  2690.         ++outstring;
  2691.       }
  2692.      else
  2693.       {
  2694.       ivs->MapListFileoff = 0;
  2695.       }
  2696.  
  2697.  
  2698.  
  2699.  
  2700.      if (OutObjList==1)
  2701.        {
  2702.  
  2703.         ivs->ObjectListReq = 1;
  2704.         CheckOutlen(3);
  2705.         strcpy(outstring,"/Fl");
  2706.         outstring+=3;
  2707.         if (OutObjFname[0]=='\0')
  2708.         {
  2709.          ivs->ObjListFileoff = 0;
  2710.         }
  2711.         else
  2712.         {
  2713.          offset = (USHORT)(stringtable-stringstart);
  2714.          work2=OutObjFname;
  2715.          while (*work2 != '\0')
  2716.           {
  2717.              CheckOutlen(1);
  2718.              Checkcomplen(1);
  2719.              *outstring=*work2;
  2720.              *stringtable=*work2;
  2721.              ++outstring;
  2722.              ++stringtable;
  2723.              ++work2;
  2724.           }
  2725.           Checkcomplen(1);
  2726.           *stringtable='\0';
  2727.           ++stringtable;
  2728.           ivs->ObjListFileoff = offset;
  2729.         }
  2730.         CheckOutlen(1);
  2731.         *outstring=' ';
  2732.         ++outstring;
  2733.        }
  2734.      else
  2735.      if (OutAsmList==1)
  2736.        {
  2737.  
  2738.         ivs->ObjectListReq = 2;
  2739.         CheckOutlen(3);
  2740.         strcpy(outstring,"/Fa");
  2741.         outstring+=3;
  2742.         if (OutObjFname[0]=='\0')
  2743.         {
  2744.          ivs->ObjListFileoff = 0;
  2745.         }
  2746.         else
  2747.         {
  2748.          offset = (USHORT)(stringtable-stringstart);
  2749.          work2=OutObjFname;
  2750.          while (*work2 != '\0')
  2751.           {
  2752.              CheckOutlen(1);
  2753.              Checkcomplen(1);
  2754.              *outstring=*work2;
  2755.              *stringtable=*work2;
  2756.              ++outstring;
  2757.              ++stringtable;
  2758.              ++work2;
  2759.           }
  2760.           Checkcomplen(1);
  2761.           *stringtable='\0';
  2762.           ++stringtable;
  2763.           ivs->ObjListFileoff = offset;
  2764.         }
  2765.         CheckOutlen(1);
  2766.         *outstring=' ';
  2767.         ++outstring;
  2768.        }
  2769.      else
  2770.      if (OutComList==1)
  2771.        {
  2772.  
  2773.         ivs->ObjectListReq = 3;
  2774.         CheckOutlen(3);
  2775.         strcpy(outstring,"/Fc");
  2776.         outstring+=3;
  2777.         if (OutObjFname[0]=='\0')
  2778.         {
  2779.          ivs->ObjListFileoff = 0;
  2780.         }
  2781.         else
  2782.         {
  2783.          offset = (USHORT)(stringtable-stringstart);
  2784.          work2=OutObjFname;
  2785.          while (*work2 != '\0')
  2786.           {
  2787.              CheckOutlen(1);
  2788.              Checkcomplen(1);
  2789.              *outstring=*work2;
  2790.              *stringtable=*work2;
  2791.              ++outstring;
  2792.              ++stringtable;
  2793.              ++work2;
  2794.           }
  2795.           Checkcomplen(1);
  2796.           *stringtable='\0';
  2797.           ++stringtable;
  2798.           ivs->ObjListFileoff = offset;
  2799.         }
  2800.         CheckOutlen(1);
  2801.         *outstring=' ';
  2802.         ++outstring;
  2803.        }
  2804.      else
  2805.        {
  2806.          ivs->ObjectListReq = 0;
  2807.          ivs->ObjListFileoff = 0;
  2808.        }
  2809.  
  2810.  
  2811.      if (*OutObjName=='\0')
  2812.         ivs->ObjFileNameoff=0;
  2813.      else
  2814.       {
  2815.          CheckOutlen(3);
  2816.          strcpy(outstring,"/Fo");
  2817.          outstring+=3;
  2818.          offset = (USHORT)(stringtable-stringstart);
  2819.          work2=OutObjName;
  2820.          while (*work2 != '\0')
  2821.           {
  2822.              CheckOutlen(1);
  2823.              Checkcomplen(1);
  2824.              *outstring=*work2;
  2825.              *stringtable=*work2;
  2826.              ++outstring;
  2827.              ++stringtable;
  2828.              ++work2;
  2829.           }
  2830.           Checkcomplen(1);
  2831.           *stringtable='\0';
  2832.           ++stringtable;
  2833.           CheckOutlen(1);
  2834.           *outstring=' ';
  2835.           ++outstring;
  2836.           ivs->ObjFileNameoff = offset;
  2837.       }
  2838.  
  2839.  
  2840.      if (*OutExeName=='\0')
  2841.         ivs->ExeFileNameoff=0;
  2842.      else
  2843.       {
  2844.          CheckOutlen(3);
  2845.          strcpy(outstring,"/Fe");
  2846.          outstring+=3;
  2847.          offset = (USHORT)(stringtable-stringstart);
  2848.          work2=OutExeName;
  2849.          while (*work2 != '\0')
  2850.           {
  2851.              CheckOutlen(1);
  2852.              Checkcomplen(1);
  2853.              *outstring=*work2;
  2854.              *stringtable=*work2;
  2855.              ++outstring;
  2856.              ++stringtable;
  2857.              ++work2;
  2858.           }
  2859.           Checkcomplen(1);
  2860.           *stringtable='\0';
  2861.           ++stringtable;
  2862.           CheckOutlen(1);
  2863.           *outstring=' ';
  2864.           ++outstring;
  2865.           ivs->ExeFileNameoff = offset;
  2866.       }
  2867.  
  2868.  
  2869.      ivs->WarningLevel = LstWarnix  ;
  2870.      if (LstWarnix != 2)
  2871.        {
  2872.          CheckOutlen(4);
  2873.          sprintf(outstring,"/W%d ",LstWarnix);
  2874.          outstring+=4;
  2875.        }
  2876.  
  2877.      if (LstLine[0]== '\0')
  2878.         ivs->LineWidth=0 ;
  2879.      else
  2880.       {
  2881.         ivs->LineWidth=atoi(LstLine);
  2882.         CheckOutlen(3);
  2883.         strcpy(outstring,"/Sl");
  2884.         outstring+=3;
  2885.         CheckOutlen(strlen(LstLine));
  2886.         strcpy(outstring,LstLine);
  2887.         outstring+=strlen(LstLine);
  2888.         CheckOutlen(1);
  2889.         *outstring=' ';
  2890.         ++outstring;
  2891.       }
  2892.      if (LstPage[0]== '\0')
  2893.         ivs->PageLength=0 ;
  2894.      else
  2895.       {
  2896.         ivs->PageLength=atoi(LstPage);
  2897.         CheckOutlen(3);
  2898.         strcpy(outstring,"/Sp");
  2899.         outstring+=3;
  2900.         CheckOutlen(strlen(LstPage));
  2901.         strcpy(outstring,LstPage);
  2902.         outstring+=strlen(LstPage);
  2903.         CheckOutlen(1);
  2904.         *outstring=' ';
  2905.         ++outstring;
  2906.  
  2907.       }
  2908.      if (*LstTitle  =='\0')
  2909.         ivs->Titlestringoff=0;
  2910.      else
  2911.       {
  2912.          CheckOutlen(3);
  2913.          strcpy(outstring,"/St");
  2914.          outstring+=3;
  2915.          offset = (USHORT)(stringtable-stringstart);
  2916.          work2=LstTitle;
  2917.          while (*work2 != '\0')
  2918.           {
  2919.              CheckOutlen(1);
  2920.              Checkcomplen(1);
  2921.              *outstring=*work2;
  2922.              *stringtable=*work2;
  2923.              ++outstring;
  2924.              ++stringtable;
  2925.              ++work2;
  2926.           }
  2927.           Checkcomplen(1);
  2928.           *stringtable='\0';
  2929.           ++stringtable;
  2930.           CheckOutlen(1);
  2931.           *outstring=' ';
  2932.           ++outstring;
  2933.           ivs->Titlestringoff = offset;
  2934.       }
  2935.      if (*LstSubTitle  =='\0')
  2936.         ivs->SubTitlestringoff=0;
  2937.      else
  2938.       {
  2939.          CheckOutlen(3);
  2940.          strcpy(outstring,"/Ss");
  2941.          outstring+=3;
  2942.          offset = (USHORT)(stringtable-stringstart);
  2943.          work2=LstSubTitle;
  2944.          while (*work2 != '\0')
  2945.           {
  2946.              CheckOutlen(1);
  2947.              Checkcomplen(1);
  2948.              *outstring=*work2;
  2949.              *stringtable=*work2;
  2950.              ++outstring;
  2951.              ++stringtable;
  2952.              ++work2;
  2953.           }
  2954.           Checkcomplen(1);
  2955.           *stringtable='\0';
  2956.           ++stringtable;
  2957.           CheckOutlen(1);
  2958.           *outstring=' ';
  2959.           ++outstring;
  2960.           ivs->SubTitlestringoff = offset;
  2961.  
  2962.       }
  2963.       ivs->CompileOnly    =SctlConly  ;
  2964.       ivs->SyntaxCheck    =SctlSyntax ;
  2965.       ivs->GenerateDecl   =SctlDecl   ;
  2966.       ivs->DisableExten   =SctlDext   ;
  2967.       ivs->CharisUnsigned =SctlJ      ;
  2968.       ivs->CaseInsensitive=SctlCaseI  ;
  2969.       ivs->StructPack     =SctlPackix ;
  2970.       if (ivs->CompileOnly    )
  2971.        {
  2972.          CheckOutlen(3);
  2973.          strcpy(outstring,"/c ");
  2974.          outstring+=3;
  2975.        }
  2976.  
  2977.       if (ivs->SyntaxCheck    )
  2978.        {
  2979.          CheckOutlen(4);
  2980.          strcpy(outstring,"/Zs ");
  2981.          outstring+=4;
  2982.        }
  2983.       if (ivs->GenerateDecl   )
  2984.        {
  2985.          CheckOutlen(4);
  2986.          strcpy(outstring,"/Zg ");
  2987.          outstring+=4;
  2988.        }
  2989.       if (ivs->DisableExten   )
  2990.        {
  2991.          CheckOutlen(4);
  2992.          strcpy(outstring,"/Za ");
  2993.          outstring+=4;
  2994.        }
  2995.       if (ivs->CharisUnsigned )
  2996.        {
  2997.          CheckOutlen(3);
  2998.          strcpy(outstring,"/J ");
  2999.          outstring+=3;
  3000.        }
  3001.       if (ivs->CaseInsensitive)
  3002.        {
  3003.          CheckOutlen(4);
  3004.          strcpy(outstring,"/Zc ");
  3005.          outstring+=4;
  3006.        }
  3007.       if (ivs->StructPack==0  )
  3008.        {
  3009.          CheckOutlen(5);
  3010.          strcpy(outstring,"/Zp1 ");
  3011.          outstring+=5;
  3012.        }
  3013.       else
  3014.       if (ivs->StructPack==1  )
  3015.        {
  3016.          CheckOutlen(5);
  3017.          strcpy(outstring,"/Zp2 ");
  3018.          outstring+=5;
  3019.        }
  3020.       CheckOutlen(1);
  3021.       *outstring='\0'  ;
  3022.       if (saveFilename != NULL)
  3023.       {
  3024.         CheckOutlen(strlen(saveFilename)+1);
  3025.         strcat(outstringstart,saveFilename);
  3026.       }
  3027.       *complen=(ULONG)stringtable-(ULONG)ivs+1L;
  3028.  
  3029. }
  3030.