66 if (!
G_getl(buf,
sizeof(buf), fp)) {
80 if (!
G_getl(buf,
sizeof(buf), fp))
115 G_warning(
_(
"Unable to get history information for <%s@%s>"),
123 G_warning(
_(
"Unable to get history information for <%s@%s>"),
133 fprintf(fp,
"%s\n", hist->
fields[i] ? hist->
fields[i] :
"");
135 for (i = 0; i < hist->
nlines; i++)
136 fprintf(fp,
"%s\n", hist->
lines[i]);
162 G_fatal_error(
_(
"Unable to write history information for <%s>"), name);
179 return hist->
fields[field];
278 cmdlen = strlen(cmdlin);
287 for (j = 0; cmdlen - j > 70; j += 68) {
289 memcpy(buf, &cmdlin[j], 68);
307 for (i = 0; i < hist->
nlines; i++)
337 if (line < 0 || line >= hist->
nlines)
339 return hist->
lines[line];
int G_getl(char *, int, FILE *)
Gets a line of text from a file.
void Rast_format_history(struct History *hist, int field, const char *fmt,...)
const char * G_program_name(void)
Return module name.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
const char * G_whoami(void)
Gets user's name.
User who creater raster map.
Map type ("raster", "reclass", "GDAL-link", or "virtual")
void Rast_append_format_history(struct History *hist, const char *fmt,...)
Append a formatted string to a History structure.
void G_ascii_check(char *)
Removes non-ascii characters from buffer.
const char * Rast_get_history(struct History *hist, int field)
Set the string of a specific history field.
int Rast__read_history(struct History *hist, FILE *fp)
void G_free(void *)
Free allocated memory.
int G_vasprintf(char **, const char *, va_list)
Safe replacement for asprintf().
One-line data description.
char * G_recreate_command(void)
Creates command to run non-interactive.
FILE * G_fopen_new(const char *, const char *)
Open a new database file.
void Rast_append_history(struct History *hist, const char *str)
Append a string to a History structure.
void Rast_free_history(struct History *hist)
int Rast_history_length(struct History *hist)
Raster history info (metadata)
Description of original data source (two lines)
const char * Rast_history_line(struct History *hist, int line)
FILE * G_fopen_old(const char *, const char *, const char *)
Open a database file for reading.
int Rast_read_history(const char *name, const char *mapset, struct History *hist)
Read raster history file.
void Rast_write_history(const char *name, struct History *hist)
Write raster history file.
const char * G_mapset(void)
Get current mapset name.
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
void G_warning(const char *,...) __attribute__((format(printf
int nlines
Number of lines in lines array.
char * G_store(const char *)
Copy string to allocated memory.
char ** lines
Lines array.
void Rast_clear_history(struct History *hist)
void Rast_short_history(const char *name, const char *type, struct History *hist)
Initialize history structure.
char * fields[HIST_NUM_FIELDS]
Array of fields (see History_field for details)
Number of fields to be defined in History structure.
void Rast__write_history(struct History *hist, FILE *fp)
void Rast_set_history(struct History *hist, int field, const char *str)
Set the string of a specific history field.
int Rast_command_history(struct History *hist)
Save command line to raster history structure.
const char * G_date(void)
Current date and time.