@@ -2,6 +2,11 @@ namespace Vezel.Cathode.Native;
22
33internal static unsafe partial class TerminalInterop
44{
5+ [ StructLayout ( LayoutKind . Sequential ) ]
6+ public struct TerminalDescriptor
7+ {
8+ }
9+
510 public enum TerminalException
611 {
712 None ,
@@ -98,19 +103,24 @@ bool TryLoad(out nint handle, params string[] paths)
98103 [ UnmanagedCallConv ( CallConvs = [ typeof ( CallConvCdecl ) ] ) ]
99104 public static partial void Initialize ( ) ;
100105
101- [ LibraryImport ( Library , EntryPoint = "cathode_get_handles " ) ]
106+ [ LibraryImport ( Library , EntryPoint = "cathode_get_descriptors " ) ]
102107 [ UnmanagedCallConv ( CallConvs = [ typeof ( CallConvCdecl ) ] ) ]
103- public static partial void GetHandles ( nuint * stdIn , nuint * stdOut , nuint * stdErr , nuint * ttyIn , nuint * ttyOut ) ;
108+ public static partial void GetDescriptors (
109+ TerminalDescriptor * * stdIn ,
110+ TerminalDescriptor * * stdOut ,
111+ TerminalDescriptor * * stdErr ,
112+ TerminalDescriptor * * ttyIn ,
113+ TerminalDescriptor * * ttyOut ) ;
104114
105115 [ LibraryImport ( Library , EntryPoint = "cathode_is_valid" ) ]
106116 [ UnmanagedCallConv ( CallConvs = [ typeof ( CallConvCdecl ) ] ) ]
107117 [ return : MarshalAs ( UnmanagedType . U1 ) ]
108- public static partial bool IsValid ( nuint handle , [ MarshalAs ( UnmanagedType . U1 ) ] bool write ) ;
118+ public static partial bool IsValid ( TerminalDescriptor * descriptor , [ MarshalAs ( UnmanagedType . U1 ) ] bool write ) ;
109119
110120 [ LibraryImport ( Library , EntryPoint = "cathode_is_interactive" ) ]
111121 [ UnmanagedCallConv ( CallConvs = [ typeof ( CallConvCdecl ) ] ) ]
112122 [ return : MarshalAs ( UnmanagedType . U1 ) ]
113- public static partial bool IsInteractive ( nuint handle ) ;
123+ public static partial bool IsInteractive ( TerminalDescriptor * descriptor ) ;
114124
115125 [ LibraryImport ( Library , EntryPoint = "cathode_query_size" ) ]
116126 [ UnmanagedCallConv ( CallConvs = [ typeof ( CallConvCdecl ) ] ) ]
@@ -133,13 +143,13 @@ public static partial TerminalResult SetMode(
133143
134144 [ LibraryImport ( Library , EntryPoint = "cathode_read" ) ]
135145 [ UnmanagedCallConv ( CallConvs = [ typeof ( CallConvCdecl ) ] ) ]
136- public static partial TerminalResult Read ( nuint handle , byte * buffer , int length , int * progress ) ;
146+ public static partial TerminalResult Read ( TerminalDescriptor * descriptor , byte * buffer , int length , int * progress ) ;
137147
138148 [ LibraryImport ( Library , EntryPoint = "cathode_write" ) ]
139149 [ UnmanagedCallConv ( CallConvs = [ typeof ( CallConvCdecl ) ] ) ]
140- public static partial TerminalResult Write ( nuint handle , byte * buffer , int length , int * progress ) ;
150+ public static partial TerminalResult Write ( TerminalDescriptor * descriptor , byte * buffer , int length , int * progress ) ;
141151
142152 [ LibraryImport ( Library , EntryPoint = "cathode_poll" ) ]
143153 [ UnmanagedCallConv ( CallConvs = [ typeof ( CallConvCdecl ) ] ) ]
144- public static partial void Poll ( [ MarshalAs ( UnmanagedType . U1 ) ] bool write , nuint * handles , bool * results , int count ) ;
154+ public static partial void Poll ( [ MarshalAs ( UnmanagedType . U1 ) ] bool write , int * fds , bool * results , int count ) ;
145155}
0 commit comments