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; ulong id;
char *err; 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); id = GenMsgIdEx(CFG->seqdir, CFG->seqoutrun, getClassicMsgId, &err);
if(err) { if(err) {
LOG.printf("* Warning, SeqMsgId failed: %s, fall to classic algorythm!", err); LOG.printf("* Warning, SeqMsgId failed: %s, fall to classic algorythm!", err);

View File

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

View File

@ -1556,17 +1556,7 @@ gkey kbxget_raw(int mode) {
case Key_F12: k=Key_C_F12; break; 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 #endif
return k; return k;

View File

@ -41,12 +41,6 @@
#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 ...
extern "C" int waiton( int, fd_set *, fd_set *, fd_set *, bigtime_t);
#endif
// ------------------------------------------------------------------ // ------------------------------------------------------------------
int gkbd_stdin = -1; 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); return select(gkbd_stdin+1, &read_fd_set, NULL, NULL, &wait);
#else #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; struct termios term, oterm;
int fd = gkbd_stdin; int fd = gkbd_stdin;
int c = 0; int c = 0;
/* get the terminal settings */ // get the terminal settings
tcgetattr(fd, &oterm); 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)); 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(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; int bytes = -1;
ioctl(fd, TCWAITEVENT, &bytes); ioctl(fd, TCWAITEVENT, &bytes);
/* reset the terminal to original state */ // reset the terminal to original state
tcsetattr(fd, TCSANOW, &oterm); 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; return bytes;
#endif #endif
} }

View File

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

View File

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