1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-02 22:38:02 +02:00

tidying up RISC OS stuff

This commit is contained in:
Stefan Bellon 2002-08-06 06:54:55 +00:00
parent 8298145729
commit 181dcc69f4
8 changed files with 121 additions and 148 deletions

View File

@ -1,3 +1,7 @@
2002-08-06 Stefan Bellon <sbellon@sbellon.de>
* util.h [__riscos__]: Added riscos_getchar().
2002-06-21 Stefan Bellon <sbellon@sbellon.de> 2002-06-21 Stefan Bellon <sbellon@sbellon.de>
* util.h [__riscos__]: Further moving away of RISC OS specific * util.h [__riscos__]: Further moving away of RISC OS specific

View File

@ -270,6 +270,7 @@ void riscos_set_filetype(const char *filename, const char *mimetype);
pid_t riscos_getpid(void); pid_t riscos_getpid(void);
int riscos_kill(pid_t pid, int sig); int riscos_kill(pid_t pid, int sig);
int riscos_access(const char *path, int amode); int riscos_access(const char *path, int amode);
int riscos_getchar(void);
int fdopenfile(const char *filename, const int allow_write); int fdopenfile(const char *filename, const int allow_write);
void close_fds(void); void close_fds(void);
int renamefile(const char *old, const char *new); int renamefile(const char *old, const char *new);

View File

@ -1,3 +1,9 @@
2002-08-06 Stefan Bellon <sbellon@sbellon.de>
* conf-riscos/include/config.h: Changed #define FOO to
#define FOO 1.
* conf-riscos/include/g10defs.h: Likewise.
2002-08-03 Stefan Bellon <sbellon@sbellon.de> 2002-08-03 Stefan Bellon <sbellon@sbellon.de>
* conf-riscos/include/g10defs.h: Added GNUPG_LIBEXECDIR. * conf-riscos/include/g10defs.h: Added GNUPG_LIBEXECDIR.

View File

