|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-ddeab64dbf
|
Raster Library - History management. More...
#include <stdarg.h>#include <string.h>#include <grass/gis.h>#include <grass/raster.h>#include <grass/glocale.h>
Go to the source code of this file.
Raster Library - History management.
(C) 2001-2009 GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file raster/history.c.
Definition at line 59 of file raster/history.c.
References History::fields, G_ascii_check(), G_getl(), G_store(), HIST_NUM_FIELDS, History::nlines, and Rast_append_history().
Referenced by Rast3d_read_history(), and Rast_read_history().
Definition at line 128 of file raster/history.c.
References History::fields, HIST_NUM_FIELDS, History::lines, and History::nlines.
Referenced by Rast3d_write_history(), and Rast_write_history().
Append a formatted string to a History structure.
| hist | pointer to History structure which holds history info |
| fmt | a string of format characters |
| ... | the arguments associated with the format characters |
Definition at line 45 of file raster/history.c.
References G_realloc, G_vasprintf(), History::lines, and History::nlines.
Referenced by IL_output_2d(), and IL_resample_output_2d().
Append a string to a History structure.
| hist | pointer to History structure which holds history info |
| str | string to append |
Definition at line 29 of file raster/history.c.
References G_realloc, G_store(), History::lines, and History::nlines.
Referenced by Rast__read_history(), and Rast_command_history().
Definition at line 307 of file raster/history.c.
References G_free(), History::lines, History::nlines, and NULL.
Referenced by Rast_free_history().
Save command line to raster history structure.
This routine takes an existing (run Rast_short_history first() history structure and adds the command line to the end of the comments array, as cleaned & expanded by the parser.
Note: use Rast_write_history() to write the structure.
Sample Usage:
| hist | pointer to History structure which holds history info |
Definition at line 274 of file raster/history.c.
References G_free(), G_recreate_command(), History::nlines, and Rast_append_history().
Referenced by IL_output_2d().
Definition at line 200 of file raster/history.c.
References History::fields, G_free(), and G_vasprintf().
Referenced by IL_output_2d(), IL_resample_output_2d(), and Rast_short_history().
Definition at line 321 of file raster/history.c.
References History::fields, G_free(), HIST_NUM_FIELDS, NULL, and Rast_clear_history().
Referenced by IL_output_2d(), and IL_resample_output_2d().
Set the string of a specific history field.
| hist | pointer to History structure which holds history info |
| field | number of a specific history field, should be accessed with macros (HIST_MAPID, ...) |
Definition at line 178 of file raster/history.c.
References History::fields.
Definition at line 334 of file raster/history.c.
References History::nlines.
Definition at line 339 of file raster/history.c.
References History::lines, and History::nlines.
Read raster history file.
This routine reads the history file for the raster map name in mapset into the hist structure.
A diagnostic message is printed and -1 is returned if there is an error reading the history file. Otherwise, 0 is returned.
| name | map name |
| mapset | mapset name |
| hist | pointer to History structure which holds history info |
Definition at line 107 of file raster/history.c.
References _, G_fopen_old(), G_warning(), G_zero(), name, and Rast__read_history().
Set the string of a specific history field.
| hist | pointer to History structure which holds history info |
| field | number of a specific history field, should be accessed with macros (HIST_MAPID, ...) |
| str | string of the history field |
Definition at line 193 of file raster/history.c.
References History::fields, G_free(), G_store(), and NULL.
Referenced by Rast_short_history().
Initialize history structure.
This routine initializes the hist structure, recording the date, user, module name and the raster map name structure. The type can be "raster", "reclass", "GDAL-link", or "virtual".
Note: This routine only initializes the data structure. It does not write the history file.
| name | map name |
| type | map type |
| hist | pointer to History structure which holds history info |
Definition at line 227 of file raster/history.c.
References _, G_date(), G_mapset(), G_program_name(), G_whoami(), G_zero(), HIST_CREATOR, HIST_DATSRC_1, HIST_DATSRC_2, HIST_KEYWRD, HIST_MAPID, HIST_MAPSET, HIST_MAPTYPE, HIST_TITLE, name, History::nlines, Rast_format_history(), and Rast_set_history().
Referenced by IL_output_2d(), and IL_resample_output_2d().
Write raster history file.
This routine writes the history file for the raster map name in the current mapset from the hist structure.
A diagnostic message is printed and -1 is returned if there is an error writing the history file. Otherwise, 0 is returned.
Note: The hist structure should first be initialized using Rast_short_history().
| name | map name | |
| [out] | hist | pointer to History structure which holds history info |
Definition at line 158 of file raster/history.c.
References _, G_fatal_error(), G_fopen_new(), name, and Rast__write_history().
Referenced by IL_output_2d(), and IL_resample_output_2d().