66 if (!
G_getl(buf,
sizeof(buf), fp)) {
81 if (!
G_getl(buf,
sizeof(buf), fp))
116 G_warning(
_(
"Unable to get history information for <%s@%s>"),
name,
124 G_warning(
_(
"Unable to get history information for <%s@%s>"),
name, mapset);
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]);
180 return hist->
fields[field];
280 cmdlen = strlen(cmdlin);
290 for (j = 0; cmdlen - j > 70; j += 68) {
293 memcpy(buf, &cmdlin[j], 68);
311 for (i = 0; i < hist->
nlines; i++)
341 if (line < 0 || line >= hist->
nlines)
343 return hist->
lines[line];
void G_ascii_check(char *)
Removes non-ascii characters from buffer.
FILE * G_fopen_old(const char *, const char *, const char *)
Open a database file for reading.
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
void G_free(void *)
Free allocated memory.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
const char * G_date(void)
Current date and time.
void G_warning(const char *,...) __attribute__((format(printf
const char * G_whoami(void)
Gets user's name.
const char * G_mapset(void)
Get current mapset name.
char * G_recreate_command(void)
Creates command to run non-interactive.
int G_getl(char *, int, FILE *)
Gets a line of text from a file.
const char * G_program_name(void)
Return module name.
int G_vasprintf(char **, const char *, va_list)
Safe replacement for asprintf().
char * G_store(const char *)
Copy string to allocated memory.
FILE * G_fopen_new(const char *, const char *)
Open a new database file.
const char * Rast_history_line(struct History *hist, int line)
void Rast_free_history(struct History *hist)
void Rast_append_history(struct History *hist, const char *str)
Append a string to a History structure.
void Rast_clear_history(struct History *hist)
int Rast__read_history(struct History *hist, FILE *fp)
int Rast_history_length(struct History *hist)
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.
void Rast_append_format_history(struct History *hist, const char *fmt,...)
Append a formatted string to a History structure.
void Rast_format_history(struct History *hist, int field, const char *fmt,...)
int Rast_command_history(struct History *hist)
Save command line to raster history structure.
void Rast_set_history(struct History *hist, int field, const char *str)
Set the string of a specific history field.
void Rast__write_history(struct History *hist, FILE *fp)
void Rast_short_history(const char *name, const char *type, struct History *hist)
Initialize history structure.
const char * Rast_get_history(struct History *hist, int field)
Set the string of a specific history field.
@ HIST_NUM_FIELDS
Number of fields to be defined in History structure.
@ HIST_KEYWRD
One-line data description.
@ HIST_MAPTYPE
Map type ("raster", "reclass", "GDAL-link", or "virtual")
@ HIST_TITLE
Raster title.
@ HIST_MAPSET
Raster mapset.
@ HIST_CREATOR
User who creates raster map.
@ HIST_DATSRC_1
Description of original data source (two lines)
Raster history info (metadata)
int nlines
Number of lines in lines array.
char ** lines
Lines array.
char * fields[HIST_NUM_FIELDS]
Array of fields (see History_field for details)