home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a014 / 1.ddi / CDBINC.EXE / SYSTEM2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-09  |  12.8 KB  |  357 lines

  1. extern int  left_space,page_line;
  2. extern char main_biao[50];
  3. extern char main_biao1[50];
  4. extern char main_size;
  5. extern char assi_biao[50];
  6. extern char assi_biao1[50];
  7. extern char assi_size;
  8. extern char left_top[40];
  9. extern char right_top[40];
  10. extern char tail_size;
  11. extern char text_size;
  12. extern char tail_boot[40];
  13. extern char midd_int[4];
  14. extern char midd_int1[4];
  15. extern char midd_int2[2];
  16. extern char filename[9][30];
  17. extern char joinname[45];
  18. extern int  filectc;
  19. extern char filename1[15];
  20. extern char filename2[15];
  21. extern int x,y;
  22. extern char level[11][3];
  23. extern char scr[80][312];
  24. extern int curr,curc;
  25. extern int Ins;
  26. extern int width;
  27. extern int scrrow[100],scrcol[100];
  28. extern char scrval[100][200];
  29. extern int count4,count3;
  30. extern int real_width;
  31.  
  32. streq(chr1,chr2)
  33. char *chr1,*chr2;
  34. {
  35.    int m=0;
  36.    while ((chr1[m]!='\0')&&(chr2[m]!='\0')){
  37.          if (chr1[m]==chr2[m])
  38.             m++;
  39.          else
  40.             return(0);
  41.          }
  42.    return(1);
  43. }
  44.  
  45. lline(row,col1,col2)
  46. int row,col1,col2;
  47. {
  48.    int m,n,s;
  49.    char ch[4][4];
  50.    int t[4];
  51. /*    strcpy(level[0],"⌐ª");strcpy(level[1],"⌐ñ");strcpy(level[2],"⌐α");
  52.     strcpy(level[3],"⌐╨");strcpy(level[4],"⌐└");strcpy(level[5],"⌐╚");
  53.     strcpy(level[6],"⌐╪");strcpy(level[7],"⌐░");strcpy(level[8],"⌐┤");
  54.     strcpy(level[9],"⌐╕");strcpy(level[10],"⌐╝");*/
  55. /*   if (col1>col2){
  56.       m=col1;col1=col2;col2=m;}*/
  57.    for (m=col1;m<col2+2;m=m+2){
  58.       ch[0][0]=scr[row][m];ch[0][1]=scr[row][m+1];ch[0][2]='\0';
  59.       if (streq(ch[0],"  ")){
  60.          scr[row][m]=level[1][0];scr[row][m+1]=level[1][1];
  61.          continue;}
  62.       if ((row==0)||(row== 79)){
  63.          t[0]=streq(ch[0],level[0])||streq(ch[0],level[8])||streq(ch[0],level[7]);
  64.          if (t[0]&&(row==0)){
  65.             if ((m!=col1)&&(m!=col2)){
  66.             scr[row][m]=level[3][0];scr[row][m+1]=level[3][1];continue;}
  67.             if (m==col1){
  68.            if (streq(ch[0],level[8])){
  69.       scr[row][col1]=level[3][0];scr[row][col1+1]=level[3][1];
  70.       continue;}
  71.                scr[row][col1]=level[7][0];
  72.                scr[row][col1+1]=level[7][1];continue;}
  73.             if (m==col2){
  74.                if (streq(ch[0],level[7])){
  75.       scr[row][col2]=level[3][0];scr[row][col2+1]=level[3][1];
  76.       continue;}
  77.                scr[row][col2]=level[8][0];
  78.                scr[row][col2+1]=level[8][1];continue;}
  79.             }
  80.          t[1]=streq(ch[0],level[0])||streq(ch[0],level[9])||streq(ch[0],level[10]);
  81.          if ((row== 79)&&t[1]){
  82.             if ((m!=col1)&&(m!=col2)){
  83.                scr[row][m]=level[6][0];
  84.                scr[row][m+1]=level[6][1];continue;}
  85.             if (m==col1){
  86.                if (streq(ch[0],level[10])){
  87.       scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
  88.       continue;}
  89.                scr[row][col1]=level[9][0];
  90.                scr[row][col1+1]=level[9][1];continue;}
  91.         if (m==col2){
  92.                if (streq(ch[0],level[9])){
  93.       scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
  94.       continue;}
  95.                scr[row][col2]=level[10][0];
  96.                scr[row][col2+1]=level[10][1];continue;}
  97.          }
  98.       }
  99.       else{
  100.             ch[1][0]=scr[row-1][m];ch[1][1]=scr[row-1][m+1];ch[1][2]='\0';
  101.             ch[2][0]=scr[row][m+2];ch[2][1]=scr[row][m+3];ch[2][2]='\0';
  102.             ch[3][0]=scr[row+1][m];ch[3][1]=scr[row+1][m+1];ch[3][2]='\0';
  103.             t[0]=streq(ch[1],level[2])||streq(ch[1],level[3])||streq(ch[1],level[0]);
  104.             t[0]=t[0]||streq(ch[1],level[4])||streq(ch[1],level[5]);
  105.             t[0]=t[0]||streq(ch[1],level[7])||streq(ch[1],level[8]);
  106.             t[1]=streq(ch[3],level[2])||streq(ch[3],level[4])||streq(ch[3],level[0]);
  107.             t[1]=t[1]||streq(ch[3],level[5])||streq(ch[3],level[6]);
  108.             t[1]=t[1]||streq(ch[3],level[9])||streq(ch[3],level[10]);
  109.             if ((m!=col1)&&(m!=col2)){
  110.                if (streq(ch[0],level[0])){
  111.                   if (t[0]&&t[1]){
  112.          scr[row][m]=level[2][0];
  113.          scr[row][m+1]=level[2][1];continue;}
  114.       if (t[0]&&!(t[1])){
  115.          scr[row][m]=level[6][0];
  116.          scr[row][m+1]=level[6][1];continue;}
  117.                   if (!(t[0])&&t[1]){
  118.                                 scr[row][m]=level[3][0];
  119.         scr[row][m+1]=level[3][1];continue;}
  120.                 }
  121.                if ((streq(ch[0],level[4]))||(streq(ch[0],level[5]))){
  122.                              scr[row][m]=level[2][0];
  123.                  scr[row][m+1]=level[2][1]; continue;
  124.              }
  125.                if ((streq(ch[0],level[7]))||(streq(ch[0],level[8]))){
  126.                              scr[row][m]=level[3][0];
  127.                  scr[row][m+1]=level[3][1]; continue;
  128.                  }
  129.                if ((streq(ch[0],level[9]))||(streq(ch[0],level[10]))){
  130.                               scr[row][m]=level[6][0];
  131.                   scr[row][m+1]=level[6][1];continue;
  132.                   }
  133.             }
  134.             if (m==col1){
  135.                if (streq(ch[0],level[0])){
  136.       if (t[0]&&t[1]){
  137.          scr[row][col1]=level[4][0];scr[row][col1+1]=level[4][1];
  138.          continue;}
  139.       if (t[0]&&!(t[1])){
  140.          scr[row][m]=level[9][0];scr[row][m+1]=level[9][1];
  141.          continue;}
  142.       if (!(t[0])&&t[1]){
  143.          scr[row][m]=level[7][0];scr[row][m+1]=level[7][1];
  144.          continue;}
  145.                   }
  146.            if (streq(ch[0],level[5])){
  147.       scr[row][m]=level[2][0];scr[row][m+1]=level[2][1];
  148.       continue;}
  149.                if (streq(ch[0],level[8])){
  150.       scr[row][m]=level[3][0];scr[row][m+1]=level[3][1];
  151.       continue;}
  152.                if (streq(ch[0],level[10])){
  153.       scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
  154.       continue;}
  155.                }
  156.           if (m==col2){
  157.              if (streq(ch[0],level[0])){
  158.     if (t[0]&&t[1]){
  159.        scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
  160.        continue;}
  161.     if (t[0]&&!(t[1])){
  162.        scr[row][m]=level[10][0];scr[row][m+1]=level[10][1];
  163.        continue;}
  164.     if (!(t[0])&&t[1]){
  165.        scr[row][m]=level[8][0];scr[row][m+1]=level[8][1];
  166.        continue;}
  167.     }
  168.              if (streq(ch[0],level[4])){
  169.     scr[row][m]=level[2][0];scr[row][m+1]=level[2][1];
  170.     continue;}
  171.              if (streq(ch[0],level[7])){
  172.     scr[row][m]=level[3][0];scr[row][m+1]=level[3][1];
  173.     continue;}
  174.              if (streq(ch[0],level[9])){
  175.     scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
  176.     continue;}
  177.              }
  178.           }
  179.       }
  180.     if (row>=curr+1&&row<curr+24){
  181.     if (col1<curc){
  182.        m=curc;setcursor(row-curr,m-curc);
  183.        while (m<=col2){
  184.           printf("%c%c",scr[row][m],scr[row][m+1]);m=m+2;}
  185.        }
  186.     if (col2>curc+79){
  187.        setcursor(row-curr,col1-curc);
  188.        for (m=col1;m<curc+80;m++)
  189.            printf("%c",scr[row][m]);
  190.        }
  191.     if ((col1>=curc)&&(col2<curc+80)) {
  192.        setcursor(row-curr,col1-curc);
  193.        for (m=col1;m<=col2;m=m+2)
  194.           printf("%c%c",scr[row][m],scr[row][m+1]);
  195.        }
  196.     }
  197. }
  198.  
  199. hline(col,row1,row2)
  200. int col,row1,row2;
  201. {
  202.    int m,n,s,row;
  203.    char ch[4][4];
  204.    int t[4];
  205. /*    strcpy(level[0],"⌐ª");strcpy(level[1],"⌐ñ");strcpy(level[2],"⌐α");
  206.     strcpy(level[3],"⌐╨");strcpy(level[4],"⌐└");strcpy(level[5],"⌐╚");
  207.     strcpy(level[6],"⌐╪");strcpy(level[7],"⌐░");strcpy(level[8],"⌐┤");
  208.     strcpy(level[9],"⌐╕");strcpy(level[10],"⌐╝");*/
  209. /*   if (row1>row2){
  210.       m=row1;row1=row2;row2=m;}*/
  211.    m=col;
  212.    for (row=row1;row<row2+1;row++){
  213.       ch[0][0]=scr[row][m];ch[0][1]=scr[row][m+1];ch[0][2]='\0';
  214.       if (streq(ch[0],"  ")){
  215.          scr[row][m]=level[0][0];scr[row][m+1]=level[0][1];
  216.          continue;}
  217.       if ((m==1)||(m==311)){
  218.          t[0]=streq(ch[0],level[1])||streq(ch[0],level[7])||streq(ch[0],level[9]);
  219.      if (t[0]&&(m==1)){
  220.             if ((row!=row1)&&(row!=row2)){
  221.             scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];continue;}
  222.             if (row==row1){
  223.                if (streq(ch[0],level[9])){
  224.       scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];
  225.       continue;}
  226.                scr[row][m]=level[7][0];
  227.                scr[row][m+1]=level[7][1];continue;}
  228.             if (row==row2){
  229.                if (streq(ch[0],level[7])){
  230.       scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];
  231.       continue;}
  232.                scr[row][m]=level[9][0];
  233.                scr[row][m+1]=level[9][1];continue;}
  234.             }
  235.          t[1]=streq(ch[0],level[1])||streq(ch[0],level[8])||streq(ch[0],level[10]);
  236.      if ((m==311)&&t[1]){
  237.             if ((row!=row1)&&(row!=row2)){
  238.                scr[row][m]=level[5][0];
  239.                scr[row][m+1]=level[5][1];continue;}
  240.         if (row==row1){
  241.                if (streq(ch[0],level[10])){
  242.       scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
  243.       continue;}
  244.                scr[row][m]=level[10][0];
  245.                scr[row][m+1]=level[10][1];continue;}
  246.             if (row==row2){
  247.                if (streq(ch[0],level[8])){
  248.       scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
  249.       continue;}
  250.                scr[row][m]=level[10][0];
  251.                scr[row][m+1]=level[10][1];continue;}
  252.          }
  253.       }
  254.       else{
  255.             ch[1][0]=scr[row][m-2];ch[1][1]=scr[row][m-1];ch[1][2]='\0';
  256.             ch[2][0]=scr[row+1][m];ch[2][1]=scr[row+1][m+1];ch[2][2]='\0';
  257.             ch[3][0]=scr[row][m+2];ch[3][1]=scr[row][m+3];ch[3][2]='\0';
  258.             t[0]=streq(ch[1],level[2])||streq(ch[1],level[3])||streq(ch[1],level[1]);
  259.             t[0]=t[0]||streq(ch[1],level[4])||streq(ch[1],level[6]);
  260.         t[0]=t[0]||streq(ch[1],level[7])||streq(ch[1],level[9]);
  261.             t[1]=streq(ch[3],level[2])||streq(ch[3],level[3])||streq(ch[3],level[1]);
  262.             t[1]=t[1]||streq(ch[3],level[5])||streq(ch[3],level[6]);
  263.             t[1]=t[1]||streq(ch[3],level[8])||streq(ch[3],level[10]);
  264.             if ((row!=row1)&&(row!=row2)){
  265.                t[3]=streq(ch[0],level[1]);
  266.                if (t[3]){
  267.                   if (t[0]&&t[1]){
  268.          scr[row][m]=level[2][0];
  269.          scr[row][m+1]=level[2][1];
  270.          continue;}
  271.       if (t[0]&&!(t[1])){
  272.          scr[row][m]=level[5][0];
  273.          scr[row][m+1]=level[5][1];continue;}
  274.                   if (!(t[0])&&t[1]){
  275.                                 scr[row][m]=level[4][0];
  276.         scr[row][m+1]=level[4][1];continue;}
  277.                 }
  278.                if ((streq(ch[0],level[3]))||(streq(ch[0],level[6]))){
  279.                              scr[row][m]=level[2][0];
  280.                  scr[row][m+1]=level[2][1]; continue;
  281.                  }
  282.                if ((streq(ch[0],level[7]))||(streq(ch[0],level[9]))){
  283.                              scr[row][m]=level[4][0];
  284.                  scr[row][m+1]=level[4][1]; continue;
  285.                  }
  286.                if ((streq(ch[0],level[8]))||(streq(ch[0],level[10]))){
  287.                               scr[row][m]=level[5][0];
  288.                   scr[row][m+1]=level[5][1];continue;
  289.                   }
  290.             }
  291.             if (row==row1){
  292.                if (streq(ch[0],level[1])){
  293.       if (t[0]&&t[1]){
  294.          scr[row][m]=level[3][0];scr[row][m+1]=level[3][1];
  295.          continue;}
  296.       if (t[0]&&!(t[1])){
  297.          scr[row][m]=level[8][0];scr[row][m+1]=level[8][1];
  298.          continue;}
  299.       if (!(t[0])&&t[1]){
  300.          scr[row][m]=level[7][0];scr[row][m+1]=level[7][1];
  301.          continue;}
  302.                   }
  303.                if (streq(ch[0],level[6])){
  304.       scr[row][m]=level[2][0];scr[row][m+1]=level[2][1];
  305.       continue;}
  306.                if (streq(ch[0],level[9])){
  307.       scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];
  308.       continue;}
  309.                if (streq(ch[0],level[10])){
  310.       scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
  311.       continue;}
  312.                }
  313.           if (row==row2){
  314.              if (streq(ch[0],level[1])){
  315.     if (t[0]&&t[1]){
  316.        scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
  317.        continue;}
  318.     if (t[0]&&!(t[1])){
  319.        scr[row][m]=level[10][0];scr[row][m+1]=level[10][1];
  320.        continue;}
  321.     if (!(t[0])&&t[1]){
  322.        scr[row][m]=level[9][0];scr[row][m+1]=level[9][1];
  323.        continue;}
  324.     }
  325.              if (streq(ch[0],level[3])){
  326.     scr[row][m]=level[2][0];scr[row][m+1]=level[2][1];
  327.     continue;}
  328.              if (streq(ch[0],level[7])){
  329.     scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];
  330.     continue;}
  331.              if (streq(ch[0],level[8])){
  332.     scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
  333.     continue;}
  334.              }
  335.           }
  336.       }
  337.     if (col<curc+80&&col>=curc){
  338.     if (row1<curr+1){
  339.        m=curr+1;
  340.        while (m<=row2){
  341.           setcursor(m-curr,col-curc);
  342.       printf("%c%c",scr[m][col],scr[m][col+1]);m++;}
  343.        }
  344.     if (row2>curr+23){
  345.       for(m=row1;m<=curr+23;m++){
  346.          setcursor(m-curr,col-curc);
  347.          printf("%c%c",scr[m][col],scr[m][col+1]);}
  348.       }
  349.     if ((row1>=curr+1)&&(row2<=curr+23)){
  350.        for (m=row1;m<=row2;m++){
  351.            setcursor(m-curr,col-curc);
  352.        printf("%c%c",scr[m][col],scr[m][col+1]);}
  353.        }
  354.     }
  355. }
  356.  
  357.  
  358. /*------------------------------display_row-------------------------------*/
  359. display_row()
  360. {
  361.    int m;
  362.    setcursor(x,0);
  363.    for (m=curc;(m<curc+78)&&(m<width);m++){
  364.        if (scr[curr+x][m]!='\n') printf("%c",scr[curr+x][m]);
  365.  /*      else printf(" ");*/
  366.        }
  367. }
  368.