[GRASS5] G_fatal_error question

Andreas Lange Andreas.Lange at Rhein-Main.de
Sat Jun 17 05:30:31 EDT 2000


Hi Markus, hi Roger,

the general problem is (as i understand), that the GRASS concept assumes
that every call to the gis libraries comes from a module, that should
exit() if something goes wrong. The clean way would be to have a
centralized error handling routine that sets a global error flag and
returns an error status. But that is nearly impossible to implement now. 

I must admit that i do not know in which way the interfacing between R
and GRASS is done, so that i have no idea how to circumvent the
exit()-problem. Possible: spawning a sub-process from R, so that the
sub-process exits and returns an error. Or setting up an own exit
handler with atexit().

Please correct me if i am wrong in assuming that the problem are calls
to G_fatal_error() from inside the library. Perhaps you could give me an
example where to look at some code.

cu,

Andreas 

Markus Neteler wrote:
> 
> Dear developers,
> 
> currently Roger Bivand is improving his "R"-GRASS
> interface. You can use R within GRASS, load a
> R-GRASS library and bidirectional exchange data
> between GRASS and R for analysis.
> 
> So far, so good, but he is facing following problem:
> 
> Roger wrote:
> >I think the compiled
> >interface is going to work, though I'm still worried about
> >G_fatal_error(), which kills R too. It would be nice to have a function to
> >turn it off when GRASS libraries are being linked into dynamically loaded
> >modules in other settings, or at least to stop it doing exit(). Maybe
> >there is one? (Not the handler, because that doesn't stop the exit().)
> 
> Do you have any ideas to help him?
> 
> Many thanks in advance
> 
>   Markus
> 
> ----------------------------------------
> If you want to unsubscribe from GRASS Development Team mailing list write to:
> minordomo at geog.uni-hannover.de with
> subject 'unsubscribe grass5'

-- 
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange at Rhein-Main.de, A.C.Lange at GMX.net



---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list