------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. -- -- -- -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) -- -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html -- -- -- -- You do not have, nor can you ever acquire the right to use, copy or -- -- distribute this software ; Should you use this software for any purpose, -- -- or copy and distribute it to anyone or in any manner, you are breaking -- -- the laws of whatever soi-disant jurisdiction, and you promise to -- -- continue doing so for the indefinite future. In any case, please -- -- always : read and understand any software ; verify any PGP signatures -- -- that you use - for any purpose. -- -- -- -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . -- ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ package body OS is -- Receive a character from the TTY, and True if success (False if EOF) function Read_Char(C : out Character) return Boolean is i : int; Result : Boolean := False; begin i := GetChar; if i /= EOF then C := Character'Val(i); Result := True; end if; return Result; end Read_Char; -- Send a character to the TTY. procedure Write_Char(C : in Character) is R : int; pragma Unreferenced(R); begin R := PutChar(int(Character'Pos(C))); end Write_Char; -- Send a Newline to the TTY. procedure Write_Newline is begin Write_Char(Character'Val(16#A#)); end Write_Newline; -- Exit with an error condition report. procedure Eggog(M : String) is begin for i in 1 .. M'Length loop To_Stderr(M(I)); end loop; -- Emit LF To_Stderr(Character'Val(16#A#)); -- Exit Quit(Sadness_Code); end; end OS;