[GRASS5] Darwin Pre1 gtty stty errors

Eric G. Miller egm2 at jps.net
Fri Jun 8 02:17:59 EDT 2001


On Fri, Jun 08, 2001 at 06:11:04AM +0100, Glynn Clements wrote:
> OK; some of them do call G_define_module before G_gisinit(). However,
> I can't see why that would actually cause problems; AFAICT, neither
> G_define_module nor G_define_option rely upon anything having been
> initialised.

Turns out bug was in G_usage_xml() in libes/gis/parser.c:

It had something like:
	s = (char *) calloc (strlen(opt->options), 1);
	strcpy (s, opt->options);

Eventually, not having that '\0' terminator causes a problem.

> Having said that, if G_gisinit(argv[0]) is meant to be called before
> anything else, I'll make changes where necessary.

That's what's recommended in the programming manual.  Set's up the
environment and such, and just maybe a function call might depend on
something being set up.

> > Depending on the module, this shouldn't be too hard.  But, the module
> > must have a version in grass5/etc/bin/cmd/ otherwise the front end
> > intercepts the command line call with parameters (all that gmakelink5
> > line noise stuff).
> 
> Maybe front.end could trap the case where --interface-description is
> used.

Well, we could probably do that in the short term.  Longer term'ish was
to get rid of the distinction between the "command" and "inter" programs
and therefore just put all the binaries in grass5/bin (or maybe better
grass5/libexec).  There are several programs that can't really have a
non-interactive version, but we should at least let G_parser() have the
first crack at the command.

> > There's nothing in the grass-interface.dtd to flag
> > an interactive or console-interactive module.  Perhaps such an addition
> > would be useful?
> 
> I think so.
> 
> I'm not sure if we need to have a function to declare interactive-only
> behaviour. It may suffice to test "!n_flags && !n_opts".

That'd be a decent heuristic.  Off the top of my head I can't think of a
module that doesn't take arguments and isn't required to be
interactive.  Though, I suppose it could be possible.  

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



More information about the grass-dev mailing list