home *** CD-ROM | disk | FTP | other *** search
- #include<stdio.h>
- #include<stdlib.h>
- #include <alloc.h>
- #include<dos.h>
- #define pr(x) fprintf(fp,x)
- #define MAXP 10
- #define CONT 20
- #define CB 14
- #define VIDEO 0x10
- #define F1 15104
- typedef struct bb{
- char MEAN[21],DB[9],KEY[4][11],COFLAG,COPATH[11];
- int no;
- struct bb *next;
- }BASE;
- typedef struct cc {
- char field[128][11],ftype[128];
- int len1[128];
- int NN;
- int no;
- struct cc *next;
- }CONTENT;
- typedef struct ll {
- int MAR[6][128];
- int no;
- struct ll *next;
- }LINK;
- extern LINK *flink,*mylink;
- extern BASE *fbase;
- extern CONTENT *fcon;
- extern char *explain,PATH[30],lname[5][31],lnamebak[5][3][11];
- extern int NB,repeat,I,J,II,JJ,linkflag;
- int code;
- getbase()
- { int i,j,row,col,ctcn;
- char buff[80], sh[2];
- FILE *fp;
- BASE *mybase;
- code=0;
- /* strcpy(buff,PATH) ;*/
- strcpy( buff, "db.txt" ) ;
- fp=fopen( buff, "r");
- fbase = (BASE *)malloc(sizeof(BASE));
- mybase = fbase;
- mybase->next = NULL;
- mybase->no = 0;
- for(NB=0; (fgets(buff,80,fp)!=NULL); NB++)
- { if(NB!=0)
- {
- mybase->next=(BASE*)malloc(sizeof(BASE));
- mybase=mybase->next;
- mybase->no=NB;
- mybase->next=NULL;
- }
-
- sscanf(buff,"#%[^#]#,#%[^#]#,#%[^#]#,#%[^#]#,#%[^#]#,#%[^#]#,#%c#,#%c#,#%[^#]#\n",
- mybase->MEAN,mybase->KEY[0],mybase->KEY[1],
- mybase->KEY[2],mybase->KEY[3],mybase->DB,sh,&mybase->COFLAG,mybase->COPATH) ;
- fflush(fp) ;
- }
- fclose(fp);
- }
-
-
-
- getcontent(char *aarr,int *s)
- { int i,j,k,wh,cu=0;
- char name[30],buff[60];
- FILE *fp;
- CONTENT *mycon;
- BASE *mybase;
- for (wh=0;s[wh]!=0;wh++)
- {
- if(wh==0)
- {
- if((fcon=(CONTENT*)malloc(sizeof(CONTENT)))==NULL) printf("memory if not enough");
- mycon=fcon;
- mycon->no=s[wh]-1;
- mycon->next=NULL;
- mybase=fbase;
- while (mybase->no!=s[wh]-1) mybase=mybase->next;
- }
- else
- {
- if((mycon->next=(CONTENT*)malloc(sizeof(CONTENT)))==NULL) printf("=+++++++++++");
- mycon=mycon->next;
- mycon->next=NULL;
- mycon->no=s[wh]-1;
- /* mybase=mybase->next;*/
- mybase=fbase;
- while (mybase->no!=s[wh]-1) mybase=mybase->next;
- }
- strcpy(name,aarr);
- /* strcpy( name, "creat\\") ;*/
- strcat(name,mybase->DB);
- strcat(name,".txt");
- fp=fopen(name,"r");
- for(i=0; (fgets(buff,80,fp)!=NULL) ; i++,cu++)
- {
- sscanf(buff,"#%[^#]#,#%c#,%d,%d\n",mycon->field[cu],&mycon->ftype[cu],&mycon->len1[cu],&j) ;
- fflush(fp) ;
- }
- mycon->NN = cu ;
- fclose(fp);
- cu=0;
- }
- }
-
-
-
- /* ╩Σ╚δ┐Γ╓«╝Σ┴¼╜╙┬╖╛╢*/
- getroad(aarr,s,l)
- char *aarr;
- int *s,l;
- { int i,n,x,y,nn,col,j,cir,ii;
- FILE *codef;
- clear_win(0,0,24,79,0x70) ;
- II=0;
- cursor(15,10);
- printf("╟δ╢¿╥σ╡┌ %d ╕÷▓┘╫≈┐Γ",l+1);
- clear_win(18,20,22,62,0) ;
- clear_win(17,18,21,60,30) ;
- /* gframe(17,18,21,60,"",0|226) ;*/
- color_puts("╟δ╩Σ╚δ┐Γ╡─┤·║┼(0╘≥▒φ╩╛╜ß╩°╤í╘±) : ",0|226,18,22) ;
- chpage(0);
- i=0;
- L: if ((n=get((long) II,(long)JJ,20,24))!=0)
- { if (n=='H')
- { help1();
- while ((n=get((long)II,(long)JJ,20,24))=='H')
- {
- help1();
- }
- if (n==0) return(0); }
- if (n=='U'||n=='D'||n=='u'||n=='d')
- {
- chpage(n);
- goto L;
- }
- nn=n%CB;
- if(nn==0)
- nn=CB;
- y=((nn-1)%2)*35+6;
- x=(nn-1)/2+5;
- cursor(x,y);
- printf("*");
- s[i]=n;
- i++;
- cursor(20,25);
- printf("_");
- col=26;
- while ((n=get((long)II,(long)JJ,20,col))!=0)
- { if (n=='H') { help1();
- continue; }
- if (n=='U'||n=='D')
- {
- chpage(n);
- continue;
- }
- for (j=0;j<i;j++)
- if (s[j]==n) { cir=1;
- break;
- }
- else cir=0;
- if (cir) {
- color_puts("▓╗─▄│÷╧╓╓╪╕┤╤í╘±╣╣│╔╗╪┬╖! ╟δ╘┘┤╬╩Σ╚δ",12,24,45);
- dela();
- color_puts(" ",0|75,24,45);
- continue;
- }
- if (n!=0)
- { nn=n%CB;
- if(nn==0)
- nn=CB;
- y=((nn-1)%2)*35+6;
- x=(nn-1)/2+5;
- cursor(20,++col);
- printf("_");
- cursor(x,y);
- printf("*");
- cursor(20,++col);
- s[i]=n;
- i++;
- }
- }
- s[i]=0;
- getcontent(aarr,s);
- if (i==1) return(i);
- clear_win(15,36,19,72,0) ;
- clear_win(14,34,18,70,0|53) ;
- color_puts("╤í╘±╢α┐Γ┴¬╜╙╖╜╩╜",0|53,15,44);
- n=selete("┤«╨═", "╨╟╨═",17,43,56,0|53);
- linkflag=((n==1)?0:1);
- if ((codef=fopen("code.dbf","r"))!=NULL)
- {
- color_puts("╩╟ ╖± ╥¬ ┤· ┬δ ▓┘ ╫≈",0|53,15,42);
- n=selete("Yes ", "No ",17,43,56,0|53) ;
- if (n==1) code=1;
- }
- fclose(codef);
- return(i);
- }
- else
- return(0);
- }
-
-
- disp()
- { int i,x,y,n;
- BASE *mybase;
- color_puts(explain,56,0,0);
- color_puts(" F1-Help Esc-Exit ╗╪│╡: ═╦│÷▒╛─ú┐Θ ",0|75,24,0);
- color_puts("---- ▒╛╧╡═│╓╨╡─╚½▓┐╩²╛▌┐Γ╚τ╧┬ ----",0|113,2,22) ;
- gframe(4,2,12,75,0,0|226);
- x=5;
- y=7;
- n=0;
- mybase=fbase;
- while (mybase->no!=II)
- mybase=mybase->next;
- for (i=II;i<NB&&n<CB;i++)
- { cursor(x,y);
- printf("\033[1;33;44m%2d. %-10s",i+1,mybase->MEAN);
- printf("\033[0;0;0m") ;
- y+=35;
- if (y>60)
- { x++;
- y=7;
- }
- mybase=mybase->next;
- n++;
- }
- }
-
-
-
- disp_base(ch)
- int ch;
- { int row,col,i,n;
- BASE *mybase;
- CONTENT *mycon;
- mybase=fbase;
- mycon=fcon;
- /* for(i=0;i<NB;i++)
- {
- if(i!=0)
- {
- mybase=mybase->next;
- mycon=mycon->next;
- }
- if(mybase->no==(ch-1))
- break;
- } */
- while (mybase->no!=ch-1) mybase=mybase->next;
- while (mycon->no!=ch-1) mycon=mycon->next;
- color_puts(" ",43,0,1);
- ch=ch-1;
- cursor(1,16);
- printf("\033[0;0;7m----- ┐Γ # %s # ╓╨║¼╙╨╥╘╧┬╫╓╢╬ ----",mybase->MEAN);
- gframe(3,2,11,75,0,0|226);
- row=5;
- col=5;
- n=1;
- for (i=I;i<mycon->NN&&row<10;i++)
- { cursor(row,col);
- printf("\033[1;33;44m%2d. %-s",n+I,mycon->field[i]);
- col+=17;
- n++;
- if (col>60)
- { row++;
- col=5;
- }
- }
- }
-
-
-
-
- cmp(char *str,int aa)
- { int i,bb;
- CONTENT *meycon;
- meycon=fcon;
- while(meycon->no!=aa)
- meycon=meycon->next;
- bb=meycon->NN;
- for (i=0;i<bb;i++)
- if (strcmp(str,meycon->field[i])==0) return(i);
- return(-1);
- }
-
-
-
-
- deflink(s,dname,whmy)
- int *s;
- char *dname,*whmy;
- { int i,c,n,ctcn,ct;
- FILE *whfp;
- CONTENT *midcon,*mycon;
- BASE *mybase;
- char middst[41],strchar[11];
- repeat=1; ct=0;
- color_puts("╢¿╥σ┴¼╜╙┐Γ╡─╩╢▒≡├√(╫ε╢α20╕÷╫╓╖√): ",0|53,15,36) ;
- color_puts(" ",0|53,17,40) ;
- cursor( 17, 43 ) ;
- scanf("%s",dname);
- clear_win(0,0,24,79,0x70) ;
- for (i=0;i<5;i++) {strcpy(lname[i],NULL); lname[i][0]='\0';}
- I=0;
- i=1;ctcn=0;
- while (s[i]!=0)
- {
- judge(0,s[ctcn]);
- while (s[i]!=0) {
- cursor(16,15);
- clear_win(18,20,22,60,0) ;
- clear_win(17,18,21,58,30) ;
- color_puts("╟δ╚╖╢¿╦∙╢¿╥σ╡─┴¼╜╙┐Γ╡─┴¼╜╙╫╓╢╬ : ",0|226,18,22) ;
- color_puts("╫ó╥Γ: ┴¼╜╙╫╓╢╬▒╪╨δ─▄╬¿╥╗╡╪╩╢▒≡╥╗╕÷╝╟┬╝!",12,15,10) ;
- color_puts(" ╓╗╨Φ╝ⁿ╚δ╫╓╢╬╡─┤·║┼ ",0|75,24,0) ;
- c=get((long)I,(long)J,20,34);
- if (c=='U'||c=='D')
- { judge(c,s[ctcn]);
- continue;
- }
- if (c==0)
- {
- if (lname[i-1][0]=='\0') continue;
- else break;
- }
- mycon=fcon;
- while(mycon->no!=(s[ctcn]-1))
- mycon=mycon->next;
- midcon=mycon;
- if (s[i]!=0)
- { n=s[i]-1;
- mybase=fbase;
- while(mybase->no!=n)
- mybase=mybase->next;
- strcpy(middst,mycon->field[c-1]);
- if (cmp(mycon->field[c-1],n)<0)
- { cursor(20,10);
- printf("%s ▓╗┤µ╘┌ # %s # ╫╓╢╬, ╬▐╖¿┴¼╜╙. ╟δ╓╪╨┬╤í╘±┴¼╜╙╫╓╢╬",mybase->MEAN,midcon->field[c-1]);
- dela();
- cursor(20,10);
- printf(" ");
- continue;
- }
- else {
- if (lname[i-1][0]!='\0') strcat(lname[i-1],"+");
- if (mycon->ftype[c-1]=='D')
- {
- strcpy(middst,NULL); strcat(middst,"DTOC(");
- strcat(middst,mycon->field[c-1]); strcat(middst,")");
- }
- if (mycon->ftype[c-1]=='N')
- {
- strcpy(middst,NULL); strcat(middst,"STR(");
- strcat(middst,mycon->field[c-1]); strcat(middst,",");
- strcat(middst,"19");strcat(middst,")");
- }
- if (mycon->ftype[c-1]=='C')
- strcpy(middst,mycon->field[c-1]);
- if (lname[i-1][0]!='\0') strcat(lname[i-1],middst);
- else strcpy(lname[i-1],middst);
- strcpy(lnamebak[i-1][ct],mycon->field[c-1]); ++ct;
- }
- }
- }
- if (linkflag==1) i++;
- else {ctcn++;i++;}
- ct=0;
- }
- /* strcpy(middst,PATH)*/;
- strcpy(middst,whmy);
- strcat(middst,"ndx.txt");
- whfp=fopen(middst,"a");
- for (i=1;s[i]!=0;i++)
- { n=s[i]-1;
- mybase=fbase;
- while(mybase->no!=n)
- mybase=mybase->next;
- fprintf(whfp,"#%s#,#%s#,##,0,0\n",mybase->DB,lname[i-1]);
- }
- fclose(whfp);
- }
-
-
-
- sele_disp(int *s,int l)
- { int i,k,m,n,t,c,x,y;
- BASE *mybase,*midbase;
- CONTENT *mycon;
- /* LINK *mylink;*/
- mylink=flink;
- /* while (mylink->no!=l)
- mylink=mylink->next;*/
- clear_win(0,0,24,79,0) ;
- color_puts(explain,14,0,1);
- color_puts(" *** ╧┬├µ╟δ╢¿╥σ╜ß╣√╧╘╩╛╧ε ***",11,6,15);
- color_puts(" ─·╓╗╨Φ┤╙▒╗┴¼╜╙╡─╕≈╕÷┐Γ╓╨╖╓▒≡╤í╘±╚⌠╕╔╫╓╢╬╝┤┐╔.",11,8,12) ;
- color_puts("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",14,4,10);
- cursor(11,20);
- printf("╙╔ ╧┬ ┴╨ ┐Γ ┴¼ ╜╙ ╫Θ │╔:");
- cursor(13,20);
- i=1;
- midbase=fbase;
- while(midbase->no!=(s[0]-1))
- midbase=midbase->next;
- printf("%s",midbase->DB);
- while(s[i]!=0)
- { midbase=fbase;
- while(midbase->no!=(s[i]-1))
- midbase=midbase->next;
- i++;
- printf("->%s",midbase->DB);
- }
- color_puts("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",14,15,10);
- color_puts(" ░┤ ╚╬ ╥Γ ╝ⁿ...... ",0|48,17,25);
- bioskey(0);
- i=0;
- clear_win(0,0,24,79,0x70) ;
- while (s[i]!=0)
- { n=s[i]-1;
- mybase=fbase;
- mycon=fcon;
- /* while(mybase->no!=n)
- {
- mybase=mybase->next;
- mycon=mycon->next;
- }*/
- while (mybase->no!=n) mybase=mybase->next;
- while (mycon->no!=n) mycon=mycon->next;
- I=0;
- judge(0,s[i]);
- clear_win(15,16,19,52,0) ;
- clear_win(14,14,18,50,0|53) ;
- color_puts("╟δ╩Σ╚δ╧╘╩╛╖╜╩╜",0|53,15,24);
- c=selete("╚½▓┐╧╘╩╛", "▓┐╖╓╧╘╩╛",17,23,36,0|53);
- if (c==1)
- for (t=0;t<mycon->NN;t++)
- mylink->MAR[n][t]=1 ;
- else
- {
- clear_win(17,42,21,63,0) ;
- clear_win(16,40,20,61,0x10) ;
- color_puts("╨Φ╥¬╧╘╩╛╡─╫╓╢╬╙╨ ",286,17,43);
- while ((c=get((long)I,(long)J,19,50))!=0)
- {
- if (c=='U'||c=='D')
- { judge(c,s[i]);
- continue;
- }
- mark(c);
- mylink->MAR[n][c-1]=1;
- }
- }
- clear_win(16,10,23,65,0x70) ;
- i++;
- }
- }
-
-
- in_c(s,i)
- int *s,*i;
- { int n=0;
- if (s[1]!=0)
- color_puts("╟δ╤í╘±╠⌡╝■╫╓╢╬ (╝ⁿ╚δíⁿ/í²╤í╘±▓┘╫≈┐Γ) :",10,24,10);
- else
- color_puts("╟δ╤í╘±╠⌡╝■╫╓╢╬ :",10,24,20);
- while (n==0)
- { if (s[1]!=0)
- { while ((n=get((long)I,(long)J,24,50))!=0)
- { if (n=='u'||n=='d')
- { if (n=='u'&&*i>0) (*i)--;
- else if (s[*i+1]!=0) (*i)++;
- I=0;
- judge(0,s[*i]);
- }
- else if (n=='U'||n=='D')
- { judge(n,s[*i]);
- continue;
- }
- else break;
- }
- }
- else
- { n=get((long) I,(long)J,24,38);
- if (n=='U'||n=='D')
- { judge(n,s[*i]);
- n=0;
- continue;
- }
- }
- if (n==0) error();
- }
- return(n);
- }
-
-
-
- help1()
- { char c;
- int i;
- char *temp ;
- unsigned int row=12, col=13 ;
-
- temp = ( char * ) malloc(sizeof( char )*1152) ;
- now_cursor( &row, &col ) ;
- video_save( 6, 11, 77, 18, temp ) ;
- color_puts("⌐│⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐╖",15,11,6) ;
- color_puts("⌐º ─·┐╔╤í╘±╔╧╩÷┐Γ, ╜°╨╨╡Ñ┐Γ╗≥╢α┐Γ▓┘╫≈. ╚⌠╥¬╔·│╔╢╘╢α┐Γ▓┘╫≈, ╘≥╕≈┐Γ╝Σ⌐º",15,12,6) ;
- color_puts("⌐º▒╪╨δ╙╨╧α═¼╫╓╢╬, ╟╥╧α═¼╫╓╢╬╘┌▒╗┴¼╜╙┐Γ╓╨╙ª╩╟╣╪╝ⁿ╫╓. ⌐º",15,13,6) ;
- color_puts("⌐º ╘┌╤í┐Γ╩▒, ╚τ╣√─·╓╗╤í╘±┴╦╥╗╕÷┐Γ, ╘≥▒φ╩╛╢╘╡Ñ┐Γ▓┘╫≈; ╚τ╣√─·╤í╘±┴╦┴╜⌐º",15,14,6) ;
- color_puts("⌐º╕÷╥╘╔╧╡─┐Γ, ╘≥▒φ╩╛╢╘╢α┐Γ▓┘╫≈, ╧╡═│╜½╫╘╢»╕∙╛▌─·╤í╘±╡─╦│╨≥░╤╕≈┐Γ┴¼╜╙╞≡⌐º",15,15,6) ;
- color_puts("⌐º└┤. ⌐º",15,16,6) ;
- color_puts("⌐º ╫ó╥Γ : ┐╔┴¼╜╙╡─┐Γ╫ε╢α─▄╙╨6╕÷ ⌐º",15,17,6) ;
- color_puts("⌐╗⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐Ñ⌐┐",15,18,6) ;
- /* movcur();*/
- bioskey(0);
- video_restore( 6, 11, 77, 18, temp ) ;
- /* clear_win(11,0,18,79,0x70) ;
- setcur(); */
-
- cursor( row, col ) ;
- }
- /*╠⌡╝■▓┘╫≈╣½╙├╫╙│╠╨≥*/
-
-
-
-
-
- dela()
- { int i,j;
- for (i=0;i<10;i++)
- for (j=-30000;j<30000;j++) ;
- }
-
-
-
- getcc()
- { union REGS r;
- r.h.ah=0;
- int86(0x16,&r,&r);
- if (r.h.al==27) exit(0);
- if (r.h.al) return(r.h.al);
- return(r.x.ax);
- }
-
-
-
- get(i,j,row,col)
- long i,j ;
- int row,col;
- { int key,c ;
- long n=0;
- color_puts(" ",30,row,col);
- cursor(row,col);
- while ((key=getcc())!=0x0D)
- {
- switch (key)
- { case 18432 : return('u');
- case 18688 : return('U');
- case 20480 : return('d');
- case 20736 : return('D');
- case 15104 : return('H');
- case 8 : if (n!=0) n=n/10;
- else { error(); cursor(row,col); }
- break;
- default : if( key <= '9' && key >= '0')
- printf("\033[1;33;44m%c",key) ;
- n=10*n+key%256-'0';
- break;
- }
- }
- if ((n>j||n<=i)&&n!=0) { error();
- get((long)i,(long)j,row,col);
- }
- else return(n);
- }
-
-
-
-
- cursor(int y, int x)
- {
- _DH = (unsigned char)y ;
- _DL = (unsigned char)x ;
- _AH = (unsigned char)2 ;
- _BH = (unsigned char)0 ;
- geninterrupt(0x10) ;
- }
-
- color_puts(char *string, int color, int row, int col)
- {
- _SI = (unsigned int) string ;
- _DH = (unsigned char) row ;
- _DL = (unsigned char) col ;
- _CX = 1 ;
- while(*(( char * ) _SI))
- {
- _AH = (unsigned char) 2 ;
- _BH = (unsigned char) 0 ;
- __int__(0x10) ;
- ++_DL ;
-
- _AH = (unsigned char) 9 ;
- _AL = *((char *)_SI) ;
- _SI++ ;
- _BH = (unsigned char) 0 ;
- _BL = (unsigned char) color ;
- __int__(0x10) ;
- }
- }
-
-
- clear_win(startrow,startcol,endrow,endcol,attribe)
- int startrow,startcol;
- int endrow,endcol;
- int attribe;
- {
- _AH = (unsigned char) 6 ;
- _AL = (unsigned char) 0 ;
- _BH = (unsigned char) attribe ;
- _CH = (unsigned char) startrow ;
- _CL = (unsigned char) startcol ;
- _DH = (unsigned char) endrow ;
- _DL = (unsigned char) endcol ;
- geninterrupt(0x10) ;
- }
-
-
- now_cursor(unsigned int *row, unsigned int *col )
- {
- _AH = (unsigned char) 3 ;
- _BH = (unsigned char) 0 ;
- geninterrupt( 0x10 ) ;
- *row = _DH ;
- *col = _DL ;
- }
-
-
-
- judge(c,n)
- int n,c;
- {
- BASE *mybase;
- CONTENT *mycon;
-
- if (c=='U') I-=CONT;
- if (c=='D') I+=CONT;
- if (I<0) I=0;
- mycon=fcon;
- while(mycon->no!=(n-1))
- mycon=mycon->next;
- if (I>mycon->NN) I-=CONT;
- disp_base(n);
- J=I+CONT;
- if (J>mycon->NN) J=mycon->NN;
- }
-
- mark( int n )
- { int x,y;
- x=(n-I-1)/4+5;
- y=(n-1)%4*16+3+n%4+(n%4==0?4:0);
- cursor(x,y);
- printf("*") ;
- }
-
- movcur()
- { union REGS regs;
- regs.h.ah=19;
- regs.h.al=0;
- int86(0x10,®s,®s);
- }
-
-
-
-
- setcur()
- { union REGS regs;
- regs.h.ah=19;
- regs.h.al=1;
- int86(0x10,®s,®s);
- }
-
-
-
- error()
- { color_puts("###### ╩Σ╚δ┤φ╬≤! ╟δ╓╪╨┬╘┘╩Σ ######",12,24,46);
- dela();
- color_puts(" ",0|75,24,46);
- }
-
-
- chpage(int c)
- {
- if (c=='U') II-=CB;
- if (c=='D') II+=CB;
- if (II<0) II=0;
- if (II>NB) II-=CB;
- disp();
- JJ=II+CB;
- if (JJ>NB) JJ=NB;
- }
-
- /*=========================gframe============================*/
- gframe(startx,starty,endx,endy,sss,color)
- int startx,starty;
- int endx,endy;
- int sss;
- int color;
- {
- static char dd[3][6][3]={
- "⌐Ñ","⌐º","⌐│","⌐╖","⌐╗","⌐┐",
- "⌐ñ","⌐ª","⌐░","⌐┤","⌐╕","⌐╝" ,
- " "," "," "," "," "," "
- };
- int row,col;
- char *s;
- clear_win(startx+1,starty+2,endx+1,endy+2,0) ;
- clear_win(startx,starty,endx,endy,0x10) ;
- color_puts(dd[sss][2],color,startx,starty);
- for(col=starty+2; col<endy-2; col+=2)
- color_puts(dd[sss][0],color,startx,col);
- color_puts(dd[sss][3],color,startx,endy-1);
-
- for(row=startx+1; row<endx; ++row)
- {
- color_puts(dd[sss][1],color,row,starty);
- color_puts(dd[sss][1],color,row,endy-1);
- cursor(row,starty+2);
- }
- color_puts(dd[sss][4],color,endx,starty);
-
- for(col=starty+2; col<endy-2; ++col,++col)
- color_puts(dd[sss][0],color,endx,col);
- color_puts(dd[sss][5],color,endx,endy-1);
- return;
- }
-
-
- /* --- selete a choice from two term ---------- */
- /* if selete a return 1 */
- /* else return 2 */
- /*----------------------------------------------- */
- selete(char *a, char *b, int row, int acol, int bcol, char color)
- {
- int in,bb=1 ;
-
- color_puts(a,0|15,row,acol) ;
- color_puts(b,color,row,bcol) ;
- for(;;)
- {
- in=getcc() ;
- switch(in)
- {
- case 19712 :
- color_puts(a,color,row,acol) ;
- color_puts(b,0|15,row,bcol) ;
- bb=2;
- continue;
- case 19200 :
- color_puts(a,0|15,row,acol) ;
- color_puts(b,color,row,bcol) ;
- bb=1 ;
- continue;
- case F1 : help1() ;
- continue ;
- case 13 :
- return(bb);
- }
- }
- }
-
- video_save( startx, starty, endx, endy, destin )
- int startx, starty, endx, endy;
- char *destin;
- {
- union REGS r;
- register int i, j;
-
- /* win( 1, 1, 80, 25 );*/
- for ( j = starty ; j <= endy ; j++ )
- for ( i = startx ; i <= endx ; i++ ) {
- cursor( j, i ) ;
- r.h.ah = 8; /* read character & attribute from screen */
- r.h.bh = 0; /* page 0 */
- int86( VIDEO, &r, &r );
- *destin++ = r.h.al;
- *destin++ = r.h.ah;
- }
- /* win( startx, starty, endx, endy );*/
- }
-
- /*--------------------------------------------------
- Function : restore screen area from buffer source.
- Variable :
- startx, starty, endx, endy: screen area.
- source : pointer to buffer.
- ----------------------------------------------*/
- video_restore( startx, starty, endx, endy, source )
- int startx, starty, endx, endy;
- char *source;
- {
- register int i, j;
- union REGS r;
-
- /* win( 1, 1, 80, 25 );*/
- for ( j = starty ; j <= endy ; j++ )
- for ( i = startx ; i <= endx ; i++ ) {
- cursor( j, i ) ;
- r.h.ah = 9;
- r.h.bh = 0;
- r.x.cx = 1;
- r.h.al = *source++;
- r.h.bl = *source++;
- int86( VIDEO, &r, &r );
- }
- /* win( startx, starty, endx, endy );*/
- }
-
- /*win( startx, starty, endx, endy )
- int startx, starty;
- int endx, endy;
- {
- S_X = startx;
- S_Y = starty;
- E_X = endx;
- E_Y = endy;
- }
- */