diff --git a/configure b/configure index 49b39c20..e6630392 100755 --- a/configure +++ b/configure @@ -278,13 +278,12 @@ SYSSRCS=' console.cpp console_amiga.cpp console_stdc.cpp -console_posix.cpp +console_termios.cpp console_windows.cpp filesystem_amiga.cpp filesystem_stdc.cpp language.cpp language_amiga.cpp -language_posix.cpp language_stdc.cpp preferences.cpp preferences_amiga.cpp diff --git a/src/amath.h b/src/amath.h index 12517cb5..3e05bbfc 100644 --- a/src/amath.h +++ b/src/amath.h @@ -84,28 +84,23 @@ # endif #endif /******************************************************************************/ -#if defined(HAIKU) || defined(UNIX) || defined(APPLE) || defined(_POSIX_VERSION) -# ifndef POSIX -# define POSIX +#if defined(HAIKU) || defined(UNIX) || defined(APPLE) +# ifndef TERMIOS +# define TERMIOS # endif -#endif -/******************************************************************************/ -#if !defined(AMIGA) && !defined(POSIX) && !defined(WINDOWS) -# ifndef STDC_CONSOLE -# define STDC_CONSOLE -# endif -#endif -/******************************************************************************/ -#if defined(POSIX) # include # include -# include #endif /******************************************************************************/ #if defined(WINDOWS) # include #endif /******************************************************************************/ +#if defined(AROS) || defined(MORPHOS) || defined(AOS4) +# include +# include +#endif +/******************************************************************************/ #if defined(AOS3) # include # define IPTR LONG* @@ -116,11 +111,6 @@ typedef u_int32_t uint32_t; typedef u_int64_t uint64_t; #endif /******************************************************************************/ -#if defined(AROS) || defined(MORPHOS) || defined(AOS4) || defined(APPLE) -# include -# include -#endif -/******************************************************************************/ #if (__cplusplus <= 199711L && !defined(WINDOWS)) || !defined(__cplusplus) #ifndef nullptr #define nullptr 0 diff --git a/src/clib/alloccpy.c b/src/clib/alloccpy.c index 6384aa59..5f944fd3 100644 --- a/src/clib/alloccpy.c +++ b/src/clib/alloccpy.c @@ -29,7 +29,7 @@ #include "amathc.h" -#ifdef AMIGA +#if defined(AMIGA) #include #endif @@ -58,7 +58,7 @@ unsigned int AllocAndCopy(char** destination, const char* source) *destination = AllocMemSafe(size); d = *destination; -#ifdef AMIGA // Take advantage of exec +#if defined(AMIGA) // Take advantage of exec CopyMem(s, d, n); #else while (n--) diff --git a/src/clib/mem.c b/src/clib/mem.c index b525efe3..11d4adf7 100644 --- a/src/clib/mem.c +++ b/src/clib/mem.c @@ -29,7 +29,7 @@ #include "amathc.h" -#ifdef AMIGA +#if defined(AMIGA) #include #include #include diff --git a/src/clib/memcpy.c b/src/clib/memcpy.c index 1a63d573..d72bd9da 100644 --- a/src/clib/memcpy.c +++ b/src/clib/memcpy.c @@ -47,7 +47,7 @@ #pragma GCC diagnostic ignored "-Wcast-align" #endif -#ifdef AMIGA +#if defined(AMIGA) #include #endif @@ -84,7 +84,7 @@ void MemCopy(void* destination, const void* source, unsigned int length) if ((mem_ptr)dst < (mem_ptr)src) { // Copy forward -#ifdef AMIGA // Take advantage of exec +#if defined(AMIGA) // Take advantage of exec CopyMem((void*)source, destination, length); #else t = (mem_ptr)src; // only need low bits diff --git a/src/main.cpp b/src/main.cpp index 4d66fb1f..f6add9d8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,7 +39,7 @@ const char* vers = TXTDOSVERSION; class Program* Program = nullptr; -#ifdef AMIGA +#if defined(AMIGA) #include static struct DosBase *DosBase = nullptr; static struct GfxBase *GfxBase = nullptr; diff --git a/src/main/evaluator.cpp b/src/main/evaluator.cpp index 319cb59e..d2de1810 100644 --- a/src/main/evaluator.cpp +++ b/src/main/evaluator.cpp @@ -55,7 +55,7 @@ void Evaluator::Evaluate() const SyntaxNode* node = parser->Parse(); delete parser; -#ifdef DEBUGTREE +#if defined(DEBUGTREE) Viewer* viewer = new Viewer(node); const char* vout = viewer->GetTree(); output->EnsureGrowth(StrLen(vout)); @@ -68,7 +68,7 @@ void Evaluator::Evaluate() const node = optimizer->GetRoot(); delete optimizer; -#ifdef DEBUGTREE +#if defined(DEBUGTREE) viewer = new Viewer(node); vout = viewer->GetTree(); output->EnsureGrowth(StrLen(vout)); diff --git a/src/main/parser.cpp b/src/main/parser.cpp index 0357263d..0a8aec26 100644 --- a/src/main/parser.cpp +++ b/src/main/parser.cpp @@ -209,7 +209,7 @@ SyntaxNode* Parser::ParseStatement() case symexit: res = new ExitStatement(); break; -#if !defined(STDC_CONSOLE) +#if !defined(AMIGA) && !defined(TERMIOS) && !defined(WINDOWS) case symclear: res = new ClearStatement(); break; diff --git a/src/main/statement/help.cpp b/src/main/statement/help.cpp index 8657b794..f76568df 100644 --- a/src/main/statement/help.cpp +++ b/src/main/statement/help.cpp @@ -90,7 +90,7 @@ char* HelpStatement::StatementHelp() const output->ClearBuffer(); APPENDHELP(STATEMENTLINE) -#if !defined(STDC_CONSOLE) +#if !defined(AMIGA) && !defined(TERMIOS) && !defined(WINDOWS) APPENDHELP(STATEMENTCLEAR) #endif APPENDHELP(STATEMENTDEF) diff --git a/src/main/viewer.cpp b/src/main/viewer.cpp index 8288d249..8c4fe711 100644 --- a/src/main/viewer.cpp +++ b/src/main/viewer.cpp @@ -32,7 +32,7 @@ #include "viewer.h" #include "lib/charbuf.h" -#ifdef DEBUGTREE +#if defined(DEBUGTREE) Viewer::Viewer(SyntaxNode* root) { diff --git a/src/main/viewer.h b/src/main/viewer.h index 2ae00fe3..89ad0e89 100644 --- a/src/main/viewer.h +++ b/src/main/viewer.h @@ -39,13 +39,12 @@ #include "nodes.h" #include "lib/charbuf.h" -#ifdef DEBUGTREE +#if defined(DEBUGTREE) /** * @brief Control class displaying a syntax tree * @details * Define DEBUGTREE to enable the tree viewer. - * */ class Viewer { diff --git a/src/system/console_stdc.cpp b/src/system/console_stdc.cpp index 6849b836..f954e369 100644 --- a/src/system/console_stdc.cpp +++ b/src/system/console_stdc.cpp @@ -31,7 +31,7 @@ #include "console_stdc.h" #include "main/evaluator.h" -#if defined(STDC_CONSOLE) +#if !defined(AMIGA) && !defined(TERMIOS) && !defined(WINDOWS) #include StandardConsole::StandardConsole(const char* prompt) : diff --git a/src/system/console_stdc.h b/src/system/console_stdc.h index 53a7030b..729ca448 100644 --- a/src/system/console_stdc.h +++ b/src/system/console_stdc.h @@ -39,7 +39,7 @@ #include "amath.h" #include "console.h" -#if defined(STDC_CONSOLE) +#if !defined(AMIGA) && !defined(TERMIOS) && !defined(WINDOWS) /** * @brief Encapsulates the IO of a Standard C console. diff --git a/src/system/console_posix.cpp b/src/system/console_termios.cpp similarity index 86% rename from src/system/console_posix.cpp rename to src/system/console_termios.cpp index 335140db..0523e2c3 100644 --- a/src/system/console_posix.cpp +++ b/src/system/console_termios.cpp @@ -30,27 +30,27 @@ #include "amath.h" #include "amathc.h" #include "console.h" -#include "console_posix.h" +#include "console_termios.h" #include "lib/charval.h" #include "lib/aengine.h" #include "main/evaluator.h" -#if defined(POSIX) +#if defined(TERMIOS) #include #include -PosixConsole::PosixConsole(const char* prompt, CharValidator* validator) : +TermiosConsole::TermiosConsole(const char* prompt, CharValidator* validator) : ConsoleBase(prompt), line(nullptr), exit(false) { proc = new AnsiConoleEngine(prompt, validator); } -PosixConsole::~PosixConsole() +TermiosConsole::~TermiosConsole() { delete proc; } -bool PosixConsole::Open() +bool TermiosConsole::Open() { if (tcgetattr(STDIN_FILENO, &oldAttr) != 0) { @@ -66,7 +66,7 @@ bool PosixConsole::Open() return (tcsetattr(STDIN_FILENO, TCSANOW, &newAttr) != -1); } -void PosixConsole::Close() +void TermiosConsole::Close() { if (!termError) { @@ -74,7 +74,7 @@ void PosixConsole::Close() } } -void PosixConsole::Start() +void TermiosConsole::Start() { exit = false; StartMessage(); @@ -91,12 +91,12 @@ void PosixConsole::Start() } } -void PosixConsole::Exit() +void TermiosConsole::Exit() { exit = true; } -void PosixConsole::ReadLine() +void TermiosConsole::ReadLine() { char c; proc->StartInput(); @@ -116,12 +116,12 @@ void PosixConsole::ReadLine() line = proc->GetLine(); } -void PosixConsole::WriteString(const char* string) +void TermiosConsole::WriteString(const char* string) { Write(string, StrLen(string)); } -void PosixConsole::Write(const char* string, unsigned int length) +void TermiosConsole::Write(const char* string, unsigned int length) { ssize_t res = write(STDOUT_FILENO, string, length); if (res != length) @@ -130,7 +130,7 @@ void PosixConsole::Write(const char* string, unsigned int length) } } -void PosixConsole::SetPrompt(const char* string) +void TermiosConsole::SetPrompt(const char* string) { ConsoleBase::SetPrompt(string); proc->SetPrompt(string); diff --git a/src/system/console_posix.h b/src/system/console_termios.h similarity index 89% rename from src/system/console_posix.h rename to src/system/console_termios.h index 2a9c5959..df7a6883 100644 --- a/src/system/console_posix.h +++ b/src/system/console_termios.h @@ -27,11 +27,11 @@ * */ -#ifndef AMATH_POSIX_CONSOLE -#define AMATH_POSIX_CONSOLE +#ifndef AMATH_TERMIOS_CONSOLE +#define AMATH_TERMIOS_CONSOLE /** - * @file console_posix.h + * @file console_termios.h * @brief Standard C and termios based console. * */ @@ -42,18 +42,18 @@ #include "lib/charval.h" #include "lib/aengine.h" -#if defined(POSIX) +#if defined(TERMIOS) #include /** * @brief Encapsulates the IO of a console using Standard C and termios. * */ -class PosixConsole : public ConsoleBase +class TermiosConsole : public ConsoleBase { public: - PosixConsole(const char* prompt, CharValidator* validator); - virtual ~PosixConsole(); + TermiosConsole(const char* prompt, CharValidator* validator); + virtual ~TermiosConsole(); virtual bool Open(); virtual void Close(); virtual void Start(); diff --git a/src/system/filesystem_amiga.cpp b/src/system/filesystem_amiga.cpp index 7b892875..773a08c4 100644 --- a/src/system/filesystem_amiga.cpp +++ b/src/system/filesystem_amiga.cpp @@ -34,14 +34,12 @@ #include "lib/charbuf.h" #include "loc/text.h" -#ifdef AMIGA +#if defined(AMIGA) #include /** * @brief - * * http://en.wikibooks.org/wiki/Aros/Developer/Docs/Libraries/DOS#Examine_Files_or_Directories - * */ CharBuffer* AmigaFilesystem::ListDirectory(const char* path) { diff --git a/src/system/filesystem_amiga.h b/src/system/filesystem_amiga.h index 29da6792..4087f491 100644 --- a/src/system/filesystem_amiga.h +++ b/src/system/filesystem_amiga.h @@ -32,15 +32,14 @@ /** * @file filesystem_amiga.h - * @brief Amiga OS specific file system calls. - * + * @brief Amiga OS specific file system calls */ #include "amath.h" #include "amathc.h" #include "filesystem.h" -#ifdef AMIGA +#if defined(AMIGA) class AmigaFilesystem : public FilesystemBase { diff --git a/src/system/filesystem_stdc.cpp b/src/system/filesystem_stdc.cpp index 348b8840..bbc20712 100644 --- a/src/system/filesystem_stdc.cpp +++ b/src/system/filesystem_stdc.cpp @@ -40,6 +40,10 @@ #include #include +#if defined(UNIX) || defined(HAIKU) +#include +#endif + CharBuffer* StandardFilesystem::ListDirectory(const char* path) { #if defined(UNIX) || defined(HAIKU) @@ -86,7 +90,7 @@ CharBuffer* StandardFilesystem::ListDirectory(const char* path) const char *type; -#ifdef HAIKU +#if defined(HAIKU) type = TXTLISTDIRTUNKNOWN; #else switch (entry->d_type) { diff --git a/src/system/filesystem_stdc.h b/src/system/filesystem_stdc.h index 3abd6f1f..6be47e40 100644 --- a/src/system/filesystem_stdc.h +++ b/src/system/filesystem_stdc.h @@ -32,7 +32,7 @@ /** * @file filesystem_stdc.h - * @brief Standard C compliant file system calls. + * @brief Standard C compliant file system calls * */ @@ -55,5 +55,4 @@ private: }; #endif - #endif diff --git a/src/system/language.cpp b/src/system/language.cpp index 5cd7604a..e8bce2c3 100644 --- a/src/system/language.cpp +++ b/src/system/language.cpp @@ -41,7 +41,7 @@ static const texttag ansiTags[] = { {"#HEADLINE#", "\x1B[1m"}, -#ifdef UNIX +#if defined(UNIX) {"#SYNTAXHIGHLIGHT#", "\x1B[3m\x1B[32m"}, #else {"#SYNTAXHIGHLIGHT#", "\x1B[32m"}, diff --git a/src/system/language_amiga.cpp b/src/system/language_amiga.cpp index 01011b19..ab2ecf0e 100644 --- a/src/system/language_amiga.cpp +++ b/src/system/language_amiga.cpp @@ -36,7 +36,7 @@ #include "loc/ident.h" #include "loc/kword.h" -#ifdef AMIGA +#if defined(AMIGA) #include AmigaLanguage::AmigaLanguage() : diff --git a/src/system/language_amiga.h b/src/system/language_amiga.h index 1a610cdf..2b2fe04e 100644 --- a/src/system/language_amiga.h +++ b/src/system/language_amiga.h @@ -30,11 +30,14 @@ #ifndef AMATH_LANGUAGE_AMIGA_H #define AMATH_LANGUAGE_AMIGA_H +#include "amath.h" #include "language.h" #include "loc/help.h" #include "loc/text.h" #include "loc/kword.h" +#if defined(AMIGA) + class AmigaLanguage : public Language { public: @@ -64,3 +67,4 @@ private: }; #endif +#endif diff --git a/src/system/language_posix.cpp b/src/system/language_posix.cpp deleted file mode 100644 index e8f74b42..00000000 --- a/src/system/language_posix.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/*- - * Copyright (c) 2014-2017 Carsten Sonne Larsen - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Project homepage: - * http://amath.innolan.net - * - */ - -#include "amath.h" -#include "amathc.h" -#include "program.h" -#include "language_posix.h" -#include "loc/help.h" -#include "loc/text.h" -#include "loc/ident.h" -#include "loc/kword.h" - -#if defined(UNIX) -#include -#include /* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html */ -#include /* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html */ -#include /* http://pubs.opengroup.org/onlinepubs/7908799/xsh/nl_types.h.html */ -#include - -PosixLanguage::PosixLanguage() : - Language() -{ -// locale = newlocale(LC_ALL, "da_DK.ISO8859-15", (locale_t)0); -// setlocale(LC_NUMERIC, "da_DK.ISO8859-15"); - locale = newlocale(LC_ALL, "", (locale_t)0); - setlocale(LC_NUMERIC, ""); - conv = localeconv(); -} - -PosixLanguage::~PosixLanguage() -{ - freelocale(locale); -} - -bool PosixLanguage::CharIsAlNum(long unsigned int character) -{ - return (bool)isalnum_l((int)character, locale); -} - -bool PosixLanguage::CharIsAlpha(long unsigned int character) -{ - return (bool)isalpha_l((int)character, locale); -} - -bool PosixLanguage::CharIsCntrl(long unsigned int character) -{ - return (bool)iscntrl_l((int)character, locale); -} - -bool PosixLanguage::CharIsDigit(long unsigned int character) -{ - return (bool)isdigit_l((int)character, locale); -} - -bool PosixLanguage::CharIsPunct(long unsigned int character) -{ - return (bool)ispunct_l((int)character, locale); -} - -bool PosixLanguage::CharIsSpace(long unsigned int character) -{ - return (bool)isspace_l((int)character, locale); -} - -char PosixLanguage::GetFractionPoint() -{ - return *(conv->decimal_point); -} - -bool PosixLanguage::StrIsEqualLoc(const char* s1, const char* s2) -{ - size_t len = StrLen(s2) * 2; - char *tmp = new char[len]; - strxfrm(tmp, s2, len); - bool res = StrIsEqual(s1, tmp); - delete [] tmp; - return res; -} - -char* PosixLanguage::Translate(identhelpdef* def) -{ - return (char*)def->text; -} - -char* PosixLanguage::Translate(helptextdef* def) -{ - return (char*)def->text; -} - -char* PosixLanguage::Translate(textdef* def) -{ - return (char*)def->text; -} - -bool PosixLanguage::Validate(char c) -{ - return (c >= 32 && c <= 126); -} - -#endif diff --git a/src/system/language_posix.h b/src/system/language_posix.h deleted file mode 100644 index 44943342..00000000 --- a/src/system/language_posix.h +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * Copyright (c) 2014-2017 Carsten Sonne Larsen - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Project homepage: - * http://amath.innolan.net - * - */ - -#ifndef _LANGUAGE_POSIX_H -#define _LANGUAGE_POSIX_H - -#include "amath.h" -#include "amathc.h" -#include "language.h" -#include "loc/help.h" -#include "loc/text.h" -#include "loc/kword.h" - -#ifdef UNIX -#include -#include -#include - -class PosixLanguage : public Language { -public: - PosixLanguage(); - ~PosixLanguage(); - char GetFractionPoint(); - bool CharIsAlNum(unsigned long character); - bool CharIsAlpha(unsigned long character); - bool CharIsDigit(unsigned long character); - bool CharIsPunct(unsigned long character); - bool CharIsSpace(unsigned long character); - bool CharIsCntrl(unsigned long character); - bool StrIsEqualLoc(const char *s1, const char *s2); - bool Validate(char c); - -protected: - char* Translate(textdef *def); - char* Translate(helptextdef *def); - char* Translate(identhelpdef *def); - -private: - locale_t locale; - struct lconv *conv; -}; -#endif - -#endif diff --git a/src/system/language_stdc.h b/src/system/language_stdc.h index 8ccf344b..09153b44 100644 --- a/src/system/language_stdc.h +++ b/src/system/language_stdc.h @@ -77,5 +77,4 @@ private: }; #endif - #endif diff --git a/src/system/preferences_amiga.cpp b/src/system/preferences_amiga.cpp index fb58b2b8..2e697405 100644 --- a/src/system/preferences_amiga.cpp +++ b/src/system/preferences_amiga.cpp @@ -33,7 +33,7 @@ #include "preferences.h" #include "preferences_amiga.h" -#ifdef AMIGA +#if defined(AMIGA) #include static const char *tempname = "ENV:amath.prefs"; diff --git a/src/system/preferences_amiga.h b/src/system/preferences_amiga.h index 0c552d48..7a7dbc22 100644 --- a/src/system/preferences_amiga.h +++ b/src/system/preferences_amiga.h @@ -30,8 +30,11 @@ #ifndef AMATH_PREFERENCES_AMIGA_H #define AMATH_PREFERENCES_AMIGA_H +#include "amath.h" #include "preferences.h" +#if defined(AMIGA) + class AmigaPreferences : public PreferencesBase { public: @@ -44,3 +47,4 @@ private: }; #endif +#endif diff --git a/src/system/program.cpp b/src/system/program.cpp index 73b8b208..c769abb0 100644 --- a/src/system/program.cpp +++ b/src/system/program.cpp @@ -33,7 +33,6 @@ #include "language.h" #include "language_stdc.h" #include "language_amiga.h" -#include "language_posix.h" #include "filesystem.h" #include "filesystem_stdc.h" #include "filesystem_amiga.h" @@ -52,11 +51,7 @@ Program::Program() : Variables = new VariableList(); Functions = new FunctionList(); ins = new RealNumber(); -#if defined(UNIX) - Language = new PosixLanguage(); - Filesystem = new StandardFilesystem(); - Preferences = new StandardPreferences(); -#elif defined(AMIGA) +#if defined(AMIGA) Language = new AmigaLanguage(); Filesystem = new AmigaFilesystem(); Preferences = new AmigaPreferences(); diff --git a/src/system/program_amiga.cpp b/src/system/program_amiga.cpp index 39df4564..7e33a46e 100644 --- a/src/system/program_amiga.cpp +++ b/src/system/program_amiga.cpp @@ -44,7 +44,7 @@ #define ARGS_FORMAT "SHELL/S,NOANSI/S,INPUT/F" #include -#ifdef AOS3 +#if defined(AOS3) # define RDPTR LONG* #else # define RDPTR IPTR* diff --git a/src/system/program_haiku.cpp b/src/system/program_haiku.cpp index 85659487..0cf4403c 100644 --- a/src/system/program_haiku.cpp +++ b/src/system/program_haiku.cpp @@ -33,7 +33,7 @@ #include "filesystem.h" #include "program_haiku.h" #include "window_haiku.h" -#include "console_posix.h" +#include "console_termios.h" #include "lib/charbuf.h" #include "main/evaluator.h" @@ -77,7 +77,7 @@ void HaikuProgram::Initialize(int argc, char **argv) return; } - Console = new PosixConsole(Preferences->GetPrompt(), Language); + Console = new TermiosConsole(Preferences->GetPrompt(), Language); SetAnsiMode(true); line = new CharBuffer(); diff --git a/src/system/program_stdc.cpp b/src/system/program_stdc.cpp index a50ae0c2..40e49fe0 100644 --- a/src/system/program_stdc.cpp +++ b/src/system/program_stdc.cpp @@ -30,8 +30,8 @@ #include "amath.h" #include "amathc.h" #include "program_stdc.h" -#include "console_posix.h" #include "console_stdc.h" +#include "console_termios.h" #include "console_windows.h" #include "preferences_stdc.h" #include "lib/charbuf.h" @@ -65,8 +65,8 @@ void StandardProgram::Initialize(int argc, char** argv) { #if defined(WINDOWS) Console = new WindowsConsole(Preferences->GetPrompt(), Language); -#elif defined(POSIX) - Console = new PosixConsole(Preferences->GetPrompt(), Language); +#elif defined(TERMIOS) + Console = new TermiosConsole(Preferences->GetPrompt(), Language); #else Console = new StandardConsole(Preferences->GetPrompt(), Language); #endif diff --git a/src/system/window_amiga.cpp b/src/system/window_amiga.cpp index fca95bad..85acf225 100644 --- a/src/system/window_amiga.cpp +++ b/src/system/window_amiga.cpp @@ -275,28 +275,3 @@ void AmigaWindow::SetPrompt(const char* string) } #endif - - -//http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node046C.html#line6 - -//#include -// -//BOOL AskKeyMap(struct IOStdReq *request, struct KeyMap *keymap) -//{ -// request->io_Command = CD_ASKKEYMAP; -// request->io_Length = sizeof(struct KeyMap); -// request->io_Data = (APTR)keymap; /* where to put it */ -// DoIO(request); -// if(request->io_Error) return(FALSE); -// else return(TRUE); /* if no error, it worked. */ -//} - -//BOOL SetKeyMap(struct IOStdReq *request,struct KeyMap *keymap) -//{ -// request->io_Command = CD_SETKEYMAP; -// request->io_Length = sizeof(struct KeyMap); -// request->io_Data = (APTR)keymap; /* where to get it */ -// DoIO(request); -// if(request->io_Error) return(FALSE); -// else return(TRUE); /* if no error, it worked. */ -//} diff --git a/src/system/window_haiku.h b/src/system/window_haiku.h index 89bfccab..e7c034eb 100644 --- a/src/system/window_haiku.h +++ b/src/system/window_haiku.h @@ -94,4 +94,3 @@ private: #endif #endif -