ifspace() { if(kbhit()) if(getch()==32) return(1); if(comm_avail()) if(comm_getc(1)==32) return(1); return(0); }
void Comm::FlushInQue( void ) { while( isCharReady() ) { comm_getc(); } }
dfile(char *si,int i) { FILE *fp; char fo[80],c[900]; if(i==0) put_char(12); setmci(1); strcpy(fo,config.gfiledir); strcat(fo,si); if(access(fo,0)!=0) { if(i<2) { nl(); print("%s not found",fo); nl(); } return(-1); } fp=fopen(fo,"r"); while(1) { if(feof(fp)!=0) { fclose(fp); updatestat(); return; } if(kbhit()) if(getch()==32) { if(user.menutype > 1) { nl(); put2("[0m"); updatestat(); } setmci(0); return; } if(comm_avail()) if(comm_getc(1)==32) { if(user.menutype > 1) { nl(); put2("[0m"); updatestat(); } setmci(0); return; } fgets(c,800,fp); put2(c); c[0]=0; } fclose(fp); if(user.menutype > 1) put2("[0m"); setmci(1); updatestat(); }
chat() { int c,kh,ch,x,y; c=0; ch=0; kh=0; put_char(12); print("-*[ Force Ten Chat ]*- %s Chatting with %s #%d",config.sysop,user.name,user.number); nl(); nl(); nl(); if(!useron) { nl(); pl(">>> No user on-line"); nl(); } comm_flush(); while(1) { if(kbhit()) { kh=1; c=getch(); if(c==0) { c=getch(); if(c==68) return; } /* if(c==F1) { curr_cursor(&x,&y); c=kh=0; pullmenu(); cursor(x,y); }*/ if(c==13) { nl(); kh=c=0; } if(c==8) { bs(); kh=c=0; } } if(comm_avail()) { ch=1; c=comm_getc(1); if(c==13) { nl(); ch=c=0; } if(c==8) { bs(); ch=c=0; } } if(ch || kh) { if(kh) ansic(1); else ansic(2); ch=kh=0; put_char(c); } } }