-
+ 0D869ED1DF92233694F2909B5E1F747E2D6A10BB249295DB47A6A06291ADFFBC091A29B025175FB99ADADBDA319408EF11A95BE26FBD0A92CEACEDDEE0A03B36ffa/ffacalc/os.adb(0 . 0)(1 . 66)
834 ------------------------------------------------------------------------------
835 ------------------------------------------------------------------------------
836 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
837 -- --
838 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
839 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
840 -- --
841 -- You do not have, nor can you ever acquire the right to use, copy or --
842 -- distribute this software ; Should you use this software for any purpose, --
843 -- or copy and distribute it to anyone or in any manner, you are breaking --
844 -- the laws of whatever soi-disant jurisdiction, and you promise to --
845 -- continue doing so for the indefinite future. In any case, please --
846 -- always : read and understand any software ; verify any PGP signatures --
847 -- that you use - for any purpose. --
848 -- --
849 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
850 ------------------------------------------------------------------------------
851 ------------------------------------------------------------------------------
852
853 package body OS is
854
855 -- Receive a character from the TTY, and True if success (False if EOF)
856 function Read_Char(C : out Character) return Boolean is
857 i : int;
858 Result : Boolean := False;
859 begin
860 i := GetChar;
861 if i /= EOF then
862 C := Character'Val(i);
863 Result := True;
864 end if;
865 return Result;
866 end Read_Char;
867
868
869 -- Send a character to the TTY.
870 procedure Write_Char(C : in Character) is
871 R : int;
872 pragma Unreferenced(R);
873 begin
874 R := PutChar(int(Character'Pos(C)));
875 end Write_Char;
876
877
878 -- Send a Newline to the TTY.
879 procedure Write_Newline is
880 begin
881 Write_Char(Character'Val(16#A#));
882 end Write_Newline;
883
884
885 -- Exit with an error condition report.
886 procedure Eggog(M : String) is
887 begin
888 for i in 1 .. M'Length loop
889 To_Stderr(M(I));
890 end loop;
891
892 -- Emit LF
893 To_Stderr(Character'Val(16#A#));
894
895 -- Exit
896 Quit(Sadness_Code);
897 end;
898
899 end OS;