/*Sivann 1998: get a string with greek keyboard without any driver You only need the greek fonts. */ #include #include #include /*SVR4*/ #include /*POSIX under linux*/ #include #include #include #include /*SVR4 method*/ no_wait() { int i,fd; struct termio ts; fd=open(ttyname(0),O_RDWR); ioctl(fd, TCGETA, &ts); ts.c_cc[VMIN]=1; ts.c_lflag = ISIG; ioctl(fd, TCSETA, &ts); } trans(char *buff,int ac) { int len,i,j; static char accent=0; len=strlen(buff); if (accent==1) { accent=0; for (i=0;i=i;j--) buff[j+1]=buff[j];buff[i]=39;trans(buff,0); break; /*'*/ } } else if (accent==2) { accent=0; for (i=0;i=i;j--) buff[j+1]=buff[j];buff[i]=39;trans(buff,0); break; /*'*/ } } else if (accent==3) { accent=0; for (i=0;i=i;j--) buff[j+1]=buff[j];buff[i]=39;trans(buff,0); break; /*'*/ } } else for (i=0;i0?l-1:0]=0; } else { if (r>=0) buff[r]=0; trans(buff,1); write(1,buff,strlen(buff)); strcat(string,buff); if (strchr(buff,'\n')) { string[strlen(string)-1]=0; break; } } } while(r>=0); return strlen(string); } main(int argc,char **argv) { int i; char string[1024]; i=grgets(string); printf("Got[%d]:%s\n",i,string); }