[GRASS-dev] r.li.*: write cmd history?

Hi,

it would be great to add support for the command line
history to the r.li.* modules. Essentially these 4 lines
have to be added:

struct History history;
...

G_short_history(out, "raster", &history);
G_command_history(&history);
G_write_history(out, &history);

I tried to modify
r.li.daemon/worker.c
accordingly but it doesn't help. Where should it be added
instead?

Markus

Markus Neteler wrote:

it would be great to add support for the command line
history to the r.li.* modules. Essentially these 4 lines
have to be added:

struct History history;
...

G_short_history(out, "raster", &history);
G_command_history(&history);
G_write_history(out, &history);

I tried to modify
r.li.daemon/worker.c
accordingly but it doesn't help. Where should it be added
instead?

AFAICT, in r.li.daemon/daemon.c; that's the only file which creates a
new map (G_open_cell_new()). worker.c only opens existing maps.

--
Glynn Clements <glynn@gclements.plus.com>

Markus Neteler wrote:
> it would be great to add support for the command line
> history to the r.li.* modules. Essentially these 4 lines
> have to be added:
>
> struct History history;
> ...
>
> G_short_history(out, "raster", &history);
> G_command_history(&history);
> G_write_history(out, &history);
>
>
> I tried to modify
> r.li.daemon/worker.c
> accordingly but it doesn't help. Where should it be added
> instead?

Glynn:

AFAICT, in r.li.daemon/daemon.c; that's the only file which creates a
new map (G_open_cell_new()). worker.c only opens existing maps.

note that you have to close the raster map before calling G_write_history()

Hamish

Glynn Clements wrote on 03/11/2007 08:10 PM:

Markus Neteler wrote:

it would be great to add support for the command line
history to the r.li.* modules. Essentially these 4 lines
have to be added:

struct History history;
...

G_short_history(out, "raster", &history);
G_command_history(&history);
G_write_history(out, &history);

I tried to modify
r.li.daemon/worker.c
accordingly but it doesn't help. Where should it be added
instead?
    
AFAICT, in r.li.daemon/daemon.c; that's the only file which creates a
new map (G_open_cell_new()). worker.c only opens existing maps.

Thanks. Enhanced, submitted and works for all r.li.* modules.

Markus