home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / compile.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-30  |  15.6 KB  |  581 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. /*  Compile.c  */
  22.  
  23. #include <externs.h>
  24.  
  25. extern void AVL_MAKE_UNIT_DATE(AVL_EDIT_WINDOW_PTR w);
  26.  
  27. char *AVL_RUN_SELECT(AVL_UNITDT_PTR w)
  28. {
  29.     AVL_WIN_PTR temp = NULL, temp2 = NULL;
  30.     short rows, cols;
  31.     int i, j, k, n = 0, nc = 0;
  32.  
  33.     char msg[50];
  34.     char *ru;
  35.  
  36.     static AVL_BIND_SIZE r[50];
  37.     AVL_BIND_SIZE c[50];
  38.      
  39.     /* Pick obsolete units for compilation */
  40.     for(i = 0; i < w -> ns && n < 50; ++i)  
  41.         if (w -> s[i].status == 'A' && w -> s[i].is_main == ' ' &&
  42.             w -> s[i].fu[0] == 'b')   {
  43.             AVL_MAKE_BNAME(w -> s[i].fu, msg);
  44.             ru = msg;
  45.             j = strlen(ru);
  46.             if (j > 10 ) {
  47.                 j = j - 10;
  48.                 if (!strcmp("_idle_task",ru+j))  
  49.                     *(ru+j) = '\0';
  50.                 }
  51.             strcpy(r[n].name,msg);
  52.             ++n;
  53.             }                
  54.  
  55.     if (n > 0)
  56.         i = AVL_UNIT(r,n);
  57.     else {
  58.         i = -1;
  59.         AVL_ERROR("First compile any executable program unit.");
  60.         }
  61.     AVL_DEL_WINDOW(temp2);
  62.     if (i >= 0)
  63.         return r[i].name;
  64.     return NULL;
  65. }
  66.  
  67.  
  68. int AVL_EX_UNIT(char *name, char *opts[17])
  69. {
  70.     int cmd_ret_code, i;
  71.     char msg[100];
  72.     cmd_ret_code = spawnvp(P_WAIT,name,opts);
  73.     if (cmd_ret_code == -1)  {
  74.         switch( errno )  {
  75.             case E2BIG : sprintf(msg,"E2BIG"); break;
  76.             case EINVAL: strcpy(msg,"The mode argument is invalid."); break;
  77.             case ENOENT: sprintf(msg,"File or path name not found: %s",name); break;
  78.             case ENOEXEC : sprintf(msg,
  79. "The specified file is not an executable or has an inv. exec-file format: '%s'",name); break;
  80.             case ENOMEM : strcpy(msg,
  81. "Not enough memory is available to execute the child process."); break;
  82.             default : sprintf(msg,"errno = %d, could not know...", errno); break;
  83.             }
  84.         AVL_ERROR(msg);
  85.         return 0;
  86.         }
  87.     return 1;
  88. }
  89.  
  90.  
  91.  
  92. int AVL_COMP_SETUP(AVL_EDIT_WINDOW_PTR w)
  93. {
  94.     AVL_WIN_PTR temp;
  95.     FILE *fp, *fopen();
  96.     struct find_t c_file;
  97.  
  98.     char lookat[AVL_MAX_FILE_NAME+1];
  99.     short i;
  100.     char msg[AVL_MAX_FILE_NAME+100];
  101.     unsigned att;
  102.  
  103.     sprintf(lookat,"%s",avl_dir_library);
  104.     i = _dos_findfirst( lookat, _A_SUBDIR, &c_file );
  105.     if (!i)  {
  106.         i = _dos_getfileattr(lookat,&att);
  107.         if (att != _A_SUBDIR)  {
  108.             sprintf(msg," Library %s does not exist! ",avl_dir_library);
  109.             msg[77] = '\0';
  110.             temp = AVL_MAKE_WINDOW(msg,5,9,12,71,avl_wnd_bk_color,avl_wnd_color);
  111.             _outtext(" Your current directory contains a file that has the same\n");
  112.             _outtext(" name of the current library. Before creating a new library\n");
  113.             _outtext(" (Alt-O N) either change this file name or change the\n");
  114.             _outtext(" current library name (Alt-O D).\n\n");
  115.             _outtext("Press any key to continue...");
  116.             i = getch();
  117.             if (i == 0) i = getch();
  118.             AVL_DEL_WINDOW(temp);
  119.             return 1;
  120.             }
  121.         sprintf(msg,"%s\\LIB",avl_dir_library);
  122.         fp = fopen(msg,"r");
  123.         if (fp == NULL) {
  124.             sprintf(msg," Library %s has been corrupted! ",avl_dir_library);
  125.             msg[77] = '\0';
  126.             temp = AVL_MAKE_WINDOW(msg,5,9,11,71,avl_wnd_bk_color,avl_wnd_color);
  127.             _outtext(" Your current library has been corrupted. It is suggested\n");
  128.             _outtext(" a new library, that is, create a new library by pressing\n");
  129.             _outtext(" the Alt-O N keys.\n\n");
  130.             _outtext("Press any key to continue...");
  131.             i = getch();
  132.             if (i == 0) i = getch();
  133.             AVL_DEL_WINDOW(temp);
  134.             return 1;
  135.             }
  136.         }
  137.         
  138.     if (i)  {
  139.         sprintf(msg," Library %s does not exist! ",avl_dir_library);
  140.         msg[77] = '\0';
  141.         temp = AVL_MAKE_WINDOW(msg,5,9,11,71,avl_wnd_bk_color,avl_wnd_color);
  142.         _outtext(" A library must be created before compiling any program.\n");
  143.         _outtext(" Pressing the Alt-O N keys will create a library for you.\n");
  144.         _outtext(" To change the current library press the Alt-O D keys.\n\n");
  145.         _outtext("Press any key to continue...");
  146.         i = getch();
  147.         if (i == 0) i = getch();
  148.         AVL_DEL_WINDOW(temp);
  149.         return 1;
  150.         }
  151.  
  152.     avl_blank_line[0] = '\0';
  153.     w -> fix = AVL_FIX;
  154.     w -> options = AVL_READ_OPTIONS;
  155.     w -> delete = AVL_DEL_WINDOW;
  156.     w -> error = AVL_ERROR;
  157.     w -> line_no = 0;
  158.     w -> no_errors = 0;
  159.     w -> avl_win1 = NULL;
  160.     if (w -> changed)
  161.         AVL_SAVE();
  162.     w -> changed = '\0';
  163.     return 0;
  164. }
  165.  
  166. int AVL_DO_COMPILATION(char *s, int pause)
  167. {
  168.     AVL_EDIT_WINDOW_PTR w;
  169.     int lex, syntax, semantic, bind, gen, nopt = 0, n, i;
  170.     FILE *fp, *fopen();
  171.     AVL_WIN_PTR temp;
  172.     char msg[100];
  173.     char *opts[17];
  174.     char compiling[121];
  175.     avl_w = w = &avl_windows[avl_window];
  176.     fp = fopen("COMPILE.CK$","w");
  177.     fclose(fp);
  178.     temp = AVL_MAKE_WINDOW(" N.Y.U. Ada Compiler "
  179.         ,5,1,8,80,avl_wnd_bk_color,avl_wnd_color);
  180.  
  181.     sprintf(compiling," Compiling %s, please wait ...\n", s);
  182.     _outtext(compiling);
  183.     opts[nopt++] = "Adacomp";
  184.     opts[nopt++] = "-a";
  185.     opts[nopt++] = "-s";
  186.     opts[nopt++] = "-l";
  187.     opts[nopt++] = avl_dir_library;
  188.     sprintf(msg,"%s",s);
  189.     opts[nopt++] = msg;
  190.     opts[nopt++] = NULL;
  191.     unlink("gwada.smm");
  192.     if (AVL_EX_UNIT("ADACOMP", opts))  ;
  193.     AVL_DEL_WINDOW(temp);
  194.     avl_open_error_file = 0;
  195.     fp = fopen("GWADA.SMM","r");
  196.     if (fp == NULL)  
  197.         w -> no_errors = 0;
  198.     else {
  199.         fscanf(fp, "%d", &w -> no_errors);
  200.         fscanf(fp, "%d", &lex);
  201.         fscanf(fp, "%d", &syntax);
  202.         fscanf(fp, "%d", &semantic);
  203.         fscanf(fp, "%d", &bind);
  204.         fscanf(fp, "%d", &gen);
  205.         fclose(fp);
  206.         }
  207.  
  208.     if (w -> no_errors > 0)  {
  209.         n = 0;
  210.         if (lex) ++n;
  211.         if (syntax) ++n;
  212.         if (semantic) ++n;
  213.         if (bind) ++n;
  214.         if (gen) ++n;
  215.         temp = AVL_MAKE_WINDOW(" N.Y.U. Ada Compiler - Error Summary "
  216.             ,5,1,7+n,80,avl_wnd_bk_color,avl_wnd_color);
  217.         _settextposition(1,2);
  218.         sprintf(msg,"  %d error%s detected:", w -> no_errors, (w -> no_errors == 1) ? "" : "s");
  219.         _outtext(msg); 
  220.         n = 0;
  221.         _settextposition(2,2);
  222.         if (lex > 0) { 
  223.             ++n;
  224.             sprintf(msg,"        %d lexical error%s. ", lex, (lex == 1) ? "" : "s");
  225.             _outtext(msg); 
  226.             }
  227.         if (syntax > 0) { 
  228.             _settextposition(2+n++,2);
  229.             sprintf(msg,"        %d syntactical error%s. ", syntax, (syntax == 1) ? "" : "s");
  230.             _outtext(msg); 
  231.             }
  232.         if (semantic > 0) { 
  233.             _settextposition(2+n++,2);
  234.             sprintf(msg,"        %d semantical error%s. ", semantic, (semantic == 1) ? "" : "s");
  235.             _outtext(msg); 
  236.             }
  237.         if (bind > 0) { 
  238.             _settextposition(2+n++,2);
  239.             sprintf(msg,"        %d binding error%s. ", bind, (bind == 1) ? "" : "s");
  240.             _outtext(msg); 
  241.             }
  242.         if (gen > 0) { 
  243.             _settextposition(2+n++,2);
  244.             sprintf(msg,"        %d code generating error%s. ", gen, (gen == 1) ? "" : "s");
  245.             _outtext(msg); 
  246.             }
  247.         if (pause) {
  248.              i = getch(); if (i == 0) i = getch();
  249.              }
  250.         AVL_DEL_WINDOW(temp);
  251.         avl_open_error_file = 1;
  252.         lex = 1;
  253.         }
  254.     else  {
  255.         temp = AVL_MAKE_WINDOW(" N.Y.U. Ada Compiler ",5,1,9,80,avl_wnd_bk_color,avl_wnd_color);
  256.         _settextposition(1,2);
  257.         fp = fopen("COMPILE.CK$","r");
  258.         if (fp != NULL)  {
  259.             sprintf(msg," Compilation failed! Check installation. ");
  260.             fclose(fp);
  261.             lex = 1;
  262.             }
  263.         else {
  264.             sprintf(msg," Program %s compiled with success.\n\n  Press any key to continue...", s);
  265.              lex = 0;
  266.              }
  267.         _outtext(msg);
  268.         if (pause) {
  269.              i = getch(); if (i == 0) i = getch();
  270.              }
  271.         AVL_DEL_WINDOW(temp);
  272.         }
  273.     return lex;
  274. }                    
  275.  
  276.  
  277.  
  278. void AVL_COMPILE_CURRENT()
  279. {
  280.     AVL_EDIT_WINDOW_PTR w;
  281.     avl_w = w = &avl_windows[avl_window];
  282.     if (AVL_COMP_SETUP(w)) return;
  283.     strcpy(current_file_name,w -> file_name);
  284.     if (AVL_DO_COMPILATION(w -> file_name,1));
  285. }
  286.  
  287.  
  288. /*
  289. void AVL_COMP_ORDER()
  290. {
  291.     AVL_EDIT_WINDOW_PTR w;
  292.     AVL_WIN_PTR temp;
  293.     AVL_WIN_PTR m1, m2;
  294.     char *opts[19];
  295.     int nopt = 0;
  296.     char msg[100];
  297.     char s[121];
  298.     char s2[121];
  299.     char search_space[10][128];
  300.     static char *msgc = "GWAda - Consider which set of files? ";
  301.     int i, j, n, n1, n2;
  302.     int no_units, larger;
  303.     static int first = 0;
  304.     static char lastfn[121];
  305.     static char fname[121];
  306.     char compiling[121];
  307.     FILE *fp2, *fopen();
  308.     avl_w = w = &avl_windows[avl_window];
  309.     n1 = 62;
  310.     n2 = (80 - n1) / 2;
  311.     m1 = AVL_MAKE_WINDOW(msgc,7,n2,9,n1+n2,avl_wnd_bk_color,avl_wnd_color);
  312.     if (first == 0)
  313.         sprintf(lastfn,"%s%c*.ada",avl_dir_sources,92);
  314.     first = 1;
  315.     strcpy(fname,lastfn);
  316.  
  317.     if (AVL_PROMPT(1,1,fname,60))  {
  318.         AVL_DEL_WINDOW(m1);
  319.         return;
  320.         }
  321.  
  322.     strcpy(lastfn,fname);
  323.     for(i = 0, j = 0, n = 0; i < strlen(fname); ++i)  
  324.         if (isspace(fname[i])) {
  325.             search_space[n++][j] = '\0';
  326.             j = 0;
  327.             while(isspace(fname[i])) ++i;
  328.             --i;
  329.             }
  330.         else
  331.             search_space[n][j++] = fname[i];
  332.     search_space[n++][j] = '\0';
  333.     AVL_DEL_WINDOW(m1);
  334.     temp = AVL_MAKE_WINDOW(" GWAda Bottom Up Parts Compiler "
  335.         ,2,1,9,80,avl_wnd_bk_color,avl_wnd_color);
  336.  
  337.     sprintf(compiling," Building compilation order for %s\n Please wait ...\n"
  338.         , w -> file_name );
  339.     _outtext(compiling);
  340.     opts[nopt++] = "GWADACO";
  341.     opts[nopt++] = avl_dir_library;
  342.     opts[nopt++] = w -> file_name;
  343.     for(i = 0; i < n; ++i)
  344.         opts[nopt++] = search_space[i];
  345.     opts[nopt++] = NULL;
  346.     if (AVL_EX_UNIT("GWADACO", opts))  ;
  347.     fp2 = fopen("AVLCOMPO.DAT","r");
  348.     if (fp2 == NULL) {
  349.         AVL_ERROR("Request failed! Check installation or set of files");
  350.         AVL_DEL_WINDOW(temp);
  351.         return;
  352.         }
  353.     AVL_DEL_WINDOW(temp);
  354.     j = 0;
  355.     fscanf(fp2,"%d %d", &no_units, &larger);
  356.     sprintf(compiling," Units Compiled ");
  357.     if (larger < strlen(compiling)) larger = strlen(compiling);
  358.     larger += 2;
  359.     if (larger > 74) larger = 74;
  360.     if (no_units > 18) no_units = 18;
  361.     i = (76 - larger);
  362.     n = 23 - no_units;
  363.     m2 = AVL_MAKE_WINDOW(compiling,n,i,n+no_units+1,i+larger+2,avl_txt_bk_color,avl_txt_color);
  364.     while ( fscanf(fp2,"%s",s2) != EOF) {
  365.         sprintf(s, "%s",s2);
  366.         sprintf(compiling,"\n %s",s);
  367.         strcpy(current_file_name,s);
  368.  
  369.         if (AVL_COMP_SETUP(w)) {
  370.             fclose(fp2);
  371.             AVL_DEL_WINDOW(m2);
  372.             return;
  373.             }
  374.             
  375.         if (AVL_DO_COMPILATION(s,0)) {
  376.             fclose(fp2);
  377.             AVL_DEL_WINDOW(m2);
  378.             return;
  379.             }
  380.         _outtext(compiling);
  381.         ++j;
  382.         }                    
  383.     if (j == 0)
  384.         AVL_ERROR("There is nothing to compile");
  385.     else {
  386.         temp = AVL_MAKE_WINDOW(" N.Y.U. Ada Compiler ",5,1,9,80,avl_wnd_bk_color,avl_wnd_color);
  387.         _settextposition(1,2);
  388.         sprintf(msg," %d unit%s compiled with success.\n\n  Press any key to continue..."
  389.             , j, (j > 1) ? "s" : "" );
  390.         _outtext(msg);
  391.         i = getch(); if (i == 0) i = getch();
  392.         AVL_DEL_WINDOW(temp);
  393.         }
  394.     AVL_DEL_WINDOW(m2);
  395.     fclose(fp2);
  396. }
  397.     
  398. */
  399.  
  400. void AVL_COMPILE()
  401. {
  402.     AVL_EDIT_WINDOW_PTR w;
  403.     char msg[100];
  404.     char s[121];
  405.     static char *msgc = "GWAda - Compile which file? ";
  406.     char *opts[17];
  407.     int nopt = 0;
  408.     int i, n, n1, n2;
  409.     AVL_WIN_PTR m1;
  410.     AVL_SOURCE_SIZE t;
  411.     static int first = 0;
  412.     static char lastfn[121];
  413.     char fname[121];
  414.     avl_w = w = &avl_windows[avl_window];
  415.     n1 = 62;
  416.     n2 = (80 - n1) / 2;
  417.     m1 = AVL_MAKE_WINDOW(msgc,7,n2,9,n1+n2,avl_wnd_bk_color,avl_wnd_color);
  418.     if (first == 0)
  419.         sprintf(lastfn,"%s%c*.ada",avl_dir_sources,92);
  420.     first = 1;
  421.     strcpy(fname,lastfn);
  422.     if (AVL_PROMPT(1,1,fname,60))  {
  423.         AVL_DEL_WINDOW(m1);
  424.         return;
  425.         }
  426.     strcpy(lastfn,fname);
  427.     AVL_GET_FILE_NAMES(&t,fname);
  428.     AVL_DEL_WINDOW(m1);
  429.     if (t.no_files == 0)  {
  430.         sprintf(s,"Can't find any file under \'%s\'",fname);
  431.         AVL_ERROR(s);
  432.         return;
  433.         }
  434.     s[0] = '\0';
  435.     if ((n = AVL_SOURCES(&t,t.no_files,fname)) < 0) return;
  436.     for(i = strlen(fname) - 1; t.no_files > 0 && i > 0; --i)  {
  437.         if (fname[i] == 92 && i > 0) {
  438.             fname[i+1] = '\0';
  439.             i  = -10;
  440.             break;
  441.             }
  442.         }
  443.     if (i < -1)
  444.         sprintf(s,"%s%s",fname,t.name[n]);
  445.     else
  446.         sprintf(s, "%s",t.name[n]);
  447.     if (s[0] == '\0')
  448.         return;
  449.     strcpy(current_file_name,s);
  450.     if (AVL_COMP_SETUP(w)) return;
  451.     AVL_DO_COMPILATION(s,1);
  452. }
  453.  
  454. void AVL_NEW_LIB()
  455. {
  456.     AVL_EDIT_WINDOW_PTR w;
  457.     AVL_WIN_PTR temp;
  458.     char msg[100];
  459.     char *opts[17];
  460.     int cmd_ret_code, i;
  461.     FILE *fp, *fopen();
  462.     w = &avl_windows[avl_window];
  463.     fp = fopen("DUMMY.ADA","w");
  464.     if (fp == NULL) {
  465.         AVL_ERROR("Can't create new library! Check disk space...");
  466.         return;
  467.         }
  468.     fprintf(fp," PROCEDURE DUMMY IS BEGIN NULL; END DUMMY; ");
  469.     fclose(fp);
  470.     w -> no_errors = 0;
  471.     sprintf(msg,"%s\\LIB",avl_dir_library);
  472.     fp = fopen(msg,"r");
  473.     if (fp == NULL) {
  474.         rmdir(avl_dir_library);
  475.         if (mkdir(avl_dir_library)) {
  476.             sprintf(msg,"Unable to create library '%s'",avl_dir_library);
  477.             AVL_ERROR(msg);
  478.             return;
  479.             }
  480.         }
  481.     else
  482.         fclose(fp);
  483.     temp = AVL_MAKE_WINDOW(" N.Y.U. Ada Compiler "
  484.         ,5,1,8,80,avl_wnd_bk_color,avl_wnd_color);
  485.     _outtext("Creating new library, please wait...\n");
  486.     opts[0] = "AdaComp";
  487.     opts[1] = "-n"; 
  488.     opts[2] = "-l";
  489.     opts[3] = avl_dir_library;
  490.     opts[4] = "dummy.ada";
  491.     opts[5] = NULL;
  492.     unlink("gwada.smm");
  493.     if (AVL_EX_UNIT("ADACOMP", opts))  ;
  494.     avl_open_error_file = 0;
  495.     fp = fopen("GWADA.SMM","r");
  496.     if (fp == NULL)  
  497.         w -> no_errors = 0;
  498.     else {
  499.         fscanf(fp, "%d", &w -> no_errors);
  500.         fclose(fp);
  501.         }
  502.     if (w -> no_errors > 0)  
  503.         AVL_ERROR("Library was not created properly!");
  504.     unlink("dummy.ada");
  505.     AVL_DEL_WINDOW(temp);
  506. }
  507.  
  508.  
  509. void AVL_RUN()
  510. {
  511.     AVL_UNITDT w;
  512.     AVL_EDIT_WINDOW_PTR ww;
  513.     AVL_WIN_PTR temp;
  514.     FILE *fp;
  515.     char msg[100];
  516.     char m2[4][12];
  517.     char t_opts[12];
  518.     short ncmd = 0;    
  519.     short ti = 0;
  520.     char *opts[19];
  521.     char *runit;
  522.     short nopt = 0;
  523.     short cmd_ret_code, i;
  524.     avl_blank_line[0] = '\0';
  525.     ww = &avl_windows[avl_window];
  526.     w.ns = 0;
  527.     opts[0] = "Adalib2";
  528.     opts[1] = "-l";
  529.     opts[2] = avl_dir_library;
  530.     opts[3] = NULL;
  531.     temp = AVL_MAKE_WINDOW(" Run ",5,1,9,80,avl_wnd_bk_color,avl_wnd_color);
  532.     _outtext("  Searching library. Please, wait a moment...\n");
  533.     if (AVL_EX_UNIT("ADALIB2", opts))  ;
  534.     AVL_DEL_WINDOW(temp);
  535.     AVL_MAKE_UNIT_DATE(&w);
  536.     if (w.ns == 0)  {
  537.         AVL_ERROR("First compile any executable program unit.");
  538.         return;
  539.         }
  540.  
  541.     runit = AVL_RUN_SELECT(&w);
  542.     if (runit == NULL)  
  543.         return;
  544.         temp = AVL_MAKE_WINDOW(" N. Y. U. Ada Interpreter "
  545.         ,11,1,14,80,avl_wnd_bk_color,avl_wnd_color);
  546.     _outtext("Loading interpreter, please wait...");
  547.     _settextposition(2,2);
  548.     if (avl_trace_opts[0]) t_opts[ti++] = 'a';
  549.     if (avl_trace_opts[1]) t_opts[ti++] = 'c';
  550.     if (avl_trace_opts[2]) t_opts[ti++] = 'e';
  551.     if (avl_trace_opts[3]) t_opts[ti++] = 'r';
  552.     if (avl_trace_opts[4]) t_opts[ti++] = 's';
  553.     if (avl_trace_opts[5]) t_opts[ti++] = 't';
  554.     if (ti) t_opts[ti] = '\0';
  555.  
  556.     opts[nopt++] = (avl_monitor_on) ? "gwumon" : "adaexec";
  557.     opts[nopt++] = "-m";
  558.     opts[nopt++] = runit;
  559.     if (!avl_monitor_on)  {
  560.         if (avl_heap) {sprintf(m2[0],"%d",avl_heap); opts[nopt++]="-h"; opts[nopt++]=m2[0];}
  561.         if (avl_pgm_stack) {sprintf(m2[1],"%d",avl_pgm_stack); opts[nopt++]="-p"; opts[nopt++]=m2[1];}
  562.         if (avl_task_stack) {sprintf(m2[2],"%d",avl_task_stack); opts[nopt++]="-s"; opts[nopt++]=m2[2];}
  563.         }
  564.     if (avl_scheduller) {sprintf(m2[3],"%d",avl_scheduller); opts[nopt++]="-r"; opts[nopt++]=m2[3];}
  565.     if (!avl_monitor_on)  
  566.         if (ti) {
  567.             opts[nopt++] = "-t";
  568.             opts[nopt++] = t_opts;
  569.             }
  570.     opts[nopt++] = avl_dir_library;
  571.     opts[nopt++] = NULL;
  572.     _setvideomode( _DEFAULTMODE );
  573.     _settextrows( 25 );
  574.     _clearscreen( _GCLEARSCREEN );
  575.     if (AVL_EX_UNIT((avl_monitor_on) ? "GWUMON" : "ADAEXEC", opts))  {
  576.         printf("\n\nPress any key to return to GWAda ...");
  577.         i = getch(); if (i == 0) i = getch();
  578.         }
  579.     AVL_DEL_WINDOW(temp);
  580. }
  581.  
  582.