Beispiel #1
0
 public void Dispose()
 {
     if (!_disposed && stream != IntPtr.Zero)
     {
         _disposed = true;
         NativeImports.fclose(stream);
         stream = IntPtr.Zero;
     }
 }
Beispiel #2
0
 public IntPtr GetModuleHandle(string moduleName)
 {
     if (moduleName == null)
     {
         return(NativeImports.dlopen(null, NativeImports.RTLD_LAZY));
     }
     else
     {
         throw new NotImplementedException();
     }
 }
Beispiel #3
0
 public void sprintf(StringBuilder sb, string format, IntPtr args)
 {
     NativeImports.vsprintf(sb, format, args);
 }
Beispiel #4
0
 public int vscprintf(string format, IntPtr args)
 {
     return(NativeImports.vsnprintf(null, 0, format, args));
 }
Beispiel #5
0
 public int vscprintf(string format, params VariableArgument[] args)
 {
     using (var combined = Platform.MakeVariableCombiner(args)) {
         return(NativeImports.vsnprintf(null, 0, format, combined.GetPtr()));
     }
 }
Beispiel #6
0
 public static IFileStream open(string filePath, string mode)
 {
     return(new UnixFileStream(NativeImports.fopen(filePath, mode)));
 }
Beispiel #7
0
 public int puts(string str)
 {
     return(NativeImports.fputs(str, stream));
 }
Beispiel #8
0
 public int putc(int c)
 {
     return(NativeImports.putc(c, stream));
 }
Beispiel #9
0
 public int fileno()
 {
     return(NativeImports.fileno(stream));
 }
Beispiel #10
0
 public void FreeLibrary(IntPtr handle)
 {
     NativeImports.dlclose(handle);
 }
Beispiel #11
0
 public IntPtr LoadLibrary(string library_path)
 {
     return(NativeImports.dlopen(library_path, NativeImports.RTLD_LAZY));
 }
Beispiel #12
0
 public IntPtr GetProcAddress(IntPtr handle, string symbol_name)
 {
     return(NativeImports.dlsym(handle, symbol_name));
 }