@ -38,11 +38,11 @@
/* Define if you have alloca, as a function or macro. */ /* Define if you have alloca, as a function or macro. */
/* #undef HAVE_ALLOCA */ /* #undef HAVE_ALLOCA */
#define HAVE_ALLOCA #define HAVE_ALLOCA 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ /* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H */ /* #undef HAVE_ALLOCA_H */
#define HAVE_ALLOCA_H #define HAVE_ALLOCA_H 1
/* #undef _LIBC */ /* #undef _LIBC */
@ -50,7 +50,7 @@
#undef HAVE_DOPRNT #undef HAVE_DOPRNT
/* Define if you have the vprintf function. */ /* Define if you have the vprintf function. */
#define HAVE_VPRINTF #define HAVE_VPRINTF 1
/* Define to `long' if <sys/types.h> doesn't define. */ /* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t #undef off_t
@ -74,26 +74,26 @@
#undef STACK_DIRECTION #undef STACK_DIRECTION
/* Define if you have the ANSI C header files. */ /* Define if you have the ANSI C header files. */
#define STDC_HEADERS #define STDC_HEADERS 1
/* Define if `sys_siglist' is declared by <signal.h>. */ /* Define if `sys_siglist' is declared by <signal.h>. */
#define SYS_SIGLIST_DECLARED #define SYS_SIGLIST_DECLARED 1
#undef M_DEBUG #undef M_DEBUG
#undef M_GUARD #undef M_GUARD
#define PRINTABLE_OS_NAME "RISC OS" #define PRINTABLE_OS_NAME "RISC OS"
/* Define if your locale.h file contains LC_MESSAGES. */ /* Define if your locale.h file contains LC_MESSAGES. */
#define HAVE_LC_MESSAGES #define HAVE_LC_MESSAGES 1
/* Define to 1 if NLS is requested. */ /* Define to 1 if NLS is requested. */
#define ENABLE_NLS 1 #define ENABLE_NLS 1
/* Define as 1 if you have catgets and don't want to use GNU gettext. */ /* Define as 1 if you have catgets and don't want to use GNU gettext. */
#define HAVE_CATGETS 0 #undef HAVE_CATGETS
/* Define as 1 if you have gettext and don't want to use GNU gettext. */ /* Define as 1 if you have gettext and don't want to use GNU gettext. */
#define HAVE_GETTEXT 0 #undef HAVE_GETTEXT
#undef BIG_ENDIAN_HOST #undef BIG_ENDIAN_HOST
#define LITTLE_ENDIAN_HOST 1 #define LITTLE_ENDIAN_HOST 1
@ -169,13 +169,13 @@
#undef HAVE___ARGZ_STRINGIFY #undef HAVE___ARGZ_STRINGIFY
/* Define if you have the atexit function. */ /* Define if you have the atexit function. */
#define HAVE_ATEXIT #define HAVE_ATEXIT 1
/* Define if you have the clock_gettime function. */ /* Define if you have the clock_gettime function. */
#undef HAVE_CLOCK_GETTIME #undef HAVE_CLOCK_GETTIME
/* Define if you have the dcgettext function. */ /* Define if you have the dcgettext function. */
#define HAVE_DCGETTEXT 0 #undef HAVE_DCGETTEXT
/* Define if you have the dlopen function. */ /* Define if you have the dlopen function. */
#undef HAVE_DLOPEN #undef HAVE_DLOPEN
@ -187,25 +187,25 @@
#undef HAVE_FSTAT64 #undef HAVE_FSTAT64
/* Define if you have the getcwd function. */ /* Define if you have the getcwd function. */
#define HAVE_GETCWD #define HAVE_GETCWD 1
/* Define if you have the gethrtime function. */ /* Define if you have the gethrtime function. */
#undef HAVE_GETHRTIME #undef HAVE_GETHRTIME
/* Define if you have the getpagesize function. */ /* Define if you have the getpagesize function. */
#define HAVE_GETPAGESIZE #define HAVE_GETPAGESIZE 1
/* Define if you have the getrusage function. */ /* Define if you have the getrusage function. */
#define HAVE_GETRUSAGE #define HAVE_GETRUSAGE 1
/* Define if you have the gettimeofday function. */ /* Define if you have the gettimeofday function. */
#define HAVE_GETTIMEOFDAY #define HAVE_GETTIMEOFDAY 1
/* Define if you have the memicmp function. */ /* Define if you have the memicmp function. */
#undef HAVE_MEMICMP #undef HAVE_MEMICMP
/* Define if you have the memmove function. */ /* Define if you have the memmove function. */
#define HAVE_MEMMOVE #define HAVE_MEMMOVE 1
/* Define if you have the mlock function. */ /* Define if you have the mlock function. */
#undef HAVE_MLOCK #undef HAVE_MLOCK
@ -220,64 +220,64 @@
#undef HAVE_NL_LANGINFO #undef HAVE_NL_LANGINFO
/* Define if you have the putenv function. */ /* Define if you have the putenv function. */
#define HAVE_PUTENV #define HAVE_PUTENV 1
/* Define if you have the raise function. */ /* Define if you have the raise function. */
#define HAVE_RAISE #define HAVE_RAISE 1
/* Define if you have the rand function. */ /* Define if you have the rand function. */
#define HAVE_RAND #define HAVE_RAND 1
/* Define if you have the setenv function. */ /* Define if you have the setenv function. */
#define HAVE_SETENV #define HAVE_SETENV 1
/* Define if you have the setlocale function. */ /* Define if you have the setlocale function. */
#define HAVE_SETLOCALE #define HAVE_SETLOCALE 1
/* Define if you have the setrlimit function. */ /* Define if you have the setrlimit function. */
#define HAVE_SETRLIMIT #define HAVE_SETRLIMIT 1
/* Define if you have the sigaction function. */ /* Define if you have the sigaction function. */
#define HAVE_SIGACTION #define HAVE_SIGACTION 1
/* Define if you have the sigprocmask function. */ /* Define if you have the sigprocmask function. */
#define HAVE_SIGPROCMASK #define HAVE_SIGPROCMASK 1
/* Define if you have the stpcpy function. */ /* Define if you have the stpcpy function. */
#define HAVE_STPCPY #define HAVE_STPCPY 1
/* Define if you have the strcasecmp function. */ /* Define if you have the strcasecmp function. */
#define HAVE_STRCASECMP #define HAVE_STRCASECMP 1
/* Define if you have the strchr function. */ /* Define if you have the strchr function. */
#define HAVE_STRCHR #define HAVE_STRCHR 1
/* Define if you have the strdup function. */ /* Define if you have the strdup function. */
#define HAVE_STRDUP #define HAVE_STRDUP 1
/* Define if you have the strerror function. */ /* Define if you have the strerror function. */
#define HAVE_STRERROR #define HAVE_STRERROR 1
/* Define if you have the strftime function. */ /* Define if you have the strftime function. */
#define HAVE_STRFTIME #define HAVE_STRFTIME 1
/* Define if you have the stricmp function. */ /* Define if you have the stricmp function. */
#define HAVE_STRICMP #define HAVE_STRICMP 1
/* Define if you have the strlwr function. */ /* Define if you have the strlwr function. */
#undef HAVE_STRLWR #undef HAVE_STRLWR
/* Define if you have the strtoul function. */ /* Define if you have the strtoul function. */
#define HAVE_STRTOUL #define HAVE_STRTOUL 1
/* Define if you have the tcgetattr function. */ /* Define if you have the tcgetattr function. */
#define HAVE_TCGETATTR #undef HAVE_TCGETATTR
/* Define if you have the wait4 function. */ /* Define if you have the wait4 function. */
#define HAVE_WAIT4 #define HAVE_WAIT4 1
/* Define if you have the waitpid function. */ /* Define if you have the waitpid function. */
#define HAVE_WAITPID #define HAVE_WAITPID 1
/* Define if you have the <argz.h> header file. */ /* Define if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H #undef HAVE_ARGZ_H
@ -292,22 +292,22 @@
#undef HAVE_LANGINFO_H #undef HAVE_LANGINFO_H
/* Define if you have the <limits.h> header file. */ /* Define if you have the <limits.h> header file. */
#define HAVE_LIMITS_H #define HAVE_LIMITS_H 1
/* Define if you have the <linux/random.h> header file. */ /* Define if you have the <linux/random.h> header file. */
#undef HAVE_LINUX_RANDOM_H #undef HAVE_LINUX_RANDOM_H
/* Define if you have the <locale.h> header file. */ /* Define if you have the <locale.h> header file. */
#define HAVE_LOCALE_H #define HAVE_LOCALE_H 1
/* Define if you have the <malloc.h> header file. */ /* Define if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H #define HAVE_MALLOC_H 1
/* Define if you have the <nl_types.h> header file. */ /* Define if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H #undef HAVE_NL_TYPES_H
/* Define if you have the <string.h> header file. */ /* Define if you have the <string.h> header file. */
#define HAVE_STRING_H #define HAVE_STRING_H 1
/* Define if you have the <sys/capability.h> header file. */ /* Define if you have the <sys/capability.h> header file. */
#undef HAVE_SYS_CAPABILITY_H #undef HAVE_SYS_CAPABILITY_H
@ -316,25 +316,25 @@
#undef HAVE_SYS_IPC_H #undef HAVE_SYS_IPC_H
/* Define if you have the <sys/mman.h> header file. */ /* Define if you have the <sys/mman.h> header file. */
#define HAVE_SYS_MMAN_H #define HAVE_SYS_MMAN_H 1
/* Define if you have the <sys/param.h> header file. */ /* Define if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H #define HAVE_SYS_PARAM_H 1
/* Define if you have the <sys/shm.h> header file. */ /* Define if you have the <sys/shm.h> header file. */
#undef HAVE_SYS_SHM_H #undef HAVE_SYS_SHM_H
/* Define if you have the <sys/stat.h> header file. */ /* Define if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H #define HAVE_SYS_STAT_H 1
/* Define if you have the <termio.h> header file. */ /* Define if you have the <termio.h> header file. */
#define HAVE_TERMIO_H #undef HAVE_TERMIO_H
/* Define if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H #define HAVE_UNISTD_H 1
/* Define if you have the <zlib.h> header file. */ /* Define if you have the <zlib.h> header file. */
#define HAVE_ZLIB_H #define HAVE_ZLIB_H 1
/* Define if you have the dl library (-ldl). */ /* Define if you have the dl library (-ldl). */
#undef HAVE_LIBDL #undef HAVE_LIBDL
@ -359,15 +359,15 @@
/* define if compiled symbols have a leading underscore */ /* define if compiled symbols have a leading underscore */
#define WITH_SYMBOL_UNDERSCORE #define WITH_SYMBOL_UNDERSCORE 1
#ifdef IS_DEVELOPMENT_VERSION #ifdef IS_DEVELOPMENT_VERSION
#define DEBUG #define DEBUG 1
/* #define M_DEBUG */ /* #define M_DEBUG */
#define M_GUARD #define M_GUARD 1
#endif #endif
#define USE_RNDRISCOS #define USE_RNDRISCOS 1
/* RISC OS specifica */ /* RISC OS specifica */
#if (__CC_NORCROFT == 1) /* Norcroft */ #if (__CC_NORCROFT == 1) /* Norcroft */
@ -383,6 +383,8 @@
#else /* gcc */ #else /* gcc */
#endif #endif
/* #define USE_EXTERNAL_HKP */
#include "g10defs.h" #include "g10defs.h"
#endif /*G10_CONFIG_H*/ #endif /*G10_CONFIG_H*/

