Chapter 23. API compatibility definition

Table of Contents
What is in the API?
Regression test for backwards compatibility

This chapter presents the formal definition of what is considered to be in the PLplot library API. It is assumed that major new releases of PLplot will have substantial backwards incompatible changes in the API, but the PLplot developers commit to introducing as few as possible of such incompatibilities between minor releases such that stability across those minor releases is practically guaranteed. In all cases where backwards incompatible changes have been introduced, then the library soname will be changed (for operating systems such as Linux that support versioned shared libraries).

The information in this chapter regards version 5.9.5 of PLplot, released on 2009-09-06.

What is in the API?

The formal definition of the PLplot C API is everything that is defined in the include file plplot.h. This includes all the function prototypes, the defined structures and the semantics of the constants. The list of symbols currently exported by the shared library libplplot.h that are declared in plplot.h is the following:

plAlloc2dGrid          plgdiori               plscmap1n
plClearOpts            plgdiplt               plscol0
plFindCommand          plgesc                 plscol0a
plFindName             plgfam                 plscolbg
plFree2dGrid           plgfci                 plscolbga
plGetCursor            plgfile                plscolor
plGetFlt               plgfnam                plscompression
plGetInt               plgfont                plsdev
plGetName              plglevel               plsdidev
plHLS_RGB              plgpage                plsdimap
plMergeOpts            plgra                  plsdiori
plMinMax2dGrid         plgriddata             plsdiplt
plOptUsage             plgspa                 plsdiplz
plParseOpts            plgstrm                plseed
plRGB_HLS              plgver                 plseopH
plResetOpts            plgvpd                 plsesc
plSetOpt               plgvpw                 plsetopt
plSetUsage             plgxax                 plsexit
plTranslateCursor      plgyax                 plsfam
pl_cmd                 plgzax                 plsfci
pl_setcontlabelformat  plhist                 plsfile
pl_setcontlabelparam   plhls                  plsfnam
pladv                  plhlsrgb               plsfont
plarc                  plimage                plshade
plarrows               plimagefr              plshade1
plaxes                 plinit                 plshades
plbin                  pljoin                 plslabelfunc
plbop                  pllab                  plsmaj
plbox                  pllightsource          plsmem
plbox3                 plline                 plsmin
plbtime                plline3                plsori
plcalc_world           pllsty                 plspage
plclear                plmap                  plspal0
plcol0                 plmeridians            plspal1
plcol1                 plmesh                 plspause
plconfigtime           plmeshc                plsstrm
plcont                 plmkstrm               plssub
plcpstrm               plmtex                 plssym
plctime                plmtex3                plstar
pldid2pc               plot3d                 plstart
pldip2dc               plot3dc                plstr
plend                  plot3dcl               plstripa
plend1                 plparseopts            plstripc
plenv                  plpat                  plstripd
plenv0                 plpoin                 plstyl
pleop                  plpoin3                plsurf3d
plerrx                 plpoly3                plsurf3dl
plerry                 plprec                 plsvect
plf2eval               plpsty                 plsvpa
plf2eval2              plptex                 plsxax
plf2evalr              plptex3                plsxwin
plfamadv               plrandd                plsyax
plfcont                plreplot               plsym
plfill                 plrgb                  plszax
plfill3                plrgb1                 pltext
plflush                plrgbhls               pltimefmt
plfont                 plsButtonEH            pltr0
plfontld               plsError               pltr1
plfshade               plsKeyEH               pltr2
plgDevs                plsabort               pltr2p
plgFileDevs            plsbopH                plvasp
plgchr                 plschr                 plvect
plgcol0                plscmap0               plvpas
plgcol0a               plscmap0a              plvpor
plgcolbg               plscmap0n              plvsta
plgcolbga              plscmap1               plw3d
plgcompression         plscmap1a              plwid
plgdev                 plscmap1l              plwind
plgdidev               plscmap1la             plxormod

Another important aspect of compatibility regard the Application Binary Interface (ABI). Backwards compatibility can be broken by changes in the C structures made public through plplot.h. Currently, they are:

typedef struct {
    const char *opt;
    int  (*handler)	(const char *, const char *, void *);
    void *client_data;
    void *var;
    long mode;
    const char *syntax;
    const char *desc;
} PLOptionTable;

typedef struct {
    int type;			/* of event (CURRENTLY UNUSED) */
    unsigned int state;		/* key or button mask */
    unsigned int keysym;	/* key selected */
    unsigned int button;	/* mouse button selected */
    PLINT subwindow;            /* subwindow (alias subpage, alias subplot) number */
    char string[PL_MAXKEY];	/* translated string */
    int pX, pY;			/* absolute device coordinates of pointer */
    PLFLT dX, dY;		/* relative device coordinates of pointer */
    PLFLT wX, wY;		/* world coordinates of pointer */
} PLGraphicsIn;

typedef struct {
    PLFLT dxmi, dxma, dymi, dyma;	/* min, max window rel dev coords */
    PLFLT wxmi, wxma, wymi, wyma;	/* min, max window world coords */
} PLWindow;

typedef struct {
    unsigned int x, y;			/* upper left hand corner */
    unsigned int width, height;		/* window dimensions */
} PLDisplay;

typedef struct {
    PLFLT *f;
    PLINT nx, ny, nz;
} PLfGrid;

typedef struct {
    PLFLT **f;
    PLINT nx, ny;
} PLfGrid2;

typedef struct {
    PLFLT *xg, *yg, *zg;
    PLINT nx, ny, nz;
} PLcGrid;

typedef struct {
    PLFLT **xg, **yg, **zg;
    PLINT nx, ny;
} PLcGrid2;

typedef struct {
    unsigned char r;		/* red */
    unsigned char g;		/* green */
    unsigned char b;		/* blue */
    PLFLT a;                    /* alpha (or transparency) */
    const char *name;
} PLColor;

typedef struct {
    PLFLT h;			/* hue */
    PLFLT l;			/* lightness */
    PLFLT s;			/* saturation */
    PLFLT p;			/* position */
    PLFLT a;                    /* alpha (or transparency) */
    int rev;			/* if set, interpolate through h=0 */
} PLControlPt;

typedef struct {
    PLINT cmd;
    PLINT result;
} PLBufferingCB;

typedef struct {
    PLFLT exp_label_disp;
    PLFLT exp_label_pos;
    PLFLT exp_label_just;
} PLLabelDefaults;