/*
- * freeglut_input_devices_x11.c
+ * fg_input_devices_x11.c
*
* Handles miscellaneous input devices via direct serial-port access.
* Proper X11 XInput device support is not yet supported.
#include <GL/freeglut.h>
#include "../fg_internal.h"
-#ifdef HAVE_ERRNO_H
#include <errno.h>
-#endif
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct _serialport SERIALPORT;
-void serial_flush ( SERIALPORT *port );
+void fg_serial_flush ( SERIALPORT *port );
/*****************************************************************/
{
}
-SERIALPORT *serial_open ( const char *device )
+SERIALPORT *fg_serial_open ( const char *device )
{
int fd;
struct termios termio;
cfsetospeed(&termio, B9600);
tcsetattr(fd,TCSANOW,&termio);
- serial_flush(port);
+ fg_serial_flush(port);
return port;
}
-void serial_close(SERIALPORT *port)
+void fg_serial_close(SERIALPORT *port)
{
if (port)
{
}
}
-int serial_getchar(SERIALPORT *port)
+int fg_serial_getchar(SERIALPORT *port)
{
unsigned char ch;
if (!port) return EOF;
return EOF;
}
-int serial_putchar(SERIALPORT *port, unsigned char ch)
+int fg_serial_putchar(SERIALPORT *port, unsigned char ch)
{
if (!port) return 0;
return write(port->fd,&ch,1);
}
-void serial_flush ( SERIALPORT *port )
+void fg_serial_flush ( SERIALPORT *port )
{
tcflush ( port->fd, TCIOFLUSH );
}