diff options
author | dianshi <arturs.artamonovs@protonmail.com> | 2023-06-24 08:40:22 +0100 |
---|---|---|
committer | dianshi <arturs.artamonovs@protonmail.com> | 2023-06-24 08:40:22 +0100 |
commit | ea061d5b7aa3c41c32c4b3f6d79f389e176c1216 (patch) | |
tree | a17713f8427b4edce8b9ecc2ea0e951cee02b53b /LibTerm/TermIO.swift | |
parent | e46a011e0289d58e77145577dcc5ae850f41e30d (diff) | |
download | r820sdr-init-ea061d5b7aa3c41c32c4b3f6d79f389e176c1216.tar.gz r820sdr-init-ea061d5b7aa3c41c32c4b3f6d79f389e176c1216.zip |
Add all missing sourcesmain
Diffstat (limited to 'LibTerm/TermIO.swift')
-rw-r--r-- | LibTerm/TermIO.swift | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/LibTerm/TermIO.swift b/LibTerm/TermIO.swift new file mode 100644 index 0000000..cbfb7a5 --- /dev/null +++ b/LibTerm/TermIO.swift @@ -0,0 +1,38 @@ +// +// TermIO.swift +// CmdLine +// +// Created by Jacky Jack on 07/06/2023. +// + +import Foundation + +class TermIO { + var term:Term + + init(term: Term) { + self.term = term + } + + func print(s: String) { + + } + + func getC() -> UInt8 { + var c:UInt8 = 0x0 + let fret = read(self.term.ifd, UnsafeMutableRawPointer(&c), 1); + if (fret == 1) { + return c; + } + return 0 + } + + func putC(_ c: UInt8) { + var buf = c + write(self.term.ofd, UnsafeRawPointer(&buf), 1) + } + + func readline(_ flag: Int) -> String { + return "<Empty>" + } +} |