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/raw.cpp

Go to the documentation of this file.
00001   #include <termios.h> 
00002   #include <stdio.h>
00003   #include <string.h>
00004   #include <errno.h>
00005 
00006   #include <unistd.h>
00007   #include <stdlib.h>
00008   #include <fcntl.h>
00009   #include <sys/time.h>
00010 
00011  #include <sys/types.h>
00012  #include <sys/uio.h>
00013 
00014  int dev_raw (int fd)
00015  {
00016          struct termios termios_p;
00017 
00018          if (tcgetattr (fd, &termios_p))
00019                  return (-1);
00020 
00021          termios_p.c_cc[VMIN] = 1;
00022          termios_p.c_cc[VTIME] = 0;
00023          termios_p.c_lflag &= ~(ECHO | ICANON | ISIG |
00024                  ECHOE | ECHOK | ECHONL);
00025          termios_p.c_oflag &= ~(OPOST);
00026          return (tcsetattr (fd, TCSANOW, &termios_p));
00027  }
00028 
00029  int dev_unraw (int fd)
00030  {
00031          struct termios termios_p;
00032 
00033          if (tcgetattr (fd, &termios_p))
00034                  return (-1);
00035 
00036          termios_p.c_lflag |= (ECHO | ICANON | ISIG |
00037                  ECHOE | ECHOK | ECHONL);
00038          termios_p.c_oflag |= (OPOST);
00039          return (tcsetattr (fd, TCSAFLUSH, &termios_p));
00040  }

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