|
![](/i/fill.gif) |
In article <411a84ff@news.povray.org> , Wolfgang Wieser
<wwi### [at] nospam gmx de> wrote:
> Well... UNIX povray actually will never exit() but instead go though some
> longjmp into the cooperate funcion which will then return to main or throw
> some exception. It took me some time until I finally figured out what was
> actually going on here and I was really wondering if the present state
> can be called a "clean solution"...
Well, it certainly is given how the code is separated into a frontend and
backend. It also certainly is not trivial to understand. In short the
frontend is pure C++ while the backend has to suit C. If you would check,
you would find that povray_exit is only called with three different
parameters (0, 1, 2) in four places. Two signals a user about, one an
error. So all you need to do if you desire a return value for a
command-line version (for a GUI version it does not matter) returned via
main, you either exit directly (the default macro implementation), or, if
you desire to perform proper cleanup (and displaying all other messages) you
simply return -n via the longjmp and return that. No adding of some magic
values.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
![](/i/fill.gif) |