Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Deprecated/old_18mar_diff/nto/conio.h File Reference

#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <time.h>

Go to the source code of this file.

Functions

char getch ()
char getche ()
int kbhit ()


Function Documentation

char getch   [inline]
 

Definition at line 9 of file conio.h.

Referenced by getche().

00010 {
00011     fflush( stdin  );
00012     fflush( stdout );
00013     register char ch = 0;
00014     struct timespec rqtp;
00015 
00016    struct termios raw_tios =
00017    {                                        
00018     /* c_iflag */       0,
00019     /* c_oflag */       0,
00020    #ifdef __QNXNTO__
00021     /* c_cflag */       (CREAD|HUPCL),
00022    #else
00023     /* c_cflag */       (CREAD),
00024    #endif
00025    #ifdef __QNXNTO__
00026     /* c_lflag */       0,
00027    #else
00028     /* c_lflag */       (IEXTEN),
00029    #endif
00030    };
00031    struct termios tios;
00032 
00033     rqtp.tv_sec = 0;
00034     rqtp.tv_nsec = 5000000;
00035    tcgetattr(0, &tios);
00036    while (tcischars(0) == 0) {nanosleep(&rqtp, NULL);}
00037    tcsetattr(0, TCSANOW, &raw_tios);
00038 
00039    read (0, &ch, 1);
00040 
00041    tcsetattr(0, TCSANOW, &tios);
00042    return ch;
00043 }

char getche   [inline]
 

Definition at line 45 of file conio.h.

00046 {
00047  register char ch = getch();
00048  putc( ch, stdout );
00049  fflush( stdout );
00050  return ch;
00051 }

int kbhit   [inline]
 

Definition at line 53 of file conio.h.

00054 {
00055   return ( (tcischars(1) > 0) ? 1 : 0 );
00056 }


Generated on Sun Oct 14 18:47:20 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001