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