<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Thanks a lot,
<br>Now everythings works!
<br>I had done in that way becouse i thougth i had segmantation falult
caused by <i>struct Colors *colr</i> while the problem was a pointer conflict
with a <i>char *.</i>
<br>I had a question about programming in GRASS:
<p>how can be done a debug of GRASS command in linux environment like is
done for generic C programs?
<br>I try Anjuta but I can only compile the command and cannot build it...
and so cannot debug....
<p>Thanks for your precious support.
<br>Massimiliano
<p>Glynn Clements wrote:
<blockquote TYPE=CITE>Massimiliano Cannata wrote:
<p>> I have a problem setting the color in a raster
<br>> map,
<br>> in my C file i call:
<br>>
<br>> .......
<br>> ......
<br>> char *name,*result, *mapset;
<br>> struct Colors *colr;
<br>>
<br>> name = input->answer;
<br>> result = output->answer;
<br>> mapset = G_find_cell2(name,"");
<br>>
<br>> G_init_colors(colr);
<p>"colr" is pointing at a random memory location. Change your code to:
<p> struct Colors colr;
<br> ...
<br> G_init_colors(&colr);
<br> G_add_color_rule((CELL)-50,
0,0,255, (CELL)0, 255,255,255, &colr);
<br> G_add_color_rule((CELL)0,
255,255,255, (CELL)50, 255,0,0, &colr);
<br> G_write_colors(result,mapset,&colr);
<br> G_free_colors(&colr);
<p>This applies in most situations where a function accepts a pointer as
<br>an argument; not just in GRASS, but in C generally.
<p>--
<br>Glynn Clements <glynn.clements@virgin.net></blockquote>
</html>