To James and Andrew:

I am switching this discussion to the plplot-devel mailing list for obvious 
reasons.

On 2013-11-21 15:08-0000 James Tappin wrote:

> When a program using plplot is run without a device specified (or with an
> unknown device), the program produces a list of devices and prompts for a
> device.
>
> Is there any way to get that list to a program (e.g. to put them into a
> selector widget, or to find available print-like devices)? [Preferably to
> Fortran].

@James:

I think you are looking for plgDevs, see line 3404 and below of
src/plcore.c.  We have never bothered to propagate that
function to other languages, but before discussing that,
I have an API question for Andrew.

@Andrew: 
Could you take a critical look at the API of this function as
well as plgFileDevs (the equivalent of plgDevs which is restricted to
returning a list of file devices).  I am no API expert, but it
makes absolutely no sense to me that the first two arguments of
these functions have types of const char *** type.  Surely the type
should be char ** for returning an array of character strings?
Anyhow, we use a variant of char ** for the pllegend arguments
involving arrays of character strings which is why I spotted
this issue.  It appears to me the current API means that an extra &
and a special cast has to be used in the
call, see

plgFileDevs( (const char ***) &plFramePtr->devDesc, (const char ***)
&plFramePtr->devName, &ndev );

in plframe.c, for example.  Anyhow, if you decide to change the API of
plgFileDevs and plgDevs (with a lowercase renaming as suggested below
if you think these functions should be propagated to all our
languages), then it should be done now (to give us several weeks to
test the result) or delayed until after our next _stable_ release.

@James:
Once the API question is answered (and changes made if it turns
out my concern with that API is a legitimate one),
then there would be considerable work needed to propagate
plgDevs (and presumably plgFileDevs) to other languages.  To get
an idea of what is involved, I suggest you look for every
instance in the source tree of pllegend, a function that
has been recently propagated to all languages, appropriately documented,
etc.  So for example, the work would start by lowercasing plgDevs and
plgFileDevs everywhere they occurred, and #defining the following
macros in include/plplot.h

#define    plgfiledevs               c_plgfiledevs
#define    plgdevs                   c_plgdevs

I would also look very carefully at how the const char * const *text
input array of character strings for the pllegend argument is handled
in bindings/f95 to get some idea of what you would have to do
for the corresponding case of an output array of character strings.

Anyhow, thanks for your question which leads to some interesting
further questions to discuss.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to