From: Alan W. I. <ir...@be...> - 2007-08-20 16:18:58
|
On 2007-08-20 10:37+0100 Andrew Ross wrote: > > Works for me. Although some suitable phrasing to distinguish between > plwarn and plabort would be be good. plabort is aborting the function > so will probably produce odd results, but it is not fatal and is not > aborting whole program. I have had some second thoughts about considering plabort just an extreme warning rather than an error. Maurice and Geoffrey, please correct this if I have it wrong, but I believe plwarn should be reserved for a warning where there is a reasonable fixup available (e.g., "Driver does not support hardware solid fills, switching to software fill.\n"), plabort should be reserved for the case where no reasonable fixup is possible so the particular operation has to be aborted (e.g., "plscmap1l: Must specify at least two control points"), and plsexit reserved for the case where immediate termination is necessary (e.g., "Unable to load driver"). I emphasize this is an ideal interpretation, and even casual grepping through the code shows lots of places where e.g., both plabort and plexit are used for insufficient memory conditions so obviously there would be a lot of work to attempt to bring plplot into compliance with this ideal interpretation. Assuming everyone agrees with my ideal interpretation of the three different calls, then that interpretation means plabort is actually an error where we need to set a status code that is eventually delivered when the library is closed. I was thinking along the lines of setting up plsc->errcode from plwarn (similarly to the way that plsError does it, or perhaps with a call to plsError), then call exit(*(plsc->errcode)) from plend if plsc->errcode is not NULL. Finally, there is the messages associated with plabort and plexit. If they are both errors, then perhaps the messages should read something like *** PLPLOT ERROR, ABORTING OPERATION *** and *** PLPLOT ERROR, IMMEDIATE EXIT *** for the two cases? Andrew, Maurice, and Geoffrey (and any other interested developers): please let me know what you think of these ideas. 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); PLplot scientific plotting software package (plplot.org); 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 __________________________ |