@@ -14,43 +14,43 @@ import TSCLibc
1414#if os(Windows)
1515#else
1616public final class PseudoTerminal {
17- let master : Int32
18- let slave : Int32
17+ let primary : Int32
18+ let secondary : Int32
1919 public var outStream : LocalFileOutputByteStream
2020
2121 public init ? ( ) {
22- var master : Int32 = 0
23- var slave : Int32 = 0
24- if openpty ( & master , & slave , nil , nil , nil ) != 0 {
22+ var primary : Int32 = 0
23+ var secondary : Int32 = 0
24+ if openpty ( & primary , & secondary , nil , nil , nil ) != 0 {
2525 return nil
2626 }
27- guard let outStream = try ? LocalFileOutputByteStream ( filePointer: fdopen ( slave , " w " ) , closeOnDeinit: false ) else {
27+ guard let outStream = try ? LocalFileOutputByteStream ( filePointer: fdopen ( secondary , " w " ) , closeOnDeinit: false ) else {
2828 return nil
2929 }
3030 self . outStream = outStream
31- self . master = master
32- self . slave = slave
31+ self . primary = primary
32+ self . secondary = secondary
3333 }
3434
35- public func readMaster ( maxChars n: Int = 1000 ) -> String ? {
35+ public func readPrimary ( maxChars n: Int = 1000 ) -> String ? {
3636 var buf : [ CChar ] = [ CChar] ( repeating: 0 , count: n)
37- if read ( master , & buf, n) <= 0 {
37+ if read ( primary , & buf, n) <= 0 {
3838 return nil
3939 }
4040 return String ( cString: buf)
4141 }
4242
43- public func closeSlave ( ) {
44- _ = TSCLibc . close ( slave )
43+ public func closeSecondary ( ) {
44+ _ = TSCLibc . close ( secondary )
4545 }
4646
47- public func closeMaster ( ) {
48- _ = TSCLibc . close ( master )
47+ public func closePrimary ( ) {
48+ _ = TSCLibc . close ( primary )
4949 }
5050
5151 public func close( ) {
52- closeSlave ( )
53- closeMaster ( )
52+ closeSecondary ( )
53+ closePrimary ( )
5454 }
5555}
5656#endif
0 commit comments