Hi Hazen:

The propagation issue can be restated as follows: For all functions
where plexit is currently called (except possibly the memory
allocation issues which we might handle differently) you need to
propagate the return code backwards through the "caller graph". The
doxygen application uses the terminology "caller graph" for the call
graph _to_ a given function and simply uses "call graph" for the call
graph _from_ a given function so I adopt that terminology here.  Note,
however, that the wikipedia article
<https://en.wikipedia.org/wiki/Call_graph> on call graphs doesn't
distinguish those two cases.

Anyhow, it turns out that doxygen can generate both call graphs and
caller graphs so I configured (commit b5d5b01) that by setting
HAVE_DOT, CALL_GRAPH and CALLER_GRAPH to YES in doc/Doxyfile.in;
installed the graphviz and doxygen software on my Debian system;
configured cmake with -DBUILD_DOX_DOC=ON; successfully built the
build_doxygen target; and uploaded the html results generated by that
target to our website.  Please check out those doxygen-generated
results by looking at
<http://plplot.sourceforge.net/doxygen/html/plcore_8c.html> which
documents src/plcore.c and associated source files.  The caller graphs
are the ones that are relevant to the present issue of propagating
return codes.

So to take one example, assume in the static void function
plSelectDev that is defined in plcore.c you have just replaced

plexit( "plSelectDev: Too many tries." );

by

return plerror_return(PL_TOO_MANY_TRIES, "plSelectDev: Too many tries.");

where PL_TOO_MANY_TRIES is the return code you have chosen to use to
identify this particular error, plerror_return simply writes the
message to stderr and returns the specified error code, and you have
also modified the type of plSelectDev so it can return a value, and in
particular return a 0 value on success.

Now you want to propagate the case when the return code of plSelectDev
is non-zero. For that purpose, the caller graph for plSelectDev can be found in
<http://plplot.sourceforge.net/doxygen/html/plcore_8c.html>, and that
immediately shows that you have to be concerned about propagation to
just five other functions.  That visual result is much more convenient
than grepping through the source code to find out this information so
I think these type of doxygen results are going to be an enormous help
to us.

One minor caveat is my favorite "konqueror" browser refuses to horizontally
scroll the wide caller graphs so is largely unusable for browsing these
results. Fortunately, I do have access to iceweasel (the Debian brand
for the firefox browser) and that has no trouble with horizontal
scrolling or other rendering issues for these results so you might
want to try firefox there if you are having any rendering trouble
with your favorite browser (if that is different than firefox).

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
__________________________

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to