From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!seas.gwu.edu!mfeldman From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: single-character Ada/Unix input - the Ada package (1 of 2) Message-ID: <2167@sparko.gwu.edu> Date: 22 Sep 90 20:18:29 GMT Reply-To: mfeldman@seas.gwu.edu (Michael Feldman) Organization: The George Washington University, Washington D.C. List-Id: NOTE: This package is supplied with the source code for Ada-Tutor, which is a shareware package distributed by the author listed below. I am sending another file consisting of the C code for the body of ONECHAR.C --------------------------------------------------------------------------- Prof. Michael Feldman Department of Electrical Engineering and Computer Science The George Washington University Washington, DC 20052 202-994-5253 mfeldman@seas.gwu.edu --------------------------------------------------------------------------- -- UNIX.ADA Ver. 1.22 18-FEB-1989 -- Copyright 1988-1989 John J. Herro -- Software Innovations Technology -- 1083 Mandarin Drive NE, Palm Bay, FL 32905-4706 (407)951-0233 -- -- Compile this before compiling ADA_TUTR.ADA on a UNIX based system. You must -- also compile ONECHAR.C or ALTCHAR.C with a C compiler before linking. See -- first page of ADA_TUTR.ADA for more details. -- with TEXT_IO; package CUSTOM_IO is type COLOR is (BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE); FOREGRND_COLOR : COLOR := WHITE; -- Default values in case BACKGRND_COLOR : COLOR := BLACK; -- ADA-TUTR finds no User BORDER_COLOR : COLOR := BLACK; -- File. FORE_COLOR_DIGIT : CHARACTER := CHARACTER'VAL(COLOR'POS(FOREGRND_COLOR)+48); BACK_COLOR_DIGIT : CHARACTER := CHARACTER'VAL(COLOR'POS(BACKGRND_COLOR)+48); NORMAL_COLORS : STRING(1 .. 10) := ASCII.ESC & "[0;3" & FORE_COLOR_DIGIT & ";4" & BACK_COLOR_DIGIT & "m"; CLEAR_SCRN : constant STRING := ASCII.ESC & "[H" & ASCII.ESC & "[2J"; procedure SET_BORDER_COLOR (TO : in COLOR); procedure GET (CHAR : out CHARACTER); procedure PUT (CHAR : in CHARACTER) renames TEXT_IO.PUT; procedure PUT (STR : in STRING) renames TEXT_IO.PUT; procedure PUT_LINE (STR : in STRING) renames TEXT_IO.PUT_LINE; procedure GET_LINE (STR : out STRING; LAST : out NATURAL) renames TEXT_IO.GET_LINE; procedure NEW_LINE (SPACING : in TEXT_IO.COUNT := 1) renames TEXT_IO.NEW_LINE; end CUSTOM_IO; package body CUSTOM_IO is procedure SET_BORDER_COLOR(TO : in COLOR) is -- Dummy procedure for computers other than PCs. begin null; end SET_BORDER_COLOR; procedure GET(CHAR : out CHARACTER) is function ONECHAR return CHARACTER; pragma INTERFACE (C, ONECHAR); begin CHAR := ONECHAR; end GET; end CUSTOM_IO;