23 #include <grass/Vect.h>
37 G_debug(3,
"Vect_hist_command()");
66 G_debug(5,
"Vect_hist_write()");
67 ret = fprintf(Map->hist_fp,
"%s", str);
90 if (Map->hist_fp ==
NULL)
93 ret =
G_getl2(s, size, Map->hist_fp);
110 G_debug(3,
"Vect_hist_rewind()");
112 if (Map->hist_fp !=
NULL)
113 rewind(Map->hist_fp);
130 G_debug(3,
"Vect_hist_copy()");
132 if (In->hist_fp ==
NULL)
134 if (Out->hist_fp ==
NULL)
137 fseek(Out->hist_fp, (
long)0, SEEK_END);
140 while ((red = fread(buf,
sizeof(
char),
sizeof(
char) * 1000, In->hist_fp))) {
141 if (!(ret = fwrite(buf,
sizeof(
char), red, Out->hist_fp))) {
144 fflush(Out->hist_fp);
148 fseek(In->hist_fp, (
long)-1, SEEK_END);
149 if (fread(buf,
sizeof(
char),
sizeof(
char), In->hist_fp) != 1) {
153 if (buf[0] !=
'\n') {
159 "---------------------------------------------------------------------------------\n");
char * G_mapset(void)
current mapset name
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
int Vect_hist_copy(struct Map_info *In, struct Map_info *Out)
Copy history from one map to another.
void Vect_hist_rewind(struct Map_info *Map)
Rewind history file.
char * G_recreate_command(void)
Creates command to run non-interactive.
int Vect_hist_command(struct Map_info *Map)
Write command info to history file.
int G_getl2(char *buf, int n, FILE *fd)
gets a line of text from a file of any pedigree
char * G_gisdbase(void)
Get name of top level database directory.
char * G_location(void)
Get current location name.
char * Vect_hist_read(char *s, int size, struct Map_info *Map)
Reads one line from history file without newline character.
char * G_whoami(void)
Gets user's name.
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
int G_debug(int level, const char *msg,...)
Print debugging message.
char * G_date(void)
Current date and time.
int Vect_hist_write(struct Map_info *Map, const char *str)
Write string to history file.