View File

@ -38,5 +38,5 @@
/* External process spawning mechanism */ /* External process spawning mechanism */
#if !(defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAITPID)) #if !(defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAITPID))
#define EXEC_TEMPFILE_ONLY #define EXEC_TEMPFILE_ONLY 1
#endif #endif

View File

@ -1,3 +1,8 @@
2002-08-06 Stefan Bellon <sbellon@sbellon.de>
* ttyio.c [__riscos__]: Moved low-level RISC OS stuff to riscos.c.
* riscos.c: Use new SWI calling mechanism of UnixLib.
2002-08-03 Stefan Bellon <sbellon@sbellon.de> 2002-08-03 Stefan Bellon <sbellon@sbellon.de>
* secmem.c (init_pool, secmem_term): Changed #if to #ifdef in * secmem.c (init_pool, secmem_term): Changed #if to #ifdef in

View File

@ -61,19 +61,16 @@ static int initialized = 0;
static int static int
is_read_only(const char *filename) is_read_only(const char *filename)
{ {
_kernel_swi_regs r; int type, attr;
r.r[0] = 17; if (_swix(OS_File, _INR(0,1) | _OUT(0) | _OUT(5),
r.r[1] = (int) filename; 17, filename, &type, &attr))
if (_kernel_swi(OS_File, &r, &r))
log_fatal("Can't get file attributes for %s!\n", filename); log_fatal("Can't get file attributes for %s!\n", filename);
if (r.r[0] == 0) if (type == 0)
log_fatal("Can't find file %s!\n", filename); log_fatal("Can't find file %s!\n", filename);
r.r[0] = 4; if (_swix(OS_File, _INR(0,1) | _IN(5), 4, filename, attr))
if (_kernel_swi(OS_File, &r, &r))
return 1; return 1;
return 0; return 0;
@ -82,13 +79,7 @@ is_read_only(const char *filename)
static void static void
riscos_set_filetype_by_number(const char *filename, int type) riscos_set_filetype_by_number(const char *filename, int type)
{ {
_kernel_swi_regs r; if (_swix(OS_File, _INR(0,2), 18, filename, type))
r.r[0] = 18;
r.r[1] = (int) filename;
r.r[2] = type;
if (_kernel_swi(OS_File, &r, &r))
log_fatal("Can't set filetype for file %s!\n" log_fatal("Can't set filetype for file %s!\n"
"Is the file on a read-only file system?\n", filename); "Is the file on a read-only file system?\n", filename);
} }
@ -105,55 +96,45 @@ riscos_global_defaults(void)
void void
riscos_set_filetype(const char *filename, const char *mimetype) riscos_set_filetype(const char *filename, const char *mimetype)
{ {
_kernel_swi_regs r; int result;
r.r[0] = MMM_TYPE_MIME; if (_swix(MimeMap_Translate, _INR(0,2) | _OUT(3),
r.r[1] = (int) mimetype; MMM_TYPE_MIME, mimetype, MMM_TYPE_RISCOS, &result))
r.r[2] = MMM_TYPE_RISCOS;
if (_kernel_swi(MimeMap_Translate, &r, &r))
log_fatal("Can't translate MIME type %s!\n", mimetype); log_fatal("Can't translate MIME type %s!\n", mimetype);
riscos_set_filetype_by_number(filename, r.r[3]); riscos_set_filetype_by_number(filename, result);
} }
pid_t pid_t
riscos_getpid(void) riscos_getpid(void)
{ {
_kernel_swi_regs r; int state;
r.r[0] = 3; if (_swix(Wimp_ReadSysInfo, _IN(0) | _OUT(0), 3, &state))
if (_kernel_swi(Wimp_ReadSysInfo, &r, &r))
log_fatal("Wimp_ReadSysInfo failed: Can't get WimpState (R0=3)!\n"); log_fatal("Wimp_ReadSysInfo failed: Can't get WimpState (R0=3)!\n");
if (!r.r[0]) if (state)
return (pid_t) 0; if (_swix(Wimp_ReadSysInfo, _IN(0) | _OUT(0), 5, &state))
log_fatal("Wimp_ReadSysInfo failed: Can't get task handle (R0=5)!\n");
r.r[0] = 5; return (pid_t) state;
if (_kernel_swi(Wimp_ReadSysInfo, &r, &r))
log_fatal("Wimp_ReadSysInfo failed: Can't get task handle (R0=5)!\n");
return (pid_t) r.r[0];
} }
int int
riscos_kill(pid_t pid, int sig) riscos_kill(pid_t pid, int sig)
{ {
_kernel_swi_regs r; int buf[4], iter = 0;
int buf[4];
if (sig) if (sig)
kill(pid, sig); kill(pid, sig);
r.r[0] = 0;
do { do {
r.r[1] = (int) buf; if (_swix(TaskManager_EnumerateTasks, _INR(0,2) | _OUT(0),
r.r[2] = 16; iter, buf, 16, &iter))
if (_kernel_swi(TaskManager_EnumerateTasks, &r, &r))
log_fatal("TaskManager_EnumerateTasks failed!\n"); log_fatal("TaskManager_EnumerateTasks failed!\n");
if (buf[0] == pid) if (buf[0] == pid)
return 0; return 0;
} while (r.r[0] >= 0); } while (iter >= 0);
return __set_errno(ESRCH); return __set_errno(ESRCH);
} }
@ -167,6 +148,19 @@ riscos_access(const char *path, int amode)
return access(path, amode); return access(path, amode);
} }
int
riscos_getchar(void)
{
int c, flags;
if (_swix(OS_ReadC, _OUT(0) | _OUT(_FLAGS), &c, &flags))
log_fatal("OS_ReadC failed: Couldn't read from keyboard!\n");
if (flags & _C)
log_fatal("OS_ReadC failed: Return Code = %i!\n", c);
return c;
}
#ifdef DEBUG #ifdef DEBUG
void void
dump_fdlist(void) dump_fdlist(void)
@ -224,13 +218,9 @@ close_fds(void)
int int
renamefile(const char *old, const char *new) renamefile(const char *old, const char *new)
{ {
_kernel_swi_regs r;
_kernel_oserror *e; _kernel_oserror *e;
r.r[0] = 25; if (e = _swix(OS_FSControl, _INR(0,2), 25, old, new)) {
r.r[1] = (int) old;
r.r[2] = (int) new;
if (e = _kernel_swi(OS_FSControl, &r, &r)) {
if (e->errnum == 214) if (e->errnum == 214)
return __set_errno(ENOENT); return __set_errno(ENOENT);
if (e->errnum == 176) if (e->errnum == 176)
@ -244,30 +234,23 @@ renamefile(const char *old, const char *new)
char * char *
gstrans(const char *old) gstrans(const char *old)
{ {
_kernel_swi_regs r; int size = 256, last;
int c = 0;
int size = 256;
char *buf, *tmp; char *buf, *tmp;
buf = (char *) m_alloc(size); buf = (char *) m_alloc(size);
if (!buf) if (!buf)
log_fatal("Can't claim memory for OS_GSTrans buffer!\n"); log_fatal("Can't claim memory for OS_GSTrans buffer!\n");
do { while (_C & _swi(OS_GSTrans, _INR(0,2) | _OUT(2) | _RETURN(_FLAGS),
r.r[0] = (int) old; old, buf, size, &last)) {
r.r[1] = (int) buf; size += 256;
r.r[2] = size; tmp = (char *) m_realloc(buf, size);
_kernel_swi_c(OS_GSTrans, &r, &r, &c); if (!tmp)
if (c) { log_fatal("Can't claim memory for OS_GSTrans buffer!\n");
size += 256; buf = tmp;
tmp = (char *) m_realloc(buf, size); }
if (!tmp)
log_fatal("Can't claim memory for OS_GSTrans buffer!\n");
buf = tmp;
}
} while (c);
buf[r.r[2]] = '\0'; buf[last] = '\0';
tmp = (char *) m_realloc(buf, r.r[2] + 1); tmp = (char *) m_realloc(buf, last + 1);
if (!tmp) if (!tmp)
log_fatal("Can't realloc memory after OS_GSTrans!\n"); log_fatal("Can't realloc memory after OS_GSTrans!\n");
@ -278,41 +261,30 @@ gstrans(const char *old)
void void
list_openfiles(void) list_openfiles(void)
{ {
_kernel_swi_regs r;
char *name; char *name;
int i; int i, len;
for (i = 255; i >= 0; --i) { for (i = 255; i >= 0; --i) {
r.r[0] = 7; if (_swix(OS_Args, _INR(0,2) | _IN(5) | _OUT(5), 7, i, 0, 0, &len))
r.r[1] = i;
r.r[2] = 0;
r.r[5] = 0;
if (_kernel_swi(OS_Args, &r, &r))
continue; continue;
name = (char *) m_alloc(1-r.r[5]); name = (char *) m_alloc(1-len);
if (!name) if (!name)
log_fatal("Can't claim memory for OS_Args buffer!\n"); log_fatal("Can't claim memory for OS_Args buffer!\n");
r.r[0] = 7; if (_swix(OS_Args, _INR(0,2) | _IN(5), 7, i, name, 1-len)) {
r.r[1] = i;
r.r[2] = (int) name;
r.r[5] = 1-r.r[5];
if (_kernel_swi(OS_Args, &r, &r)) {
m_free(name); m_free(name);
log_fatal("Error when calling OS_Args(7)!\n"); log_fatal("Error when calling OS_Args(7)!\n");
} }
r.r[0] = 254; if (_swix(OS_Args, _INR(0,1) | _OUT(0), 254, i, &len)) {
r.r[1] = i;
if (_kernel_swi(OS_Args, &r, &r)) {
m_free(name); m_free(name);
log_fatal("Error when calling OS_Args(254)!\n"); log_fatal("Error when calling OS_Args(254)!\n");
} }
printf("%3i: %s (%c%c)\n", i, name, printf("%3i: %s (%c%c)\n", i, name,
(r.r[0] & 0x40) ? 'R' : 0, (len & 0x40) ? 'R' : 0,
(r.r[0] & 0x80) ? 'W' : 0); (len & 0x80) ? 'W' : 0);
m_free(name); m_free(name);
} }
} }

View File

@ -26,11 +26,6 @@
#include <unistd.h> #include <unistd.h>
#ifdef HAVE_TCGETATTR #ifdef HAVE_TCGETATTR
#include <termios.h> #include <termios.h>
#ifdef __riscos__
#include <kernel.h>
#include <swis.h>
#undef HAVE_TCGETATTR
#endif /* __riscos__ */
#else #else
#ifdef HAVE_TERMIO_H #ifdef HAVE_TERMIO_H
/* simulate termios with termio */ /* simulate termios with termio */
@ -80,13 +75,8 @@ static int batchmode;
static int no_terminal; static int no_terminal;
#ifdef HAVE_TCGETATTR #ifdef HAVE_TCGETATTR
#ifdef __riscos__
struct termios termsave;
int restore_termios;
#else
static struct termios termsave; static struct termios termsave;
static int restore_termios; static int restore_termios;
#endif
#endif #endif
@ -286,10 +276,7 @@ do_get( const char *prompt, int hidden )
char *buf; char *buf;
#ifndef __riscos__ #ifndef __riscos__
byte cbuf[1]; byte cbuf[1];
#else #endif
int carry;
_kernel_swi_regs r;
#endif
int c, n, i; int c, n, i;
if( batchmode ) { if( batchmode ) {
@ -346,11 +333,7 @@ do_get( const char *prompt, int hidden )
#elif defined(__riscos__) #elif defined(__riscos__)
do { do {
if (_kernel_swi_c(OS_ReadC, &r, &r, &carry)) c = riscos_getchar();
log_fatal("OS_ReadC failed: Couldn't read from keyboard!\n");
c = r.r[0];
if (carry != 0)
log_fatal("OS_ReadC failed: Return Code = %i!\n", c);
if (c == 0xa || c == 0xd) { /* Return || Enter */ if (c == 0xa || c == 0xd) { /* Return || Enter */
c = (int) '\n'; c = (int) '\n';
} else if (c == 0x8 || c == 0x7f) { /* Backspace || Delete */ } else if (c == 0x8 || c == 0x7f) { /* Backspace || Delete */