summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/API.htm')
-rw-r--r--doc/API.htm212
1 files changed, 79 insertions, 133 deletions
diff --git a/doc/API.htm b/doc/API.htm
index 982c6434..c994ae13 100644
--- a/doc/API.htm
+++ b/doc/API.htm
@@ -1,102 +1,74 @@
<!doctype html>
-<html>
+<html lang="en">
<head>
-<meta charset="UTF-8">
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
-<link rel="shortcut icon" type="image/png" href="../../images/favicon.png">
-<title>The Ghostscript Interpreter Application Programming Interface (API)</title>
- <!-- Supercedes the API in DLL.htm -->
-<link href="style.css" rel="stylesheet" type="text/css">
-<link href="gs-style.css" rel="stylesheet" type="text/css">
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
+ <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
+ <link rel="shortcut icon" href="images/favicon.svg">
+ <title>The Ghostscript Interpreter Application Programming Interface (API)</title>
+ <link href="default.css" rel="stylesheet" type="text/css">
</head>
<body>
+ <header><div class="title"><a href="index.html"><h1>Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a>
+ </header>
+ <main>
- <div class="header">
- <div class="row">
- <div class="col-lt-6 logo"><a href="https://www.ghostscript.com/"><img src="images/ghostscript_logo.png" width="108" height="119" alt=""></a></div>
- <div class="col-6"><div class="row"><div class="artifexlogo"><a href="https://artifex.com" target="_blank"><img src="images/Artifex_logo.png" width="194" height="40" alt=""></a></div>
- <div class="col-12"><div class="button button1"><a href="https://artifex.com/contact-us/" title="Contact Us" target="_blank">Contact Us</a></div>
- <div class="button button2 hidden-xs"><a href="https://www.ghostscript.com/download.html" title="Download">Download</a></div></div></div>
- </div>
- </div>
- </div>
-
- <div class="banner">
- <div class="row">
- <div class="col-12">The Ghostscript Interpreter Application Programming Interface (API)</div>
- </div>
- </div>
-
- <div class="main">
- <div class="row">
- <div id="sidebar">
- <div class="sidebar-item"></div>
- <div class="col-2 leftnav">
-<ul>
- <li><a href="https://www.ghostscript.com/">Home</a></li>
- <li><a href="https://www.ghostscript.com/license.html">Licensing</a></li>
- <li><a href="https://www.ghostscript.com/releases.html">Releases</a></li>
- <li><a href="https://www.ghostscript.com/documentation.html" title="Documentation">Documentation</a></li>
- <li><a href="https://www.ghostscript.com/download.html" title="Download">Download</a></li>
- <li><a href="https://www.ghostscript.com/performance.html" title="Performance">Performance</a></li>
- <li><a href="http://jbig2dec.com/" title="jbig2dec">jbig2dec</a></li>
- <li><a href="http://git.ghostscript.com/?p=ghostpdl.git;a=summary">Source</a></li>
- <li><a href="http://bugs.ghostscript.com/">Bugs</a></li>
- <li><a href="https://www.ghostscript.com/faq.html" title="FAQ">FAQ</a></li>
- </ul>
- </div>
- </div>
- <div class="col-10 page">
+ <article>
+ <div class="outer">
+
+ <div class="inner">
<!--START EDITING HERE-->
-<h2>Table of contents</h2>
+<h1>API</h1>
-<ul>
-<li><a href="#API">What is the Ghostscript Interpreter API?</a></li>
-<li><a href="#Exported_functions ">Exported functions</a></li>
+<h2><a name="toc"></a>Table of contents</h2>
-<ul>
-<li><a href="#revision"><code>gsapi_revision</code></a></li>
-<li><a href="#new_instance"><code>gsapi_new_instance</code></a></li>
-<li><a href="#delete_instance"><code>gsapi_delete_instance</code></a></li>
-<li><a href="#set_stdio_with_handle"><code>gsapi_set_stdio_with_handle</code></a></li>
-<li><a href="#set_stdio"><code>gsapi_set_stdio</code></a></li>
-<li><a href="#set_poll_with_handle"><code>gsapi_set_poll_with_handle</code></a></li>
-<li><a href="#set_poll"><code>gsapi_set_poll</code></a></li>
-<li><a href="#set_display_callback"><code>gsapi_set_display_callback</code></a></li>
-<li><a href="#register_callout"><code>gsapi_register_callout</code></a></li>
-<li><a href="#deregister_callout"><code>gsapi_deregister_callout</code></a></li>
-<li><a href="#set_arg_encoding"><code>gsapi_set_arg_encoding</code></a></li>
-<li><a href="#get_default_device_list"><code>gsapi_get_default_device_list</code></a></li>
-<li><a href="#set_default_device_list"><code>gsapi_set_default_device_list</code></a></li>
-<li><a href="#run"><code>gsapi_run_string_begin</code></a></li>
-<li><a href="#run"><code>gsapi_run_string_continue</code></a></li>
-<li><a href="#run"><code>gsapi_run_string_end</code></a></li>
-<li><a href="#run"><code>gsapi_run_string_with_length</code></a></li>
-<li><a href="#run"><code>gsapi_run_string</code></a></li>
-<li><a href="#run"><code>gsapi_run_file</code></a></li>
-<li><a href="#init"><code>gsapi_init_with_args</code></a></li>
-<li><a href="#exit"><code>gsapi_exit</code></a></li>
-<li><a href="#set_param"><code>gsapi_set_param</code></a></li>
-<li><a href="#get_param"><code>gsapi_get_param</code></a></li>
-<li><a href="#enumerate_params"><code>gsapi_enumerate_params</code></a></li>
-<li><a href="#add_control_path"><code>gsapi_add_control_path</code></a></li>
-<li><a href="#remove_control_path"><code>gsapi_remove_control_path</code></a></li>
-<li><a href="#purge_control_paths"><code>gsapi_purge_control_paths</code></a></li>
-<li><a href="#activate_path_control"><code>gsapi_activate_path_control</code></a></li>
-<li><a href="#is_path_control_active"><code>gsapi_is_path_control_active</code></a></li>
-<li><a href="#add_fs"><code>gsapi_add_fs</code></a></li>
-<li><a href="#remove_fs"><code>gsapi_remove_fs</code></a></li>
-<li><a href="#return_codes">Return codes</a></li>
-<li><a href="#gsapi_fs_t">gsapi_fs_t</a></li>
-<li><a href="#callout">Callouts</a></li>
-</ul>
-<li><a href="#Example_usage">Example usage</a></li>
-<li><a href="#stdio">Standard input and output</a></li>
-<li><a href="#display">Display device</a></li>
+<ul class="toc">
+ <li><a href="#API">What is the Ghostscript Interpreter API?</a></li>
+ <li><a href="#Exported_functions ">Exported functions</a></li>
+ <li>
+ <ul>
+ <li><a href="#revision"><code>gsapi_revision</code></a></li>
+ <li><a href="#new_instance"><code>gsapi_new_instance</code></a></li>
+ <li><a href="#delete_instance"><code>gsapi_delete_instance</code></a></li>
+ <li><a href="#set_stdio_with_handle"><code>gsapi_set_stdio_with_handle</code></a></li>
+ <li><a href="#set_stdio"><code>gsapi_set_stdio</code></a></li>
+ <li><a href="#set_poll_with_handle"><code>gsapi_set_poll_with_handle</code></a></li>
+ <li><a href="#set_poll"><code>gsapi_set_poll</code></a></li>
+ <li><a href="#set_display_callback"><code>gsapi_set_display_callback</code></a></li>
+ <li><a href="#register_callout"><code>gsapi_register_callout</code></a></li>
+ <li><a href="#deregister_callout"><code>gsapi_deregister_callout</code></a></li>
+ <li><a href="#set_arg_encoding"><code>gsapi_set_arg_encoding</code></a></li>
+ <li><a href="#get_default_device_list"><code>gsapi_get_default_device_list</code></a></li>
+ <li><a href="#set_default_device_list"><code>gsapi_set_default_device_list</code></a></li>
+ <li><a href="#run"><code>gsapi_run_string_begin</code></a></li>
+ <li><a href="#run"><code>gsapi_run_string_continue</code></a></li>
+ <li><a href="#run"><code>gsapi_run_string_end</code></a></li>
+ <li><a href="#run"><code>gsapi_run_string_with_length</code></a></li>
+ <li><a href="#run"><code>gsapi_run_string</code></a></li>
+ <li><a href="#run"><code>gsapi_run_file</code></a></li>
+ <li><a href="#init"><code>gsapi_init_with_args</code></a></li>
+ <li><a href="#exit"><code>gsapi_exit</code></a></li>
+ <li><a href="#set_param"><code>gsapi_set_param</code></a></li>
+ <li><a href="#get_param"><code>gsapi_get_param</code></a></li>
+ <li><a href="#enumerate_params"><code>gsapi_enumerate_params</code></a></li>
+ <li><a href="#add_control_path"><code>gsapi_add_control_path</code></a></li>
+ <li><a href="#remove_control_path"><code>gsapi_remove_control_path</code></a></li>
+ <li><a href="#purge_control_paths"><code>gsapi_purge_control_paths</code></a></li>
+ <li><a href="#activate_path_control"><code>gsapi_activate_path_control</code></a></li>
+ <li><a href="#is_path_control_active"><code>gsapi_is_path_control_active</code></a></li>
+ <li><a href="#add_fs"><code>gsapi_add_fs</code></a></li>
+ <li><a href="#remove_fs"><code>gsapi_remove_fs</code></a></li>
+ <li><a href="#return_codes">Return codes</a></li>
+ <li><a href="#gsapi_fs_t">gsapi_fs_t</a></li>
+ <li><a href="#callout">Callouts</a></li>
+ </ul>
+ </li>
+ <li><a href="#Example_usage">Example usage</a></li>
+ <li><a href="#stdio">Standard input and output</a></li>
+ <li><a href="#display">Display device</a></li>
</ul>
<!-- [1.2 end table of contents] =========================================== -->
@@ -407,20 +379,19 @@ Create a new instance of Ghostscript.
This instance is passed to most other gsapi functions.
The caller_handle is the default value that will be provided to callback functions.
-<b>Unless Ghostscript has been compiled with the </code>GS_THREADSAFE</code>
-define, only one instance at a time is supported.</b>
-
-<p>Historically, Ghostscript has only supported a single instance; any
-attempt to create more than one at a time would result in gsapi_new_instance
-returning an error. Experimental work has been done to lift this
-restriction; if Ghostscript is compiled with the GS_THREADSAFE define
-then multiple concurrent instances are permitted.</p>
+<b>On some platforms (those that do not support threading), only one
+instance of Ghostscript is supported at a time; any attempt to create
+more than one at a time would result in gsapi_new_instance
+returning an error.</p>
<p>While the core Ghostscript devices are believed to be thread safe
-now, certain devices are known not to be (particularly the contrib
-devices). The makefiles currently make no attempt to exclude these
-from builds. If you enable GS_THREADSAFE then you should check to ensure
-that you do not rely on such devices (check for global variable use).</p>
+now, a handful of devices are known not to be (at least the x11 devices,
+uniprint, and the open printing devices). A new mechanism has been
+implemented that allows devices to check for concurrent use and to
+refuse to start up. The devices shipped with Ghostscript known to use
+global variables have had these calls added to them. Any authors of
+non-standard Ghostscript devices that use global variables should
+consider adding the same calls to their own code.</p>
<p>
The first parameter, is a pointer to an opaque pointer (&quot;<code>void **</code>&quot;).
The opaque pointer (&quot;<code>void *</code>&quot;) must be initialised to <code>NULL</code> before
@@ -1101,7 +1072,7 @@ same directory as the example source.</p>
<h3><a name="Example_1"></a>Example 1</h3>
<pre>
-/* Example of using GS DLL as a ps2pdf converter. */
+/* Example of using GS DLL as a ps2pdf converter. */
#if defined(_WIN32) &amp;&amp; !defined(_Windows)
# define _Windows
@@ -1758,7 +1729,7 @@ functions in <a href="../psi/iapi.h"><code>iapi.h</code></a>.</p></p>
<!-- [3.0 begin visible trailer] =========================================== -->
<hr>
<p>
-<small>Copyright &copy; 2000-2021 Artifex Software, Inc. All rights reserved.</small></p>
+<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small></p>
<p>
This software is provided AS-IS with no warranty, either express or
@@ -1771,40 +1742,15 @@ or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.</p>
<p>
-<small>Ghostscript version 9.55.0, 27 September 2021
+<small>Ghostscript version 9.56.0, 29 March 2022
<!-- [3.0 end visible trailer] ============================================= -->
<!--FINISH EDITING HERE-->
-
- </div>
- </div>
- </div>
-
- <div class="footer">
- <div class="row">
- <div class="col-7 footleft">
- <ul>
- <li><a href="https://artifex.com/contact-us/" target="blank">CONTACT US</a></li>
- <li><a href="https://artifex.com/about-us/" target="blank">ABOUT</a></li>
- <li><a href="https://ghostscript.com/security.html">SECURITY</a></li>
- </ul>
- </div>
- <div class="col-1 footcenter">
- <ul>
- <li><a href="https://artifex.com/support/" target="blank">SUPPORT</a></li>
- <li><a href="https://artifex.com/blog/artifex/" target="blank">BLOG</a></li>
- <li><a href="https://artifex.com/privacy-policy/" target="blank">PRIVACY</a></li>
- </ul>
- </div>
- <div class="col-ft-3 footright"><img src="images/Artifex_logo.png" width="194" height="40" alt=""/> <br>
- © Copyright 2019-2021 Artifex Software, Inc. <br>
- All rights reserved.
- </div>
- </div>
- </div>
-
- <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
- <script src="index.js"></script>
+ </div><!-- close inner -->
+ </div><!-- close outer -->
+ </article>
+ </main>
+ <script src="site.js"></script>
</body>
</html>