private int tc_gsapi_set_stdio(IntPtr instance, gsStdIOHandler stdin, gsStdIOHandler stdout, gsStdIOHandler stderr) { int code; try { if (is64bit) { code = gsapi_set_stdio64(instance, stdin, stdout, stderr); } else { code = gsapi_set_stdio32(instance, stdin, stdout, stderr); } } catch (DllNotFoundException) { /* DLL not found */ String output = "DllNotFoundException: Ghostscript DLL not found"; gsDLLProblemMain(this, output); return(-1); } catch (BadImageFormatException) { /* Using 32 bit with 64 or vice versa */ String output = "BadImageFormatException: Incorrect Ghostscript DLL"; gsDLLProblemMain(this, output); return(-1); } return(code); }
public ghostsharp() { /* Determine now if we are 64 or 32 bit */ is64bit = Environment.Is64BitOperatingSystem && Environment.Is64BitProcess; m_worker = null; gsInstance = IntPtr.Zero; /* Go ahead and do the assignment here */ RaiseStdInCallback = StdInCallback; RaiseStdOutCallback = StdOutCallback; RaiseStdErrCallback = StdErrCallback; }
public static extern int gsapi_set_stdio_with_handle(IntPtr instance, gsStdIOHandler stdin, gsStdIOHandler stdout, gsStdIOHandler stderr, IntPtr caller_handle);
public static extern int gsapi_set_stdio(IntPtr instance, gsStdIOHandler stdin, gsStdIOHandler stdout, gsStdIOHandler stderr);
private static extern int gsapi_set_stdio32(IntPtr instance, gsStdIOHandler stdin, gsStdIOHandler stdout, gsStdIOHandler stderr);
private static extern int gsapi_set_stdio64(IntPtr instance, gsStdIOHandler stdin, gsStdIOHandler stdout, gsStdIOHandler stderr);
private int tc_gsapi_set_stdio(IntPtr instance, gsStdIOHandler stdin, gsStdIOHandler stdout, gsStdIOHandler stderr) { int code; try { if (is64bit) code = gsapi_set_stdio64(instance, stdin, stdout, stderr); else code = gsapi_set_stdio32(instance, stdin, stdout, stderr); } catch (DllNotFoundException) { /* DLL not found */ String output = "DllNotFoundException: Ghostscript DLL not found"; gsDLLProblemMain(this, output); return -1; } catch (BadImageFormatException) { /* Using 32 bit with 64 or vice versa */ String output = "BadImageFormatException: Incorrect Ghostscript DLL"; gsDLLProblemMain(this, output); return -1; } return code; }