relicense to 0BSD
[pforth] / csrc / win32 / pf_io_win32.c
index 6fd93e3..ea21508 100644 (file)
@@ -1,72 +1,75 @@
-/* $Id$ */\r
-/***************************************************************\r
-** I/O subsystem for PForth for WIN32 systems.\r
-**\r
-** Author: Phil Burk\r
-** Copyright 1994 3DO, Phil Burk, Larry Polansky, David Rosenboom\r
-**\r
-** The pForth software code is dedicated to the public domain,\r
-** and any third party may reproduce, distribute and modify\r
-** the pForth software code or any derivative works thereof\r
-** without any compensation or license.  The pForth software\r
-** code is provided on an "as is" basis without any warranty\r
-** of any kind, including, without limitation, the implied\r
-** warranties of merchantability and fitness for a particular\r
-** purpose and their equivalents under the laws of any jurisdiction.\r
-**\r
-****************************************************************\r
-** 941004 PLB Extracted IO calls from pforth_main.c\r
-***************************************************************/\r
-\r
-#include "../pf_all.h"\r
-\r
-#include <conio.h>\r
-\r
-/* Use console mode I/O so that KEY and ?TERMINAL will work. */\r
-#if defined(WIN32) || defined(__NT__)\r
-int  sdTerminalOut( char c )\r
-{\r
-#if defined(__WATCOMC__)\r
-       return putch((char)(c));\r
-#else\r
-       return _putch((char)(c));\r
-#endif\r
-}\r
-\r
-/* Needed cuz _getch() does not echo. */\r
-int  sdTerminalEcho( char c )\r
-{\r
-#if defined(__WATCOMC__)\r
-       return putch((char)(c));\r
-#else\r
-       return _putch((char)(c));\r
-#endif\r
-}\r
-\r
-int  sdTerminalIn( void )\r
-{\r
-       return _getch();\r
-}\r
-\r
-int  sdQueryTerminal( void )\r
-{\r
-       return _kbhit();\r
-}\r
-\r
-int  sdTerminalFlush( void )\r
-{\r
-#ifdef PF_NO_FILEIO\r
-       return -1;\r
-#else\r
-       return fflush(PF_STDOUT);\r
-#endif\r
-}\r
-\r
-void sdTerminalInit( void )\r
-{\r
-}\r
-\r
-void sdTerminalTerm( void )\r
-{\r
-}\r
-#endif\r
+/* $Id$ */
+/***************************************************************
+** I/O subsystem for PForth for WIN32 systems.
+**
+** Author: Phil Burk
+** Copyright 1994 3DO, Phil Burk, Larry Polansky, David Rosenboom
+**
+** Permission to use, copy, modify, and/or distribute this
+** software for any purpose with or without fee is hereby granted.
+**
+** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+** THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
+** CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+** FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+** CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+** OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+**
+****************************************************************
+** 941004 PLB Extracted IO calls from pforth_main.c
+***************************************************************/
+
+#include "../pf_all.h"
+
+#include <conio.h>
+
+/* Use console mode I/O so that KEY and ?TERMINAL will work. */
+#if defined(WIN32) || defined(__NT__)
+int  sdTerminalOut( char c )
+{
+#if defined(__WATCOMC__)
+    return putch((char)(c));
+#else
+    return _putch((char)(c));
+#endif
+}
+
+/* Needed cuz _getch() does not echo. */
+int  sdTerminalEcho( char c )
+{
+#if defined(__WATCOMC__)
+    return putch((char)(c));
+#else
+    return _putch((char)(c));
+#endif
+}
+
+int  sdTerminalIn( void )
+{
+    return _getch();
+}
+
+int  sdQueryTerminal( void )
+{
+    return _kbhit();
+}
+
+int  sdTerminalFlush( void )
+{
+#ifdef PF_NO_FILEIO
+    return -1;
+#else
+    return fflush(PF_STDOUT);
+#endif
+}
+
+void sdTerminalInit( void )
+{
+}
+
+void sdTerminalTerm( void )
+{
+}
+#endif