33 #include <grass/glocale.h>
42 G_warning(_(
"can't get history information for [%s] in mapset [%s]"),
68 char buff[1024], buf2[200], xname[GNAME_MAX], xmapset[GMAPSET_MAX];
70 G_zero(hist,
sizeof(
struct History));
74 sprintf(buff,
"%s/%s", G3D_DIRECTORY, xname);
75 sprintf(buf2,
"%s@%s", G3D_HISTORY_ELEMENT, xmapset);
78 sprintf(buff,
"%s/%s", G3D_DIRECTORY, name);
79 sprintf(buf2,
"%s", G3D_HISTORY_ELEMENT);
86 if (!
G_getl(hist->mapid,
sizeof(hist->mapid), fd)) {
92 if (!
G_getl(hist->title,
sizeof(hist->title), fd)) {
98 if (!
G_getl(hist->mapset,
sizeof(hist->mapset), fd)) {
104 if (!
G_getl(hist->creator,
sizeof(hist->creator), fd)) {
110 if (!
G_getl(hist->maptype,
sizeof(hist->maptype), fd)) {
116 if (!
G_getl(hist->datsrc_1,
sizeof(hist->datsrc_1), fd)) {
122 if (!
G_getl(hist->datsrc_2,
sizeof(hist->datsrc_2), fd)) {
128 if (!
G_getl(hist->keywrd,
sizeof(hist->keywrd), fd)) {
135 while ((hist->edlinecnt < MAXEDLINES) &&
137 (hist->edhist[hist->edlinecnt],
sizeof(hist->edhist[0]), fd))) {
167 char buf[200], buf2[200], xname[GNAME_MAX], xmapset[GMAPSET_MAX];
170 sprintf(buf,
"%s/%s", G3D_DIRECTORY, xname);
171 sprintf(buf2,
"%s@%s", G3D_HISTORY_ELEMENT, xmapset);
174 sprintf(buf,
"%s/%s", G3D_DIRECTORY, name);
175 sprintf(buf2,
"%s", G3D_HISTORY_ELEMENT);
181 fprintf(fd,
"%s\n", hist->mapid);
182 fprintf(fd,
"%s\n", hist->title);
183 fprintf(fd,
"%s\n", hist->mapset);
184 fprintf(fd,
"%s\n", hist->creator);
185 fprintf(fd,
"%s\n", hist->maptype);
186 fprintf(fd,
"%s\n", hist->datsrc_1);
187 fprintf(fd,
"%s\n", hist->datsrc_2);
188 fprintf(fd,
"%s\n", hist->keywrd);
190 for (i = 0; i < hist->edlinecnt; i++)
191 fprintf(fd,
"%s\n", hist->edhist[i]);