/**********************************************************************

     TERMINAL_H                                       Erik Thiele

     bis jetzt nur kbhit()
     spaeter auchnoch terminal ICANON mode !!! und OCANON evtl.

**********************************************************************/

#ifndef __terminal_H
#define __terminal_H

#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>

int kbhit()
{
    fd_set readfs;
    timeval inter;
    
    FD_ZERO(&readfs);
    FD_SET(0,&readfs);
    inter.tv_sec=0;
    inter.tv_usec=0;
    return(select(1,&readfs,NULL,NULL,&inter));
};

/*
#include <iostream.h>

int kbhit()
{
  int c;
  c=cin.peek();
  cout <<"Tested Stream, Next character: "<<c<<endl;
  cout <<"Eof: "<<cin.eof()<<endl;
  return 1;
}*/

#endif
