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){           if (streq(ch[0],level[8])){
  68.       scr[row][col1]=level[3][0];scr[row][col1+1]=level[3][1];
  69.       continue;}
  70.                scr[row][col1]=level[7][0];
  71.                scr[row][col1+1]=level[7][1];continue;}
  72.             if (m==col2){
  73.                if (streq(ch[0],level[7])){
  74.       scr[row][col2]=level[3][0];scr[row][col2+1]=level[3][1];
  75.       continue;}
  76.                scr[row][col2]=level[8][0];
  77.                scr[row][col2+1]=level[8][1];continue;}
  78.             }
  79.          t[1]=streq(ch[0],level[0])||streq(ch[0],level[9])||streq(ch[0],level[10]);
  80.          if ((row== 79)&&t[1]){
  81.             if ((m!=col1)&&(m!=col2)){
  82.                scr[row][m]=level[6][0];
  83.                scr[row][m+1]=level[6][1];continue;}
  84.             if (m==col1){
  85.                if (streq(ch[0],level[10])){
  86.       scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
  87.       continue;}
  88.                scr[row][col1]=level[9][0];
  89.                scr[row][col1+1]=level[9][1];continue;}        if (m==col2){
  90.                if (streq(ch[0],level[9])){
  91.       scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
  92.       continue;}
  93.                scr[row][col2]=level[10][0];
  94.                scr[row][col2+1]=level[10][1];continue;}
  95.          }
  96.       }
  97.       else{
  98.             ch[1][0]=scr[row-1][m];ch[1][1]=scr[row-1][m+1];ch[1][2]='\0';
  99.             ch[2][0]=scr[row][m+2];ch[2][1]=scr[row][m+3];ch[2][2]='\0';
  100.             ch[3][0]=scr[row+1][m];ch[3][1]=scr[row+1][m+1];ch[3][2]='\0';
  101.             t[0]=streq(ch[1],level[2])||streq(ch[1],level[3])||streq(ch[1],level[0]);
  102.             t[0]=t[0]||streq(ch[1],level[4])||streq(ch[1],level[5]);
  103.             t[0]=t[0]||streq(ch[1],level[7])||streq(ch[1],level[8]);
  104.             t[1]=streq(ch[3],level[2])||streq(ch[3],level[4])||streq(ch[3],level[0]);
  105.             t[1]=t[1]||streq(ch[3],level[5])||streq(ch[3],level[6]);
  106.             t[1]=t[1]||streq(ch[3],level[9])||streq(ch[3],level[10]);
  107.             if ((m!=col1)&&(m!=col2)){
  108.                if (streq(ch[0],level[0])){
  109.                   if (t[0]&&t[1]){
  110.          scr[row][m]=level[2][0];
  111.          scr[row][m+1]=level[2][1];continue;}
  112.       if (t[0]&&!(t[1])){
  113.          scr[row][m]=level[6][0];
  114.          scr[row][m+1]=level[6][1];continue;}
  115.                   if (!(t[0])&&t[1]){
  116.                                 scr[row][m]=level[3][0];
  117.         scr[row][m+1]=level[3][1];continue;}
  118.                 }
  119.                if ((streq(ch[0],level[4]))||(streq(ch[0],level[5]))){
  120.                              scr[row][m]=level[2][0];
  121.                  scr[row][m+1]=level[2][1]; continue;             }
  122.                if ((streq(ch[0],level[7]))||(streq(ch[0],level[8]))){
  123.                              scr[row][m]=level[3][0];
  124.                  scr[row][m+1]=level[3][1]; continue;
  125.                  }
  126.                if ((streq(ch[0],level[9]))||(streq(ch[0],level[10]))){
  127.                               scr[row][m]=level[6][0];
  128.                   scr[row][m+1]=level[6][1];continue;
  129.                   }
  130.             }
  131.             if (m==col1){
  132.                if (streq(ch[0],level[0])){
  133.       if (t[0]&&t[1]){
  134.          scr[row][col1]=level[4][0];scr[row][col1+1]=level[4][1];
  135.          continue;}
  136.       if (t[0]&&!(t[1])){
  137.          scr[row][m]=level[9][0];scr[row][m+1]=level[9][1];
  138.          continue;}
  139.       if (!(t[0])&&t[1]){
  140.          scr[row][m]=level[7][0];scr[row][m+1]=level[7][1];
  141.          continue;}
  142.                   }           if (streq(ch[0],level[5])){
  143.       scr[row][m]=level[2][0];scr[row][m+1]=level[2][1];
  144.       continue;}
  145.                if (streq(ch[0],level[8])){
  146.       scr[row][m]=level[3][0];scr[row][m+1]=level[3][1];
  147.       continue;}
  148.                if (streq(ch[0],level[10])){
  149.       scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
  150.       continue;}
  151.                }
  152.           if (m==col2){
  153.              if (streq(ch[0],level[0])){
  154.     if (t[0]&&t[1]){
  155.        scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
  156.        continue;}
  157.     if (t[0]&&!(t[1])){
  158.        scr[row][m]=level[10][0];scr[row][m+1]=level[10][1];
  159.        continue;}
  160.     if (!(t[0])&&t[1]){
  161.        scr[row][m]=level[8][0];scr[row][m+1]=level[8][1];
  162.        continue;}
  163.     }
  164.              if (streq(ch[0],level[4])){
  165.     scr[row][m]=level[2][0];scr[row][m+1]=level[2][1];
  166.     continue;}
  167.              if (streq(ch[0],level[7])){
  168.     scr[row][m]=level[3][0];scr[row][m+1]=level[3][1];
  169.     continue;}
  170.              if (streq(ch[0],level[9])){
  171.     scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
  172.     continue;}
  173.              }
  174.           }
  175.       }    if (row>=curr+1&&row<curr+24){
  176.     if (col1<curc){
  177.        m=curc;setcursor(row-curr,m-curc);
  178.        while (m<=col2){
  179.           printf("%c%c",scr[row][m],scr[row][m+1]);m=m+2;}
  180.        }
  181.     if (col2>curc+79){
  182.        setcursor(row-curr,col1-curc);
  183.        for (m=col1;m<curc+80;m++)
  184.            printf("%c",scr[row][m]);
  185.        }
  186.     if ((col1>=curc)&&(col2<curc+80)) {
  187.        setcursor(row-curr,col1-curc);
  188.        for (m=col1;m<=col2;m=m+2)
  189.           printf("%c%c",scr[row][m],scr[row][m+1]);
  190.        }
  191.     }
  192. }
  193.  
  194. hline(col,row1,row2)
  195. int col,row1,row2;{
  196.    int m,n,s,row;
  197.    char ch[4][4];
  198.    int t[4];
  199. /*    strcpy(level[0],"⌐ª");strcpy(level[1],"⌐ñ");strcpy(level[2],"⌐α");
  200.     strcpy(level[3],"⌐╨");strcpy(level[4],"⌐└");strcpy(level[5],"⌐╚");
  201.     strcpy(level[6],"⌐╪");strcpy(level[7],"⌐░");strcpy(level[8],"⌐┤");
  202.     strcpy(level[9],"⌐╕");strcpy(level[10],"⌐╝");*/
  203. /*   if (row1>row2){
  204.       m=row1;row1=row2;row2=m;}*/
  205.    m=col;
  206.    for (row=row1;row<row2+1;row++){
  207.       ch[0][0]=scr[row][m];ch[0][1]=scr[row][m+1];ch[0][2]='\0';
  208.       if (streq(ch[0],"  ")){
  209.          scr[row][m]=level[0][0];scr[row][m+1]=level[0][1];
  210.          continue;}
  211.       if ((m==1)||(m==311)){
  212.          t[0]=streq(ch[0],level[1])||streq(ch[0],level[7])||streq(ch[0],level[9]);
  213.      if (t[0]&&(m==1)){
  214.             if ((row!=row1)&&(row!=row2)){
  215.             scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];continue;}
  216.             if (row==row1){
  217.                if (streq(ch[0],level[9])){
  218.       scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];
  219.       continue;}
  220.                scr[row][m]=level[7][0];
  221.                scr[row][m+1]=level[7][1];continue;}
  222.             if (row==row2){
  223.                if (streq(ch[0],level[7])){
  224.       scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];
  225.       continue;}
  226.                scr[row][m]=level[9][0];
  227.                scr[row][m+1]=level[9][1];continue;}
  228.             }
  229.          t[1]=streq(ch[0],level[1])||streq(ch[0],level[8])||streq(ch[0],level[10]);
  230.      if ((m==311)&&t[1]){
  231.             if ((row!=row1)&&(row!=row2)){
  232.                scr[row][m]=level[5][0];
  233.                scr[row][m+1]=level[5][1];continue;}        if (row==row1){
  234.                if (streq(ch[0],level[10])){
  235.       scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
  236.       continue;}
  237.                scr[row][m]=level[10][0];
  238.                scr[row][m+1]=level[10][1];continue;}
  239.             if (row==row2){
  240.                if (streq(ch[0],level[8])){
  241.       scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
  242.       continue;}
  243.                scr[row][m]=level[10][0];
  244.                scr[row][m+1]=level[10][1];continue;}
  245.          }
  246.       }
  247.       else{
  248.             ch[1][0]=scr[row][m-2];ch[1][1]=scr[row][m-1];ch[1][2]='\0';
  249.             ch[2][0]=scr[row+1][m];ch[2][1]=scr[row+1][m+1];ch[2][2]='\0';
  250.             ch[3][0]=scr[row][m+2];ch[3][1]=scr[row][m+3];ch[3][2]='\0';
  251.             t[0]=streq(ch[1],level[2])||streq(ch[1],level[3])||streq(ch[1],level[1]);
  252.             t[0]=t[0]||streq(ch[1],level[4])||streq(ch[1],level[6]);        t[0]=t[0]||streq(ch[1],level[7])||streq(ch[1],level[9]);
  253.             t[1]=streq(ch[3],level[2])||streq(ch[3],level[3])||streq(ch[3],level[1]);
  254.             t[1]=t[1]||streq(ch[3],level[5])||streq(ch[3],level[6]);
  255.             t[1]=t[1]||streq(ch[3],level[8])||streq(ch[3],level[10]);
  256.             if ((row!=row1)&&(row!=row2)){
  257.                t[3]=streq(ch[0],level[1]);
  258.                if (t[3]){
  259.                   if (t[0]&&t[1]){
  260.          scr[row][m]=level[2][0];
  261.          scr[row][m+1]=level[2][1];
  262.          continue;}
  263.       if (t[0]&&!(t[1])){
  264.          scr[row][m]=level[5][0];
  265.          scr[row][m+1]=level[5][1];continue;}
  266.                   if (!(t[0])&&t[1]){
  267.                                 scr[row][m]=level[4][0];
  268.         scr[row][m+1]=level[4][1];continue;}
  269.                 }
  270.                if ((streq(ch[0],level[3]))||(streq(ch[0],level[6]))){
  271.                              scr[row][m]=level[2][0];
  272.                  scr[row][m+1]=level[2][1]; continue;
  273.                  }
  274.                if ((streq(ch[0],level[7]))||(streq(ch[0],level[9]))){
  275.                              scr[row][m]=level[4][0];
  276.                  scr[row][m+1]=level[4][1]; continue;
  277.                  }
  278.                if ((streq(ch[0],level[8]))||(streq(ch[0],level[10]))){
  279.                               scr[row][m]=level[5][0];
  280.                   scr[row][m+1]=level[5][1];continue;
  281.                   }
  282.             }
  283.             if (row==row1){
  284.                if (streq(ch[0],level[1])){
  285.       if (t[0]&&t[1]){
  286.          scr[row][m]=level[3][0];scr[row][m+1]=level[3][1];
  287.          continue;}      if (t[0]&&!(t[1])){
  288.          scr[row][m]=level[8][0];scr[row][m+1]=level[8][1];
  289.          continue;}
  290.       if (!(t[0])&&t[1]){
  291.          scr[row][m]=level[7][0];scr[row][m+1]=level[7][1];
  292.          continue;}
  293.                   }
  294.                if (streq(ch[0],level[6])){
  295.       scr[row][m]=level[2][0];scr[row][m+1]=level[2][1];
  296.       continue;}
  297.                if (streq(ch[0],level[9])){
  298.       scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];
  299.       continue;}
  300.                if (streq(ch[0],level[10])){
  301.       scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
  302.       continue;}
  303.                }
  304.           if (row==row2){
  305.              if (streq(ch[0],level[1])){    if (t[0]&&t[1]){
  306.        scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
  307.        continue;}
  308.     if (t[0]&&!(t[1])){
  309.        scr[row][m]=level[10][0];scr[row][m+1]=level[10][1];
  310.        continue;}
  311.     if (!(t[0])&&t[1]){
  312.        scr[row][m]=level[9][0];scr[row][m+1]=level[9][1];
  313.        continue;}
  314.     }
  315.              if (streq(ch[0],level[3])){
  316.     scr[row][m]=level[2][0];scr[row][m+1]=level[2][1];
  317.     continue;}
  318.              if (streq(ch[0],level[7])){
  319.     scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];
  320.     continue;}
  321.              if (streq(ch[0],level[8])){
  322.     scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
  323.     continue;}
  324.              }
  325.           }
  326.       }
  327.     if (col<curc+80&&col>=curc){
  328.     if (row1<curr+1){
  329.        m=curr+1;
  330.        while (m<=row2){
  331.           setcursor(m-curr,col-curc);
  332.       printf("%c%c",scr[m][col],scr[m][col+1]);m++;}
  333.        }
  334.     if (row2>curr+23){
  335.       for(m=row1;m<=curr+23;m++){
  336.          setcursor(m-curr,col-curc);
  337.          printf("%c%c",scr[m][col],scr[m][col+1]);}
  338.       }
  339.     if ((row1>=curr+1)&&(row2<=curr+23)){
  340.        for (m=row1;m<=row2;m++){
  341.            setcursor(m-curr,col-curc);       printf("%c%c",scr[m][col],scr[m][col+1]);}
  342.        }
  343.     }
  344. }
  345.  
  346.  
  347. /*------------------------------display_row-------------------------------*/
  348. display_row()
  349. {
  350.    int m;
  351.    setcursor(x,0);
  352.    for (m=curc;(m<curc+78)&&(m<width);m++){
  353.        if (scr[curr+x][m]!='\n') printf("%c",scr[curr+x][m]);
  354.  /*      else printf(" ");*/
  355.        }
  356. }
  357.