Fix formatting/cleaning

This commit is contained in:
Alexander S. Aganichev 2003-04-03 14:20:58 +00:00
parent 4e195466bd
commit 03de8fcc4b
6 changed files with 47 additions and 85 deletions

View File

@ -44,7 +44,7 @@ ulong getMsgId() {
ulong id;
char *err;
if(CFG->seqmsgid and not (CFG->seqmsgid == MAYBE and *CFG->seqdir == NUL)) {
if(CFG->seqmsgid and not ((CFG->seqmsgid == MAYBE) and (*CFG->seqdir == NUL))) {
id = GenMsgIdEx(CFG->seqdir, CFG->seqoutrun, getClassicMsgId, &err);
if(err) {
LOG.printf("* Warning, SeqMsgId failed: %s, fall to classic algorythm!", err);

View File

@ -52,7 +52,7 @@
// ------------------------------------------------------------------M
#if defined(__UNIX__)
#if not defined(__BEOS__)
#if !defined(__BEOS__)
#define O_TEXT 0
#define O_BINARY 0
#endif

View File

@ -1556,17 +1556,7 @@ gkey kbxget_raw(int mode) {
case Key_F12: k=Key_C_F12; break;
}
}
} /*else if(k == Key_BS) {
// Under Linux we could use TIOCLINUX fn. 6 to read shift states on console
// Of course it is very unportable but should produce good results :-)
int shifts = 6;
if(ioctl(fileno(stdin), TIOCLINUX, &shifts) == -1)
shifts = 0;
if(shifts & ALT)
k = Key_A_BS;
else if(shifts & GCTRL)
k = Key_C_BS;
}*/
}
#endif
return k;

View File

@ -41,12 +41,6 @@
#include <gsigunix.h>
#include <gkbdunix.h>
#ifdef __BEOS__
//sz: some undocumented call that behaves in same manner as select ...
extern "C" int waiton( int, fd_set *, fd_set *, fd_set *, bigtime_t);
#endif
// ------------------------------------------------------------------
int gkbd_stdin = -1;
@ -186,51 +180,31 @@ int gkbd_sys_input_pending(int tsecs) {
return select(gkbd_stdin+1, &read_fd_set, NULL, NULL, &wait);
#else
//bigtime_t t= bigtime_t(secs) * 1000000L + usecs;
///*return*/ waiton(gkbd_stdin+1, &read_fd_set, NULL, NULL, 0/*t * 1000*/);
//return 0;
struct termios term, oterm;
int fd = gkbd_stdin;
int c = 0;
/* get the terminal settings */
// get the terminal settings
tcgetattr(fd, &oterm);
/* get a copy of the settings, which we modify */
// get a copy of the settings, which we modify
memcpy(&term, &oterm, sizeof(term));
/* put the terminal in non-canonical mode, any
reads timeout after 0.1 seconds or when a
single character is read */
// put the terminal in non-canonical mode, any
// reads timeout after 0.1 seconds or when a
// single character is read
term.c_lflag = term.c_lflag & (!ICANON);
term.c_cc[VMIN] = 0;
term.c_cc[VTIME] = 1;
tcsetattr(fd, TCSANOW, &term);
/* get input - timeout after 0.1 seconds or
when one character is read. If timed out
getchar() returns -1, otherwise it returns
the character */
/* c=getchar();
*/
int bytes = -1;
ioctl(fd, TCWAITEVENT, &bytes);
/* reset the terminal to original state */
// reset the terminal to original state
tcsetattr(fd, TCSANOW, &oterm);
/* if we retrieved a character, put it back on
the input stream */
/* if (c != -1)
ungetc(c, stdin);
/* return 1 if the keyboard was hit, or 0 if it
was not hit */
/* return ((c!=-1)?1:0);
*/
return bytes;
#endif
}

View File

@ -90,8 +90,7 @@ void g_set_ostitle(char* title, word dx) {
#ifndef __BEOS__
NW(title);
#else
char fmt[]={'\x1b','\x5d','\x32','\x3b', '%', 's', '\x07', 0};
fprintf(stdout, fmt, title);
printf("\x1b\x5d\x32\x3b%s\x07", title);
fflush(stdout);
#endif
}

View File

@ -52,23 +52,22 @@ char* ggetosstring(void) {
struct utsname info;
if(uname(&info) != -1)
if(uname(&info) != -1) {
#if defined(__EMX__)
sprintf(osstring, "%s %s.%s %s", info.sysname, info.version, info.release, info.machine);
#elif defined(__DJGPP__)
sprintf(osstring, "%s %s.%s %s", info.sysname, info.release, info.version, info.machine);
#elif defined(__BEOS__)
{
BAppFileInfo appFileInfo;
version_info sys_ver = {0};
BFile file("/boot/beos/system/lib/libbe.so", B_READ_ONLY);
appFileInfo.SetTo(&file);
appFileInfo.GetVersionInfo(&sys_ver, B_APP_VERSION_KIND);
sprintf(osstring, "%s %s %s", info.sysname, sys_ver.short_info, info.machine);
}
#else
sprintf(osstring, "%s %s %s", info.sysname, info.release, info.machine);
#endif
}
else
strcpy(osstring, "unknown");