*** empty log message ***
This commit is contained in:
parent
b795d76ae4
commit
b988f4008f
@ -56,6 +56,9 @@ EXEEXT=
|
|||||||
OBJEXT=.o
|
OBJEXT=.o
|
||||||
LIBEXT=.a
|
LIBEXT=.a
|
||||||
LNKFLAGS+=-lbe
|
LNKFLAGS+=-lbe
|
||||||
|
#uncomment the following line if you build version to be used
|
||||||
|
#on BONE-powered systems(Dan0 etc.) This improves some operations ...
|
||||||
|
CPPFLAGS+=-DBEOS_BONE_BUILD
|
||||||
else
|
else
|
||||||
CAT=cat
|
CAT=cat
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
@ -41,6 +41,11 @@
|
|||||||
#include <gsigunix.h>
|
#include <gsigunix.h>
|
||||||
#include <gkbdunix.h>
|
#include <gkbdunix.h>
|
||||||
|
|
||||||
|
#ifdef __BEOS__
|
||||||
|
//sz: some undocumented call that behaves in same manner as select ...
|
||||||
|
//used in BEOS_BONE builds ...
|
||||||
|
extern "C" int waiton( int, fd_set *, fd_set *, fd_set *, bigtime_t);
|
||||||
|
#endif
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
int gkbd_stdin = -1;
|
int gkbd_stdin = -1;
|
||||||
@ -157,7 +162,7 @@ void gkbd_tty_reset() {
|
|||||||
|
|
||||||
int gkbd_sys_input_pending(int tsecs) {
|
int gkbd_sys_input_pending(int tsecs) {
|
||||||
|
|
||||||
#ifndef __BEOS__
|
#if not defined(__BEOS__)
|
||||||
static fd_set read_fd_set;
|
static fd_set read_fd_set;
|
||||||
struct timeval wait;
|
struct timeval wait;
|
||||||
long usecs, secs;
|
long usecs, secs;
|
||||||
@ -179,36 +184,38 @@ int gkbd_sys_input_pending(int tsecs) {
|
|||||||
FD_SET(gkbd_stdin, &read_fd_set);
|
FD_SET(gkbd_stdin, &read_fd_set);
|
||||||
|
|
||||||
return select(gkbd_stdin+1, &read_fd_set, NULL, NULL, &wait);
|
return select(gkbd_stdin+1, &read_fd_set, NULL, NULL, &wait);
|
||||||
#else
|
#else // BeOS input handling ...
|
||||||
|
#if defined(BEOS_BONE_BUILD)
|
||||||
|
static fd_set read_fd_set;
|
||||||
|
|
||||||
|
FD_ZERO(&read_fd_set);
|
||||||
|
FD_SET(gkbd_stdin, &read_fd_set);
|
||||||
|
|
||||||
|
return waiton(gkbd_stdin+1, &read_fd_set, NULL, NULL, 0);
|
||||||
|
#else // not a BEOS_BONE_BUILD - use classical input check scheme ...
|
||||||
struct termios term, oterm;
|
struct termios term, oterm;
|
||||||
int fd = gkbd_stdin;
|
|
||||||
int c = 0;
|
|
||||||
|
|
||||||
// get the terminal settings
|
// get the terminal settings
|
||||||
tcgetattr(fd, &oterm);
|
tcgetattr(gkbd_stdin, &oterm);
|
||||||
|
|
||||||
// get a copy of the settings, which we modify
|
// get a copy of the settings, which we modify
|
||||||
memcpy(&term, &oterm, sizeof(term));
|
memcpy(&term, &oterm, sizeof(term));
|
||||||
|
|
||||||
// put the terminal in non-canonical mode, any
|
// put the terminal in non-canonical mode, any
|
||||||
// reads timeout after 0.1 seconds or when a
|
// reads timeout after 0.1 seconds or when a
|
||||||
// single character is read
|
// single character is read
|
||||||
term.c_lflag = term.c_lflag & (!ICANON);
|
term.c_lflag = term.c_lflag & (!ICANON);
|
||||||
term.c_cc[VMIN] = 0;
|
term.c_cc[VMIN] = 0;
|
||||||
term.c_cc[VTIME] = 1;
|
term.c_cc[VTIME] = 1;
|
||||||
tcsetattr(fd, TCSANOW, &term);
|
tcsetattr(gkbd_stdin, TCSANOW, &term);
|
||||||
|
//check input
|
||||||
int bytes = -1;
|
int bytes = -1;
|
||||||
ioctl(fd, TCWAITEVENT, &bytes);
|
ioctl(gkbd_stdin, TCWAITEVENT, &bytes);
|
||||||
|
|
||||||
// reset the terminal to original state
|
// reset the terminal to original state
|
||||||
tcsetattr(fd, TCSANOW, &oterm);
|
tcsetattr(gkbd_stdin, TCSANOW, &oterm);
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
|
#endif //defined(BEOS_BONE_BUILD)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
uint gkbd_sys_getkey() {
|
uint gkbd_sys_getkey() {
|
||||||
|
@ -6,3 +6,7 @@ TARGET=msgidlib
|
|||||||
|
|
||||||
include $(TOP)/GNUmakef.inc
|
include $(TOP)/GNUmakef.inc
|
||||||
include $(TOP)/GNUmakef.lib
|
include $(TOP)/GNUmakef.lib
|
||||||
|
|
||||||
|
ifeq ($(PLATFORM),be)
|
||||||
|
CFLAGS+=-DUNIX=__BEOS__
|
||||||
|
endif
|
||||||
|
@ -39,6 +39,10 @@
|
|||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__BEOS__)
|
||||||
|
#define stricmp strcasecmp
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "hsksupp.h"
|
#include "hsksupp.h"
|
||||||
#include "ffind.h"
|
#include "ffind.h"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user