home *** CD-ROM | disk | FTP | other *** search
- extern int left_space,page_line;
- extern char main_biao[50];
- extern char main_biao1[50];
- extern char main_size;
- extern char assi_biao[50];
- extern char assi_biao1[50];
- extern char assi_size;
- extern char left_top[40];
- extern char right_top[40];
- extern char tail_size;
- extern char text_size;
- extern char tail_boot[40];
- extern char midd_int[4];
- extern char midd_int1[4];
- extern char midd_int2[2];
- extern char filename[9][30];
- extern char joinname[45];
- extern int filectc;
- extern char filename1[15];
- extern char filename2[15];
- extern int x,y;
- extern char level[11][3];
- extern char scr[80][312];
- extern int curr,curc;
- extern int Ins;
- extern int width;
- extern int scrrow[100],scrcol[100];
- extern char scrval[100][200];
- extern int count4,count3;
- extern int real_width;
-
- streq(chr1,chr2)
- char *chr1,*chr2;
- {
- int m=0;
- while ((chr1[m]!='\0')&&(chr2[m]!='\0')){
- if (chr1[m]==chr2[m])
- m++;
- else
- return(0);
- }
- return(1);
- }
-
- lline(row,col1,col2)
- int row,col1,col2;
- {
- int m,n,s;
- char ch[4][4];
- int t[4];
- /* strcpy(level[0],"⌐ª");strcpy(level[1],"⌐ñ");strcpy(level[2],"⌐α");
- strcpy(level[3],"⌐╨");strcpy(level[4],"⌐└");strcpy(level[5],"⌐╚");
- strcpy(level[6],"⌐╪");strcpy(level[7],"⌐░");strcpy(level[8],"⌐┤");
- strcpy(level[9],"⌐╕");strcpy(level[10],"⌐╝");*/
- /* if (col1>col2){
- m=col1;col1=col2;col2=m;}*/
- for (m=col1;m<col2+2;m=m+2){
- ch[0][0]=scr[row][m];ch[0][1]=scr[row][m+1];ch[0][2]='\0';
- if (streq(ch[0]," ")){
- scr[row][m]=level[1][0];scr[row][m+1]=level[1][1];
- continue;}
- if ((row==0)||(row== 79)){
- t[0]=streq(ch[0],level[0])||streq(ch[0],level[8])||streq(ch[0],level[7]);
- if (t[0]&&(row==0)){
- if ((m!=col1)&&(m!=col2)){
- scr[row][m]=level[3][0];scr[row][m+1]=level[3][1];continue;}
- if (m==col1){ if (streq(ch[0],level[8])){
- scr[row][col1]=level[3][0];scr[row][col1+1]=level[3][1];
- continue;}
- scr[row][col1]=level[7][0];
- scr[row][col1+1]=level[7][1];continue;}
- if (m==col2){
- if (streq(ch[0],level[7])){
- scr[row][col2]=level[3][0];scr[row][col2+1]=level[3][1];
- continue;}
- scr[row][col2]=level[8][0];
- scr[row][col2+1]=level[8][1];continue;}
- }
- t[1]=streq(ch[0],level[0])||streq(ch[0],level[9])||streq(ch[0],level[10]);
- if ((row== 79)&&t[1]){
- if ((m!=col1)&&(m!=col2)){
- scr[row][m]=level[6][0];
- scr[row][m+1]=level[6][1];continue;}
- if (m==col1){
- if (streq(ch[0],level[10])){
- scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
- continue;}
- scr[row][col1]=level[9][0];
- scr[row][col1+1]=level[9][1];continue;} if (m==col2){
- if (streq(ch[0],level[9])){
- scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
- continue;}
- scr[row][col2]=level[10][0];
- scr[row][col2+1]=level[10][1];continue;}
- }
- }
- else{
- ch[1][0]=scr[row-1][m];ch[1][1]=scr[row-1][m+1];ch[1][2]='\0';
- ch[2][0]=scr[row][m+2];ch[2][1]=scr[row][m+3];ch[2][2]='\0';
- ch[3][0]=scr[row+1][m];ch[3][1]=scr[row+1][m+1];ch[3][2]='\0';
- t[0]=streq(ch[1],level[2])||streq(ch[1],level[3])||streq(ch[1],level[0]);
- t[0]=t[0]||streq(ch[1],level[4])||streq(ch[1],level[5]);
- t[0]=t[0]||streq(ch[1],level[7])||streq(ch[1],level[8]);
- t[1]=streq(ch[3],level[2])||streq(ch[3],level[4])||streq(ch[3],level[0]);
- t[1]=t[1]||streq(ch[3],level[5])||streq(ch[3],level[6]);
- t[1]=t[1]||streq(ch[3],level[9])||streq(ch[3],level[10]);
- if ((m!=col1)&&(m!=col2)){
- if (streq(ch[0],level[0])){
- if (t[0]&&t[1]){
- scr[row][m]=level[2][0];
- scr[row][m+1]=level[2][1];continue;}
- if (t[0]&&!(t[1])){
- scr[row][m]=level[6][0];
- scr[row][m+1]=level[6][1];continue;}
- if (!(t[0])&&t[1]){
- scr[row][m]=level[3][0];
- scr[row][m+1]=level[3][1];continue;}
- }
- if ((streq(ch[0],level[4]))||(streq(ch[0],level[5]))){
- scr[row][m]=level[2][0];
- scr[row][m+1]=level[2][1]; continue; }
- if ((streq(ch[0],level[7]))||(streq(ch[0],level[8]))){
- scr[row][m]=level[3][0];
- scr[row][m+1]=level[3][1]; continue;
- }
- if ((streq(ch[0],level[9]))||(streq(ch[0],level[10]))){
- scr[row][m]=level[6][0];
- scr[row][m+1]=level[6][1];continue;
- }
- }
- if (m==col1){
- if (streq(ch[0],level[0])){
- if (t[0]&&t[1]){
- scr[row][col1]=level[4][0];scr[row][col1+1]=level[4][1];
- continue;}
- if (t[0]&&!(t[1])){
- scr[row][m]=level[9][0];scr[row][m+1]=level[9][1];
- continue;}
- if (!(t[0])&&t[1]){
- scr[row][m]=level[7][0];scr[row][m+1]=level[7][1];
- continue;}
- } if (streq(ch[0],level[5])){
- scr[row][m]=level[2][0];scr[row][m+1]=level[2][1];
- continue;}
- if (streq(ch[0],level[8])){
- scr[row][m]=level[3][0];scr[row][m+1]=level[3][1];
- continue;}
- if (streq(ch[0],level[10])){
- scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
- continue;}
- }
- if (m==col2){
- if (streq(ch[0],level[0])){
- if (t[0]&&t[1]){
- scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
- continue;}
- if (t[0]&&!(t[1])){
- scr[row][m]=level[10][0];scr[row][m+1]=level[10][1];
- continue;}
- if (!(t[0])&&t[1]){
- scr[row][m]=level[8][0];scr[row][m+1]=level[8][1];
- continue;}
- }
- if (streq(ch[0],level[4])){
- scr[row][m]=level[2][0];scr[row][m+1]=level[2][1];
- continue;}
- if (streq(ch[0],level[7])){
- scr[row][m]=level[3][0];scr[row][m+1]=level[3][1];
- continue;}
- if (streq(ch[0],level[9])){
- scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
- continue;}
- }
- }
- } if (row>=curr+1&&row<curr+24){
- if (col1<curc){
- m=curc;setcursor(row-curr,m-curc);
- while (m<=col2){
- printf("%c%c",scr[row][m],scr[row][m+1]);m=m+2;}
- }
- if (col2>curc+79){
- setcursor(row-curr,col1-curc);
- for (m=col1;m<curc+80;m++)
- printf("%c",scr[row][m]);
- }
- if ((col1>=curc)&&(col2<curc+80)) {
- setcursor(row-curr,col1-curc);
- for (m=col1;m<=col2;m=m+2)
- printf("%c%c",scr[row][m],scr[row][m+1]);
- }
- }
- }
-
- hline(col,row1,row2)
- int col,row1,row2;{
- int m,n,s,row;
- char ch[4][4];
- int t[4];
- /* strcpy(level[0],"⌐ª");strcpy(level[1],"⌐ñ");strcpy(level[2],"⌐α");
- strcpy(level[3],"⌐╨");strcpy(level[4],"⌐└");strcpy(level[5],"⌐╚");
- strcpy(level[6],"⌐╪");strcpy(level[7],"⌐░");strcpy(level[8],"⌐┤");
- strcpy(level[9],"⌐╕");strcpy(level[10],"⌐╝");*/
- /* if (row1>row2){
- m=row1;row1=row2;row2=m;}*/
- m=col;
- for (row=row1;row<row2+1;row++){
- ch[0][0]=scr[row][m];ch[0][1]=scr[row][m+1];ch[0][2]='\0';
- if (streq(ch[0]," ")){
- scr[row][m]=level[0][0];scr[row][m+1]=level[0][1];
- continue;}
- if ((m==1)||(m==311)){
- t[0]=streq(ch[0],level[1])||streq(ch[0],level[7])||streq(ch[0],level[9]);
- if (t[0]&&(m==1)){
- if ((row!=row1)&&(row!=row2)){
- scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];continue;}
- if (row==row1){
- if (streq(ch[0],level[9])){
- scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];
- continue;}
- scr[row][m]=level[7][0];
- scr[row][m+1]=level[7][1];continue;}
- if (row==row2){
- if (streq(ch[0],level[7])){
- scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];
- continue;}
- scr[row][m]=level[9][0];
- scr[row][m+1]=level[9][1];continue;}
- }
- t[1]=streq(ch[0],level[1])||streq(ch[0],level[8])||streq(ch[0],level[10]);
- if ((m==311)&&t[1]){
- if ((row!=row1)&&(row!=row2)){
- scr[row][m]=level[5][0];
- scr[row][m+1]=level[5][1];continue;} if (row==row1){
- if (streq(ch[0],level[10])){
- scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
- continue;}
- scr[row][m]=level[10][0];
- scr[row][m+1]=level[10][1];continue;}
- if (row==row2){
- if (streq(ch[0],level[8])){
- scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
- continue;}
- scr[row][m]=level[10][0];
- scr[row][m+1]=level[10][1];continue;}
- }
- }
- else{
- ch[1][0]=scr[row][m-2];ch[1][1]=scr[row][m-1];ch[1][2]='\0';
- ch[2][0]=scr[row+1][m];ch[2][1]=scr[row+1][m+1];ch[2][2]='\0';
- ch[3][0]=scr[row][m+2];ch[3][1]=scr[row][m+3];ch[3][2]='\0';
- t[0]=streq(ch[1],level[2])||streq(ch[1],level[3])||streq(ch[1],level[1]);
- 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]);
- t[1]=streq(ch[3],level[2])||streq(ch[3],level[3])||streq(ch[3],level[1]);
- t[1]=t[1]||streq(ch[3],level[5])||streq(ch[3],level[6]);
- t[1]=t[1]||streq(ch[3],level[8])||streq(ch[3],level[10]);
- if ((row!=row1)&&(row!=row2)){
- t[3]=streq(ch[0],level[1]);
- if (t[3]){
- if (t[0]&&t[1]){
- scr[row][m]=level[2][0];
- scr[row][m+1]=level[2][1];
- continue;}
- if (t[0]&&!(t[1])){
- scr[row][m]=level[5][0];
- scr[row][m+1]=level[5][1];continue;}
- if (!(t[0])&&t[1]){
- scr[row][m]=level[4][0];
- scr[row][m+1]=level[4][1];continue;}
- }
- if ((streq(ch[0],level[3]))||(streq(ch[0],level[6]))){
- scr[row][m]=level[2][0];
- scr[row][m+1]=level[2][1]; continue;
- }
- if ((streq(ch[0],level[7]))||(streq(ch[0],level[9]))){
- scr[row][m]=level[4][0];
- scr[row][m+1]=level[4][1]; continue;
- }
- if ((streq(ch[0],level[8]))||(streq(ch[0],level[10]))){
- scr[row][m]=level[5][0];
- scr[row][m+1]=level[5][1];continue;
- }
- }
- if (row==row1){
- if (streq(ch[0],level[1])){
- if (t[0]&&t[1]){
- scr[row][m]=level[3][0];scr[row][m+1]=level[3][1];
- continue;} if (t[0]&&!(t[1])){
- scr[row][m]=level[8][0];scr[row][m+1]=level[8][1];
- continue;}
- if (!(t[0])&&t[1]){
- scr[row][m]=level[7][0];scr[row][m+1]=level[7][1];
- continue;}
- }
- if (streq(ch[0],level[6])){
- scr[row][m]=level[2][0];scr[row][m+1]=level[2][1];
- continue;}
- if (streq(ch[0],level[9])){
- scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];
- continue;}
- if (streq(ch[0],level[10])){
- scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
- continue;}
- }
- if (row==row2){
- if (streq(ch[0],level[1])){ if (t[0]&&t[1]){
- scr[row][m]=level[6][0];scr[row][m+1]=level[6][1];
- continue;}
- if (t[0]&&!(t[1])){
- scr[row][m]=level[10][0];scr[row][m+1]=level[10][1];
- continue;}
- if (!(t[0])&&t[1]){
- scr[row][m]=level[9][0];scr[row][m+1]=level[9][1];
- continue;}
- }
- if (streq(ch[0],level[3])){
- scr[row][m]=level[2][0];scr[row][m+1]=level[2][1];
- continue;}
- if (streq(ch[0],level[7])){
- scr[row][m]=level[4][0];scr[row][m+1]=level[4][1];
- continue;}
- if (streq(ch[0],level[8])){
- scr[row][m]=level[5][0];scr[row][m+1]=level[5][1];
- continue;}
- }
- }
- }
- if (col<curc+80&&col>=curc){
- if (row1<curr+1){
- m=curr+1;
- while (m<=row2){
- setcursor(m-curr,col-curc);
- printf("%c%c",scr[m][col],scr[m][col+1]);m++;}
- }
- if (row2>curr+23){
- for(m=row1;m<=curr+23;m++){
- setcursor(m-curr,col-curc);
- printf("%c%c",scr[m][col],scr[m][col+1]);}
- }
- if ((row1>=curr+1)&&(row2<=curr+23)){
- for (m=row1;m<=row2;m++){
- setcursor(m-curr,col-curc); printf("%c%c",scr[m][col],scr[m][col+1]);}
- }
- }
- }
-
-
- /*------------------------------display_row-------------------------------*/
- display_row()
- {
- int m;
- setcursor(x,0);
- for (m=curc;(m<curc+78)&&(m<width);m++){
- if (scr[curr+x][m]!='\n') printf("%c",scr[curr+x][m]);
- /* else printf(" ");*/
- }
- }