POV-Ray : Newsgroups : povray.programming : UNIX POVRay does not exit with failure on error : Re: UNIX POVRay does not exit with failure on error Server Time
30 Jun 2024 12:28:16 EDT (-0400)
  Re: UNIX POVRay does not exit with failure on error  
From: Thorsten Froehlich
Date: 11 Aug 2004 17:57:32
Message: <411a964c$1@news.povray.org>
In article <411a84ff@news.povray.org> , Wolfgang Wieser 
<wwi### [at] nospamgmxde>  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] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.