[GRASS5] question on D library/functions

Hi,

while trying to understand more of the internals of the libraries i
found that the D library and its functions (Dnew, Dclearscreen, Dchoose,
Derase, Dscreen, Dremove, Dcell) are not mentioned in the programmer's
manual. Can someone enlighten me? Are these functions only shortcuts to
the D_ and R_ library calls? Is there any reason that some modules use
system("d.erase") while others use Derase() and even others use
D_clear_window() ? What about system() and G_system(), should the
modules use always use G_system?

Thanks,

Andreas
--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
url: http://mitglied.lycos.de/AndreasLange
mail: Andreas.Lange_at_Rhein-Main.de - A.C.Lange_at_GMX.net

On Fri, Feb 22, 2002 at 12:16:29AM +0100, Andreas Lange wrote:

Hi,

while trying to understand more of the internals of the libraries i
found that the D library and its functions (Dnew, Dclearscreen, Dchoose,
Derase, Dscreen, Dremove, Dcell) are not mentioned in the programmer's
manual. Can someone enlighten me? Are these functions only shortcuts to
the D_ and R_ library calls? Is there any reason that some modules use
system("d.erase") while others use Derase() and even others use
D_clear_window() ? What about system() and G_system(), should the
modules use always use G_system?

As to the D* functions, they're probably little used because they aren't
documented. I know, if I don't find documentation for a thing, I
usually don't use it ('cause if you don't know it exists...). As to
system() vs. G_system(), I dunno. We don't need a G_* whatever for
every damn thing though. I think some of those functions were written
because, at the time, these things weren't reliable across platforms.

If you feel the urge, please write documentation. Even a little
chicken scratch is better than nothing.

--
Eric G. Miller <egm2@jps.net>

Andreas Lange wrote:

What about system() and G_system(), should the modules use always
use G_system?

G_system() appears to be a work-around for an incorrect implementation
of system().

system() is supposed to ignore SIGINT and SIGQUIT, and block SIGCHLD,
for the duration of the call. The comment at the top of
src/libes/system.c suggests that, on the author's system, that wasn't
the case.

However, one of the things which I intended to do once 5.0 was
released was to eliminate the use of system() (and G_system()) in
favour of a "spawn" construct, which would take individual arguments
as is the case for the exec*() functions.

--
Glynn Clements <glynn.clements@virgin.net>