Next: C Compiling and Linking, Previous: The C API, Up: C Programming
The current C API (application programming interface), which is thread-safe, is a revision of an older API that is not thread-safe. That is why most functions in the current API have names that end in "_r", which stands for `revised' or `reentrant'.
In the old C API, the Plotter on which an operation was performed is not
specified as an argument of the function that was called to perform the
operation. Instead, a Plotter is first `selected'. Then the API
function is called. pl_openpl was one such function; it opens the currently selected Plotter, i.e., begins a page of graphics.
The old API is deprecated, but is still supported. The four functions in the old API that perform Plotter manipulation have the following semantics.
At startup, a single Metafile Plotter that writes to standard output
(with handle `0') is automatically created and selected.
In the old API, selecting a Plotter with pl_selectpl and setting
a value for a Plotter parameter with pl_parampl are global
operations. That is why the old API is not thread-safe.
An even older C API omitted the prefix "pl_" from the names of
libplot functions. The prefix "pl_" was added in part to
distinguish GNU libplot from pre-GNU versions of libplot.
If you need to compile code written for very early versions of GNU
libplot or for pre-GNU libplot, you should include the
header file plotcompat.h. plotcompat.h redefines
openpl as pl_openpl, and so forth. See C Compiling and Linking.