[GRASS-SVN] r38703 - in grass/trunk: general/g.rename imagery/i.find imagery/i.points imagery/i.vpoints lib/dspf lib/g3d lib/gis lib/raster lib/rst/interp_float lib/sites lib/vector/Vlib lib/vector/dglib/examples lib/vector/diglib ps/ps.map raster/r.coin raster/r.in.arc raster/r.in.ascii raster/r.in.mat raster/r.in.poly raster/r.in.xyz raster/r.le/r.le.patch raster/r.le/r.le.pixel raster/r.out.mat raster3d/r3.showdspf vector/v.support vector/v.vol.rst

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 12 20:36:20 EDT 2009


Author: glynn
Date: 2009-08-12 20:36:20 -0400 (Wed, 12 Aug 2009)
New Revision: 38703

Modified:
   grass/trunk/general/g.rename/main.c
   grass/trunk/imagery/i.find/main.c
   grass/trunk/imagery/i.points/ask.c
   grass/trunk/imagery/i.vpoints/ask.c
   grass/trunk/lib/dspf/cube_io.c
   grass/trunk/lib/dspf/dspf_header.c
   grass/trunk/lib/g3d/g3dcolor.c
   grass/trunk/lib/gis/rd_cellhd.c
   grass/trunk/lib/raster/color_read.c
   grass/trunk/lib/raster/reclass.c
   grass/trunk/lib/rst/interp_float/interpf.h
   grass/trunk/lib/rst/interp_float/output2d.c
   grass/trunk/lib/rst/interp_float/resout2d.c
   grass/trunk/lib/rst/interp_float/write2d.c
   grass/trunk/lib/sites/sites.c
   grass/trunk/lib/vector/Vlib/hist.c
   grass/trunk/lib/vector/Vlib/open.c
   grass/trunk/lib/vector/Vlib/open_ogr.c
   grass/trunk/lib/vector/dglib/examples/parse.c
   grass/trunk/lib/vector/diglib/file.c
   grass/trunk/ps/ps.map/ps_header.c
   grass/trunk/ps/ps.map/ps_map.c
   grass/trunk/raster/r.coin/make_coin.c
   grass/trunk/raster/r.in.arc/main.c
   grass/trunk/raster/r.in.ascii/gethead.c
   grass/trunk/raster/r.in.ascii/main.c
   grass/trunk/raster/r.in.mat/main.c
   grass/trunk/raster/r.in.poly/get_item.c
   grass/trunk/raster/r.in.poly/getformat.c
   grass/trunk/raster/r.in.poly/poly2rast.c
   grass/trunk/raster/r.in.xyz/main.c
   grass/trunk/raster/r.le/r.le.patch/driver.c
   grass/trunk/raster/r.le/r.le.pixel/driver.c
   grass/trunk/raster/r.out.mat/main.c
   grass/trunk/raster3d/r3.showdspf/cap_data.c
   grass/trunk/vector/v.support/main.c
   grass/trunk/vector/v.vol.rst/user1.c
Log:
Replace fseek/ftell with G_fseek/G_ftell


Modified: grass/trunk/general/g.rename/main.c
===================================================================
--- grass/trunk/general/g.rename/main.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/general/g.rename/main.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -123,12 +123,12 @@
 		    fgets(buf2, 255, fp);
 		    fgets(buf2, 255, fp);
 
-		    ptr = ftell(fp);
-		    fseek(fp, 0L, SEEK_END);
-		    l = ftell(fp) - ptr;
+		    ptr = G_ftell(fp);
+		    G_fseek(fp, 0L, SEEK_END);
+		    l = G_ftell(fp) - ptr;
 
 		    str = (char *)G_malloc(l);
-		    fseek(fp, ptr, SEEK_SET);
+		    G_fseek(fp, ptr, SEEK_SET);
 		    fread(str, l, 1, fp);
 		    fclose(fp);
 

Modified: grass/trunk/imagery/i.find/main.c
===================================================================
--- grass/trunk/imagery/i.find/main.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/imagery/i.find/main.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -107,7 +107,7 @@
     const char *mapset;
     int n;
 
-    fseek(fd, 0L, SEEK_SET);
+    G_fseek(fd, 0L, SEEK_SET);
     fwrite(&len1, sizeof(len1), 1L, fd);
     fwrite(&len2, sizeof(len2), 1L, fd);
 
@@ -141,7 +141,7 @@
 	return 0;
 
     fflush(fd);
-    fseek(fd, 0L, SEEK_SET);
+    G_fseek(fd, 0L, SEEK_SET);
     fwrite(&len1, sizeof(len1), 1L, fd);
     fwrite(&len2, sizeof(len2), 1L, fd);
 

Modified: grass/trunk/imagery/i.points/ask.c
===================================================================
--- grass/trunk/imagery/i.points/ask.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/imagery/i.points/ask.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -175,7 +175,7 @@
      */
     page = 0;
     page_offset = (long *)G_calloc(npages = 1, sizeof(long));
-    *page_offset = ftell(fd);
+    *page_offset = G_ftell(fd);
 
     nlist = sizeof(list) / sizeof(list[0]);
     for (stat = -1; stat < 0;) {
@@ -184,7 +184,7 @@
 	*cur_mapset = 0;
 	col = 0;
 	while (1) {
-	    offset = ftell(fd);
+	    offset = G_ftell(fd);
 	    if (fgets(buf, sizeof buf, fd) == NULL
 		|| sscanf(buf, "%s %s", name, mapset) != 2)
 		break;
@@ -244,7 +244,7 @@
 	    stat = 1;
 	    continue;
 	}
-	fseek(fd, page_offset[page], 0);
+	G_fseek(fd, page_offset[page], 0);
 	R_standard_color(WHITE);
 	R_box_abs(left + 1, top + 1, right - 1, bottom - 1);
     }

Modified: grass/trunk/imagery/i.vpoints/ask.c
===================================================================
--- grass/trunk/imagery/i.vpoints/ask.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/imagery/i.vpoints/ask.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -171,7 +171,7 @@
      */
     page = 0;
     page_offset = (long *)G_calloc(npages = 1, sizeof(long));
-    *page_offset = ftell(fd);
+    *page_offset = G_ftell(fd);
 
     nlist = sizeof(list) / sizeof(list[0]);
     for (stat = -1; stat < 0;) {
@@ -180,7 +180,7 @@
 	*cur_mapset = 0;
 	col = 0;
 	while (1) {
-	    offset = ftell(fd);
+	    offset = G_ftell(fd);
 	    if (fgets(buf, sizeof buf, fd) == NULL
 		|| sscanf(buf, "%s %s", name, mapset) != 2)
 		break;
@@ -240,7 +240,7 @@
 	    stat = 1;
 	    continue;
 	}
-	fseek(fd, page_offset[page], 0);
+	G_fseek(fd, page_offset[page], 0);
 	R_standard_color(WHITE);
 	R_box_abs(left + 1, top + 1, right - 1, bottom - 1);
     }

Modified: grass/trunk/lib/dspf/cube_io.c
===================================================================
--- grass/trunk/lib/dspf/cube_io.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/dspf/cube_io.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -155,11 +155,11 @@
 
 	first = 0;
 
-	start = ftell(fp);
-	fseek(fp, 0L, 2);
-	stop = ftell(fp);
+	start = G_ftell(fp);
+	G_fseek(fp, 0L, 2);
+	stop = G_ftell(fp);
 	fsize = stop - start + 1;
-	fseek(fp, start, 0);
+	G_fseek(fp, start, 0);
 	if (fptr) {
 	    free(fptr);
 	    fptr = NULL;
@@ -193,13 +193,13 @@
     size |= inchar;
 
     if (0 >= (ret = my_fread(Buffer, 1, size, fp))) {
-	fprintf(stderr, "Error reading display file offset %ld\n", ftell(fp));
+	fprintf(stderr, "Error reading display file offset %ld\n", G_ftell(fp));
 	return (-1);
     }
 
     if (ret != size) {
 	fprintf(stderr, "Error (size) reading display file offset %ld\n",
-		ftell(fp));
+		G_ftell(fp));
 	return (-1);
     }
 
@@ -284,7 +284,7 @@
 int reset_reads(file_info * headfax)
 {
     if (!fsize)
-	fseek(headfax->dspfinfp, headfax->Dataoff, 0);
+	G_fseek(headfax->dspfinfp, headfax->Dataoff, 0);
     else
 	cptr = 0;
 
@@ -293,7 +293,7 @@
 
 int new_dspf(file_info * hfax)
 {
-    fseek(hfax->dspfinfp, hfax->Dataoff, 0);
+    G_fseek(hfax->dspfinfp, hfax->Dataoff, 0);
     cptr = fsize = 0;
 
     return 0;

Modified: grass/trunk/lib/dspf/dspf_header.c
===================================================================
--- grass/trunk/lib/dspf/dspf_header.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/dspf/dspf_header.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -51,8 +51,8 @@
     /* write the offset to the lookup table */
     /* the first time this number is set to 0 */
     /*this information will be overwritten after dspf is done */
-    /* ftell keeps track of where this information is to be placed */
-    Where_lookoff = ftell(fp);
+    /* G_ftell keeps track of where this information is to be placed */
+    Where_lookoff = G_ftell(fp);
     headp->Lookoff = 0;
     if (1 != fwrite(&headp->Lookoff, sizeof(long), 1, fp))
 	return (-1);
@@ -60,7 +60,7 @@
     /* code to determine the length of the binary file header */
     /* Dataoff = length of the header */
     /*Dataoff = strlen (DSPF_ID) + 7*isize + 5*flsize + linep->nthres*flsize; */
-    Where_dataoff = ftell(fp);
+    Where_dataoff = G_ftell(fp);
     headp->Dataoff = 0;
     if (1 != fwrite(&headp->Dataoff, sizeof(long), 1, fp))
 	return (-1);
@@ -68,12 +68,12 @@
 
 
     /* End of header,  now go back and fill in what we can */
-    headp->Dataoff = ftell(fp);
-    fseek(fp, Where_dataoff, 0);
+    headp->Dataoff = G_ftell(fp);
+    G_fseek(fp, Where_dataoff, 0);
     if (1 != fwrite(&headp->Dataoff, sizeof(long), 1, fp))
 	return (-1);
 
-    fseek(fp, headp->Dataoff, 0);	/* and return to begin writing data */
+    G_fseek(fp, headp->Dataoff, 0);	/* and return to begin writing data */
 
     /* will still have to come back once more to fill in Lookup offset */
 
@@ -99,7 +99,7 @@
 
 
     len = strlen(DSPF_ID);
-    fseek(fp, 0L, 0);		/* rewind file */
+    G_fseek(fp, 0L, 0);		/* rewind file */
     /*read in header information and store in File_info struct */
 
     if (!fread(buf, 1, len, fp))

Modified: grass/trunk/lib/g3d/g3dcolor.c
===================================================================
--- grass/trunk/lib/g3d/g3dcolor.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/g3d/g3dcolor.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -79,7 +79,7 @@
 	fclose(fd);
 	return -1;
     }
-    fseek(fd, 0L, 0);
+    G_fseek(fd, 0L, 0);
 
     G_strip(buf);
     if (*buf == '%') {		/* 4.0 format */

Modified: grass/trunk/lib/gis/rd_cellhd.c
===================================================================
--- grass/trunk/lib/gis/rd_cellhd.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/gis/rd_cellhd.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -51,14 +51,14 @@
 
     /* Count lines */
     count = 0;
-    fseek(fd, 0L, 0);
+    G_fseek(fd, 0L, 0);
     while (G_getl(buf, sizeof(buf), fd))
 	count++;
 
     array = (char **)G_calloc(count + 1, sizeof(char **));
 
     count = 0;
-    fseek(fd, 0L, 0);
+    G_fseek(fd, 0L, 0);
     while (G_getl(buf, sizeof(buf), fd)) {
 	array[count] = G_store(buf);
 	count++;

Modified: grass/trunk/lib/raster/color_read.c
===================================================================
--- grass/trunk/lib/raster/color_read.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/raster/color_read.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -133,7 +133,7 @@
 	fclose(fd);
 	return -1;
     }
-    fseek(fd, 0L, 0);
+    G_fseek(fd, 0L, 0);
 
     G_strip(buf);
     if (*buf == '%') {		/* 4.0 format */

Modified: grass/trunk/lib/raster/reclass.c
===================================================================
--- grass/trunk/lib/raster/reclass.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/raster/reclass.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -332,7 +332,7 @@
 	return 1;
     }
 
-    fseek(fd, 0L, SEEK_SET);
+    G_fseek(fd, 0L, SEEK_SET);
 
     sprintf(buf2, "%s@%s\n", name, G_mapset());
     for (i = 0; !feof(fd) && fgets(buf3, 255, fd);) {

Modified: grass/trunk/lib/rst/interp_float/interpf.h
===================================================================
--- grass/trunk/lib/rst/interp_float/interpf.h	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/rst/interp_float/interpf.h	2009-08-13 00:36:20 UTC (rev 38703)
@@ -2,6 +2,9 @@
  * modified by Brown in June 1999 - added elatt & smatt
  * modified by Mitasova Nov. 9, 1999 - added parameter for dtens to output2d
  */
+#include <grass/config.h>
+#include <stdio.h>
+#include <grass/gis.h>
 #include <grass/raster.h>
 #include <grass/vector.h>
 #include <grass/bitmap.h>

Modified: grass/trunk/lib/rst/interp_float/output2d.c
===================================================================
--- grass/trunk/lib/rst/interp_float/output2d.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/rst/interp_float/output2d.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -144,16 +144,11 @@
     }
 
     if (params->elev != NULL) {
-	fseek(params->Tmp_fd_z, 0L, 0);	/* seek to the beginning */
+	G_fseek(params->Tmp_fd_z, 0L, 0);	/* seek to the beginning */
 	for (i = 0; i < params->nsizr; i++) {
 	    /* seek to the right row */
-	    if (fseek(params->Tmp_fd_z, (long)
-		      ((params->nsizr - 1 -
-			i) * params->nsizc * sizeof(FCELL)), 0)
-		== -1) {
-		G_warning(_("Unable to fseek to the right spot"));
-		return -1;
-	    }
+	    G_fseek(params->Tmp_fd_z, (off_t) (params->nsizr - 1 - i) *
+		    params->nsizc * sizeof(FCELL), 0);
 	    ii = fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_z);
 	    /*
 	     * for(j=0;j<params->nsizc;j++) fprintf(stderr,"%f ",cell1[j]);
@@ -165,80 +160,55 @@
     }
 
     if (params->slope != NULL) {
-	fseek(params->Tmp_fd_dx, 0L, 0);	/* seek to the beginning */
+	G_fseek(params->Tmp_fd_dx, 0L, 0);	/* seek to the beginning */
 	for (i = 0; i < params->nsizr; i++) {
 	    /* seek to the right row */
-	    if (fseek(params->Tmp_fd_dx, (long)
-		      ((params->nsizr - 1 -
-			i) * params->nsizc * sizeof(FCELL)), 0)
-		== -1) {
-		G_warning(_("Unable to fseek to the right spot"));
-		return -1;
-	    }
+	    G_fseek(params->Tmp_fd_dx, (off_t) (params->nsizr - 1 - i) *
+		    params->nsizc * sizeof(FCELL), 0);
 	    fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_dx);
 	    Rast_put_f_row(cf2, cell1);
 	}
     }
 
     if (params->aspect != NULL) {
-	fseek(params->Tmp_fd_dy, 0L, 0);	/* seek to the beginning */
+	G_fseek(params->Tmp_fd_dy, 0L, 0);	/* seek to the beginning */
 	for (i = 0; i < params->nsizr; i++) {
 	    /* seek to the right row */
-	    if (fseek(params->Tmp_fd_dy, (long)
-		      ((params->nsizr - 1 -
-			i) * params->nsizc * sizeof(FCELL)), 0)
-		== -1) {
-		G_warning(_("Unable to fseek to the right spot"));
-		return -1;
-	    }
+	    G_fseek(params->Tmp_fd_dy, (off_t) (params->nsizr - 1 - i) *
+		    params->nsizc * sizeof(FCELL), 0);
 	    fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_dy);
 	    Rast_put_f_row(cf3, cell1);
 	}
     }
 
     if (params->pcurv != NULL) {
-	fseek(params->Tmp_fd_xx, 0L, 0);	/* seek to the beginning */
+	G_fseek(params->Tmp_fd_xx, 0L, 0);	/* seek to the beginning */
 	for (i = 0; i < params->nsizr; i++) {
 	    /* seek to the right row */
-	    if (fseek(params->Tmp_fd_xx, (long)
-		      ((params->nsizr - 1 -
-			i) * params->nsizc * sizeof(FCELL)), 0)
-		== -1) {
-		G_warning(_("Unable to fseek to the right spot"));
-		return -1;
-	    }
+	    G_fseek(params->Tmp_fd_xx, (off_t) (params->nsizr - 1 - i) *
+		    params->nsizc * sizeof(FCELL), 0);
 	    fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_xx);
 	    Rast_put_f_row(cf4, cell1);
 	}
     }
 
     if (params->tcurv != NULL) {
-	fseek(params->Tmp_fd_yy, 0L, 0);	/* seek to the beginning */
+	G_fseek(params->Tmp_fd_yy, 0L, 0);	/* seek to the beginning */
 	for (i = 0; i < params->nsizr; i++) {
 	    /* seek to the right row */
-	    if (fseek(params->Tmp_fd_yy, (long)
-		      ((params->nsizr - 1 -
-			i) * params->nsizc * sizeof(FCELL)), 0)
-		== -1) {
-		G_warning(_("Unable to fseek to the right spot"));
-		return -1;
-	    }
+	    G_fseek(params->Tmp_fd_yy, (off_t) (params->nsizr - 1 - i) *
+		    params->nsizc * sizeof(FCELL), 0);
 	    fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_yy);
 	    Rast_put_f_row(cf5, cell1);
 	}
     }
 
     if (params->mcurv != NULL) {
-	fseek(params->Tmp_fd_xy, 0L, 0);	/* seek to the beginning */
+	G_fseek(params->Tmp_fd_xy, 0L, 0);	/* seek to the beginning */
 	for (i = 0; i < params->nsizr; i++) {
 	    /* seek to the right row */
-	    if (fseek(params->Tmp_fd_xy, (long)
-		      ((params->nsizr - 1 -
-			i) * params->nsizc * sizeof(FCELL)), 0)
-		== -1) {
-		G_warning(_("Unable to fseek to the right spot"));
-		return -1;
-	    }
+	    G_fseek(params->Tmp_fd_xy, (off_t) (params->nsizr - 1 - i) *
+		    params->nsizc * sizeof(FCELL), 0);
 	    fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_xy);
 	    Rast_put_f_row(cf6, cell1);
 	}

Modified: grass/trunk/lib/rst/interp_float/resout2d.c
===================================================================
--- grass/trunk/lib/rst/interp_float/resout2d.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/rst/interp_float/resout2d.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -135,15 +135,11 @@
     }
 
     if (params->elev != NULL) {
-	fseek(params->Tmp_fd_z, 0L, 0);	/* seek to the beginning */
+	G_fseek(params->Tmp_fd_z, 0L, 0);	/* seek to the beginning */
 	for (i = 0; i < params->nsizr; i++) {
 	    /* seek to the right row */
-	    if (fseek(params->Tmp_fd_z, (long)
-		      ((params->nsizr - 1 -
-			i) * params->nsizc * sizeof(FCELL)), 0) == -1) {
-		G_warning(_("Unable to fseek to the right spot"));
-		return -1;
-	    }
+	    G_fseek(params->Tmp_fd_z, (off_t) (params->nsizr - 1 - i) *
+		    params->nsizc * sizeof(FCELL), 0);
 	    fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_z);
 	    if (Rast_put_f_row(cf1, cell1) < 0) {
 		G_warning(_("Failed writing raster map"));
@@ -153,15 +149,11 @@
     }
 
     if (params->slope != NULL) {
-	fseek(params->Tmp_fd_dx, 0L, 0);	/* seek to the beginning */
+	G_fseek(params->Tmp_fd_dx, 0L, 0);	/* seek to the beginning */
 	for (i = 0; i < params->nsizr; i++) {
 	    /* seek to the right row */
-	    if (fseek(params->Tmp_fd_dx, (long)
-		      ((params->nsizr - 1 -
-			i) * params->nsizc * sizeof(FCELL)), 0) == -1) {
-		G_warning(_("Unable to fseek to the right spot"));
-		return -1;
-	    }
+	    G_fseek(params->Tmp_fd_dx, (off_t) (params->nsizr - 1 - i) *
+		    params->nsizc * sizeof(FCELL), 0);
 	    fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_dx);
 	    /*
 	     * for (ii==0;ii<params->nsizc;ii++) { fprintf(stderr,"ii=%d ",ii);
@@ -176,15 +168,11 @@
     }
 
     if (params->aspect != NULL) {
-	fseek(params->Tmp_fd_dy, 0L, 0);	/* seek to the beginning */
+	G_fseek(params->Tmp_fd_dy, 0L, 0);	/* seek to the beginning */
 	for (i = 0; i < params->nsizr; i++) {
 	    /* seek to the right row */
-	    if (fseek(params->Tmp_fd_dy, (long)
-		      ((params->nsizr - 1 -
-			i) * params->nsizc * sizeof(FCELL)), 0) == -1) {
-		G_warning(_("Unable to fseek to the right spot"));
-		return -1;
-	    }
+	    G_fseek(params->Tmp_fd_dy, (off_t) (params->nsizr - 1 - i) *
+		    params->nsizc * sizeof(FCELL), 0);
 	    fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_dy);
 	    if (Rast_put_f_row(cf3, cell1) < 0) {
 		G_warning(_("Failed writing raster map"));
@@ -194,15 +182,11 @@
     }
 
     if (params->pcurv != NULL) {
-	fseek(params->Tmp_fd_xx, 0L, 0);	/* seek to the beginning */
+	G_fseek(params->Tmp_fd_xx, 0L, 0);	/* seek to the beginning */
 	for (i = 0; i < params->nsizr; i++) {
 	    /* seek to the right row */
-	    if (fseek(params->Tmp_fd_xx, (long)
-		      ((params->nsizr - 1 -
-			i) * params->nsizc * sizeof(FCELL)), 0) == -1) {
-		G_warning(_("Unable to fseek to the right spot"));
-		return -1;
-	    }
+	    G_fseek(params->Tmp_fd_xx, (off_t) (params->nsizr - 1 - i) *
+		    params->nsizc * sizeof(FCELL), 0);
 	    fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_xx);
 	    if (Rast_put_f_row(cf4, cell1) < 0) {
 		G_warning(_("Failed writing raster map"));
@@ -212,15 +196,11 @@
     }
 
     if (params->tcurv != NULL) {
-	fseek(params->Tmp_fd_yy, 0L, 0);	/* seek to the beginning */
+	G_fseek(params->Tmp_fd_yy, 0L, 0);	/* seek to the beginning */
 	for (i = 0; i < params->nsizr; i++) {
 	    /* seek to the right row */
-	    if (fseek(params->Tmp_fd_yy, (long)
-		      ((params->nsizr - 1 -
-			i) * params->nsizc * sizeof(FCELL)), 0) == -1) {
-		G_warning(_("Unable to fseek to the right spot"));
-		return -1;
-	    }
+	    G_fseek(params->Tmp_fd_yy, (off_t) (params->nsizr - 1 - i) *
+		    params->nsizc * sizeof(FCELL), 0);
 	    fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_yy);
 	    if (Rast_put_f_row(cf5, cell1) < 0) {
 		G_warning(_("Failed writing raster map"));
@@ -230,15 +210,11 @@
     }
 
     if (params->mcurv != NULL) {
-	fseek(params->Tmp_fd_xy, 0L, 0);	/* seek to the beginning */
+	G_fseek(params->Tmp_fd_xy, 0L, 0);	/* seek to the beginning */
 	for (i = 0; i < params->nsizr; i++) {
 	    /* seek to the right row */
-	    if (fseek(params->Tmp_fd_xy, (long)
-		      ((params->nsizr - 1 -
-			i) * params->nsizc * sizeof(FCELL)), 0) == -1) {
-		G_warning(_("Unable to fseek to the right spot"));
-		return -1;
-	    }
+	    G_fseek(params->Tmp_fd_xy, (off_t) (params->nsizr - 1 - i) *
+		    params->nsizc * sizeof(FCELL), 0);
 	    fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_xy);
 	    if (Rast_put_f_row(cf6, cell1) < 0) {
 		G_warning(_("Failed writing raster map"));

Modified: grass/trunk/lib/rst/interp_float/write2d.c
===================================================================
--- grass/trunk/lib/rst/interp_float/write2d.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/rst/interp_float/write2d.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -11,47 +11,33 @@
  *
  */
 
+#include <grass/config.h>
 #include <stdio.h>
 #include <math.h>
 #include <unistd.h>
-#include <grass/gis.h>
 
+#include <grass/gis.h>
+#include <grass/glocale.h>
 #include <grass/interpf.h>
 
-int IL_write_temp_2d(struct interp_params *params, int ngstc, int nszc, int offset2	/* begin. and end. column, offset */
-    )
-
 /*
  * Writes az,adx,...,adxy into appropriate place (depending on ngstc, nszc
  * and offset) in corresponding temp file
  */
+int IL_write_temp_2d(struct interp_params *params, int ngstc, int nszc, int offset2)	/* begin. and end. column, offset */
 {
     int j;
     static FCELL *array_cell = NULL;
 
-    if (!array_cell) {
-
-	if (!
-	    (array_cell =
-	     (FCELL *) G_malloc(sizeof(FCELL) * params->nsizc + 1))) {
-	    fprintf(stderr, "Cannot allocate memory for array_cell\n");
-	    return -1;
-	}
-    }
+    if (!array_cell)
+	array_cell = G_malloc(sizeof(FCELL) * params->nsizc + 1);
     if (params->Tmp_fd_z != NULL) {
 	for (j = ngstc; j <= nszc; j++)
 	    array_cell[j - 1] = (FCELL) params->az[j];
-	if (fseek(params->Tmp_fd_z, (long)offset2, 0) == -1) {
-	    fprintf(stderr, "Cannot fseek elev offset2=%d\n", (int)offset2);
-	    return -1;
-	}
-	if (!
-	    (fwrite
-	     (array_cell + ngstc - 1, sizeof(FCELL), nszc - ngstc + 1,
-	      params->Tmp_fd_z))) {
-	    fprintf(stderr, "Not enough disk space--cannot write files\n");
-	    return -1;
-	}
+	G_fseek(params->Tmp_fd_z, offset2, SEEK_SET);
+	if (!fwrite(array_cell + ngstc - 1, sizeof(FCELL), nszc - ngstc + 1,
+		    params->Tmp_fd_z))
+	    G_fatal_error(_("Cannot write files"));
     }
     if (params->Tmp_fd_dx != NULL) {
 	for (j = ngstc; j <= nszc; j++)
@@ -59,17 +45,10 @@
 		array_cell[j - 1] = (FCELL) params->adx[j];
 	    else
 		array_cell[j - 1] = (FCELL) (params->adx[j] * params->scik1);
-	if (fseek(params->Tmp_fd_dx, (long)offset2, 0) == -1) {
-	    fprintf(stderr, "Cannot fseek slope\n");
-	    return -1;
-	}
-	if (!
-	    (fwrite
-	     (array_cell + ngstc - 1, sizeof(FCELL), nszc - ngstc + 1,
-	      params->Tmp_fd_dx))) {
-	    fprintf(stderr, "Not enough disk space--cannot write files\n");
-	    return -1;
-	}
+	G_fseek(params->Tmp_fd_dx, offset2, SEEK_SET);
+	if (!fwrite(array_cell + ngstc - 1, sizeof(FCELL), nszc - ngstc + 1,
+		    params->Tmp_fd_dx))
+	    G_fatal_error(_("Cannot write files"));
     }
     if (params->Tmp_fd_dy != NULL) {
 	for (j = ngstc; j <= nszc; j++) {
@@ -81,63 +60,35 @@
 	    else
 		array_cell[j - 1] = (FCELL) (params->ady[j] * params->scik1);
 	}
-	if (fseek(params->Tmp_fd_dy, (long)offset2, 0) == -1) {
-	    fprintf(stderr, "Cannot fseek aspect\n");
-	    return -1;
-	}
-	if (!
-	    (fwrite
-	     (array_cell + ngstc - 1, sizeof(FCELL), nszc - ngstc + 1,
-	      params->Tmp_fd_dy))) {
-	    fprintf(stderr, "Not enough disk space--cannot write files\n");
-	    return -1;
-	}
+	G_fseek(params->Tmp_fd_dy, offset2, SEEK_SET);
+	if (!fwrite(array_cell + ngstc - 1, sizeof(FCELL), nszc - ngstc + 1,
+		    params->Tmp_fd_dy))
+	    G_fatal_error(_("Cannot write files"));
     }
     if (params->Tmp_fd_xx != NULL) {
 	for (j = ngstc; j <= nszc; j++) {
 	    array_cell[j - 1] = (FCELL) (params->adxx[j] * params->scik1);
 	}
-	if (fseek(params->Tmp_fd_xx, (long)offset2, 0) == -1) {
-	    fprintf(stderr, "Cannot fseek pcurv\n");
-	    return -1;
-	}
-	if (!
-	    (fwrite
-	     (array_cell + ngstc - 1, sizeof(FCELL), nszc - ngstc + 1,
-	      params->Tmp_fd_xx))) {
-	    fprintf(stderr, "Not enough disk space--cannot write files\n");
-	    return -1;
-	}
+	G_fseek(params->Tmp_fd_xx, offset2, SEEK_SET);
+	if (!fwrite(array_cell + ngstc - 1, sizeof(FCELL), nszc - ngstc + 1,
+		    params->Tmp_fd_xx))
+	    G_fatal_error(_("Cannot write files"));
     }
     if (params->Tmp_fd_yy != NULL) {
 	for (j = ngstc; j <= nszc; j++)
 	    array_cell[j - 1] = (FCELL) (params->adyy[j] * params->scik2);
-	if (fseek(params->Tmp_fd_yy, (long)offset2, 0) == -1) {
-	    fprintf(stderr, "Cannot fseek tcurv\n");
-	    return -1;
-	}
-	if (!
-	    (fwrite
-	     (array_cell + ngstc - 1, sizeof(FCELL), nszc - ngstc + 1,
-	      params->Tmp_fd_yy))) {
-	    fprintf(stderr, "Not enough disk space--cannot write files\n");
-	    return -1;
-	}
+	G_fseek(params->Tmp_fd_yy, offset2, SEEK_SET);
+	if (!fwrite(array_cell + ngstc - 1, sizeof(FCELL), nszc - ngstc + 1,
+		    params->Tmp_fd_yy))
+	    G_fatal_error(_("Cannot write files"));
     }
     if (params->Tmp_fd_xy != NULL) {
 	for (j = ngstc; j <= nszc; j++)
 	    array_cell[j - 1] = (FCELL) (params->adxy[j] * params->scik3);
-	if (fseek(params->Tmp_fd_xy, (long)offset2, 0) == -1) {
-	    fprintf(stderr, "Cannot fseek mcurv\n");
-	    return -1;
-	}
-	if (!
-	    (fwrite
-	     (array_cell + ngstc - 1, sizeof(FCELL), nszc - ngstc + 1,
-	      params->Tmp_fd_xy))) {
-	    fprintf(stderr, "Not enough disk space--cannot write files\n");
-	    return -1;
-	}
+	G_fseek(params->Tmp_fd_xy, offset2, SEEK_SET);
+	if (!fwrite(array_cell + ngstc - 1, sizeof(FCELL), nszc - ngstc + 1,
+		    params->Tmp_fd_xy))
+	    G_fatal_error(_("Cannot write files"));
     }
     return 1;
 }

Modified: grass/trunk/lib/sites/sites.c
===================================================================
--- grass/trunk/lib/sites/sites.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/sites/sites.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -752,7 +752,7 @@
     int itmp;
     float ftmp;
 
-    if (ftell(ptr) != 0L) {
+    if (G_ftell(ptr) != 0L) {
 	fprintf(stderr,
 		"\nPROGRAMMER ERROR: G_oldsite_describe() must be called\n");
 	fprintf(stderr, "        immediately after G_fopen_sites_old()\n");

Modified: grass/trunk/lib/vector/Vlib/hist.c
===================================================================
--- grass/trunk/lib/vector/Vlib/hist.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/vector/Vlib/hist.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -132,7 +132,7 @@
     if (Out->hist_fp == NULL)
 	return -1;
 
-    fseek(Out->hist_fp, (long)0, SEEK_END);
+    G_fseek(Out->hist_fp, (long)0, SEEK_END);
     rewind(In->hist_fp);
 
     while ((red = fread(buf, sizeof(char), sizeof(char) * 1000, In->hist_fp))) {
@@ -143,7 +143,7 @@
     }
 
     /* In ends with \n ? */
-    fseek(In->hist_fp, (long)-1, SEEK_END);
+    G_fseek(In->hist_fp, (long)-1, SEEK_END);
     if (fread(buf, sizeof(char), sizeof(char), In->hist_fp) != 1) {
 	return -1;
     }

Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/vector/Vlib/open.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -392,7 +392,7 @@
 	    fatal_error(ferror, errmsg);
 	    return (-1);
 	}
-	fseek(Map->hist_fp, (off_t) 0, SEEK_END);
+	G_fseek(Map->hist_fp, (off_t) 0, SEEK_END);
 	Vect_hist_write(Map,
 			"---------------------------------------------------------------------------------\n");
 
@@ -677,7 +677,7 @@
 #ifdef __MINGW32__
 	if (Map->open == VECT_OPEN_CODE) {
 	    dig_fseek(&(Map->dig_fp), 0L, SEEK_END);
-	    G_debug(2, "ftell = %d", dig_ftell(&(Map->dig_fp)));
+	    G_debug(2, "dig_ftell = %d", dig_ftell(&(Map->dig_fp)));
 	    Info->size = dig_ftell(&(Map->dig_fp));
 	}
 #endif

Modified: grass/trunk/lib/vector/Vlib/open_ogr.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open_ogr.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/vector/Vlib/open_ogr.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -160,7 +160,7 @@
 	return (-1);
     G_debug(3, "  header size %ld", length);
 
-    fseek(fp.file, length, SEEK_SET);
+    G_fseek(fp.file, length, SEEK_SET);
 
     /* number of records  */
     if (0 >= dig__fread_port_I(&(Map->fInfo.ogr.offset_num), 1, &fp))

Modified: grass/trunk/lib/vector/dglib/examples/parse.c
===================================================================
--- grass/trunk/lib/vector/dglib/examples/parse.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/vector/dglib/examples/parse.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -237,8 +237,8 @@
 
     while (fgets(sz, sizeof(sz), fp)) {
 #ifndef VERBOSE
-	if (!(cOut++ % 512) || ftell(fp) == statdata.st_size)
-	    printf("Parse input file ... status: %ld/%ld\r", ftell(fp),
+	if (!(cOut++ % 512) || G_ftell(fp) == statdata.st_size)
+	    printf("Parse input file ... status: %ld/%ld\r", G_ftell(fp),
 		   statdata.st_size);
 	fflush(stdout);
 #endif

Modified: grass/trunk/lib/vector/diglib/file.c
===================================================================
--- grass/trunk/lib/vector/diglib/file.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/lib/vector/diglib/file.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -240,9 +240,9 @@
 	if (file->start == NULL)
 	    return -1;
 
-	fseek(file->file, 0L, 0);
+	G_fseek(file->file, 0L, 0);
 	ret = fread(file->start, size, 1, file->file);	/* Better to read in smaller portions? */
-	fseek(file->file, 0L, 0);	/* reset to the beginning */
+	G_fseek(file->file, 0L, 0);	/* reset to the beginning */
 
 	if (ret <= 0) {
 	    G_free(file->start);

Modified: grass/trunk/ps/ps.map/ps_header.c
===================================================================
--- grass/trunk/ps/ps.map/ps_header.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/ps/ps.map/ps_header.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -28,7 +28,7 @@
     else
 	fprintf(PS.fp, "%%!PS-Adobe-3.0\n");
 
-    bb_offset = ftell(PS.fp);
+    bb_offset = G_ftell(PS.fp);
     fprintf(PS.fp, "                                       ");
     fprintf(PS.fp, "                                       \n");
     fprintf(PS.fp, "%%%%Title: ");
@@ -67,7 +67,7 @@
 	ury = (int)72.0 *PS.page_width;
     }
 
-    fseek(PS.fp, bb_offset, SEEK_SET);
+    G_fseek(PS.fp, bb_offset, SEEK_SET);
     fprintf(PS.fp, "%%%%BoundingBox: %d %d %d %d", llx, lly, urx, ury);
 
     return 0;

Modified: grass/trunk/ps/ps.map/ps_map.c
===================================================================
--- grass/trunk/ps/ps.map/ps_map.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/ps/ps.map/ps_map.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -160,9 +160,9 @@
 	do_psfiles();
 
     /* write the bounding box */
-    current_offset = ftell(PS.fp);
+    current_offset = G_ftell(PS.fp);
     write_bounding_box();
-    fseek(PS.fp, current_offset, SEEK_SET);
+    G_fseek(PS.fp, current_offset, SEEK_SET);
 
     fprintf(PS.fp, "showpage\n");
     fprintf(PS.fp, "%%%%Trailer\n");

Modified: grass/trunk/raster/r.coin/make_coin.c
===================================================================
--- grass/trunk/raster/r.coin/make_coin.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster/r.coin/make_coin.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -145,7 +145,7 @@
 	    break;
 
     /* now read the statsfile and insert into the table */
-    fseek(statfd, 0L, 0);
+    G_fseek(statfd, 0L, 0);
     while (fread(&stats, sizeof(stats), 1, statfd)) {
 	long z;
 

Modified: grass/trunk/raster/r.in.arc/main.c
===================================================================
--- grass/trunk/raster/r.in.arc/main.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster/r.in.arc/main.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -221,7 +221,7 @@
 	if (!size) {
 	    if (written) {
 		fflush(to);
-		fseek(to, 0l, 0);
+		G_fseek(to, 0l, 0);
 	    }
 	    return (0);
 	}

Modified: grass/trunk/raster/r.in.ascii/gethead.c
===================================================================
--- grass/trunk/raster/r.in.ascii/gethead.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster/r.in.ascii/gethead.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -273,7 +273,7 @@
     char tmpbuf[TMPBUFSIZE];
     size_t size = TMPBUFSIZE;
 
-    if ((curpos = ftell(fd)) == -1)
+    if ((curpos = G_ftell(fd)) == -1)
 	return -1;
     while (!feof(fd)) {
 	if (size != fread(tmpbuf, sizeof(char), size, fd)) {
@@ -281,10 +281,10 @@
 		return -1;
 	}
 	if (strstr(tmpbuf, DOT) != NULL) {
-	    fseek(fd, curpos - 1L, SEEK_SET);
+	    G_fseek(fd, curpos - 1L, SEEK_SET);
 	    return 0;
 	}
     }
-    fseek(fd, curpos - 1L, SEEK_SET);
+    G_fseek(fd, curpos - 1L, SEEK_SET);
     return 1;
 }

Modified: grass/trunk/raster/r.in.ascii/main.c
===================================================================
--- grass/trunk/raster/r.in.ascii/main.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster/r.in.ascii/main.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -237,17 +237,17 @@
     sz = 0;
     if (direction < 0) {
 	sz = -ncols * Rast_cell_size(data_type);
-	fseek(ft, sz, SEEK_END);
+	G_fseek(ft, sz, SEEK_END);
 	sz *= 2;
     }
     else {
-	fseek(ft, 0L, SEEK_SET);
+	G_fseek(ft, 0L, SEEK_SET);
     }
 
     for (row = 0; row < nrows; row += 1) {
 	fread(rast, Rast_cell_size(data_type), ncols, ft);
 	Rast_put_row(cf, rast, data_type);
-	fseek(ft, sz, SEEK_CUR);
+	G_fseek(ft, sz, SEEK_CUR);
     }
     fclose(ft);
     unlink(temp);
@@ -278,7 +278,7 @@
 	if (!size) {
 	    if (written) {
 		fflush(to);
-		fseek(to, 0L, SEEK_SET);
+		G_fseek(to, 0L, SEEK_SET);
 	    }
 	    return (0);
 	}

Modified: grass/trunk/raster/r.in.mat/main.c
===================================================================
--- grass/trunk/raster/r.in.mat/main.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster/r.in.mat/main.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -134,7 +134,7 @@
 
     /* Check Endian State of File */
     fread(&format_block, sizeof(int), 1, fp1);
-    fseek(fp1, 0, SEEK_SET);	/* frewind() */
+    G_fseek(fp1, 0, SEEK_SET);	/* frewind() */
 
     file_endianness = format_block / 1000;	/* 0=little, 1=big */
     if (file_endianness != machine_endianness)
@@ -322,16 +322,16 @@
 	    switch (data_format) {
 		/*   0=double       1=float   2=32bit signed int   5=8bit unsigned int(text)   */
 	    case 0:
-		fseek(fp1, mrows * ncols * sizeof(double), SEEK_CUR);
+		G_fseek(fp1, mrows * ncols * sizeof(double), SEEK_CUR);
 		break;
 	    case 1:
-		fseek(fp1, mrows * ncols * sizeof(float), SEEK_CUR);
+		G_fseek(fp1, mrows * ncols * sizeof(float), SEEK_CUR);
 		break;
 	    case 2:
-		fseek(fp1, mrows * ncols * sizeof(int), SEEK_CUR);
+		G_fseek(fp1, mrows * ncols * sizeof(int), SEEK_CUR);
 		break;
 	    case 5:
-		fseek(fp1, mrows * ncols * sizeof(char), SEEK_CUR);
+		G_fseek(fp1, mrows * ncols * sizeof(char), SEEK_CUR);
 		break;
 	    default:
 		G_fatal_error("unusual array");

Modified: grass/trunk/raster/r.in.poly/get_item.c
===================================================================
--- grass/trunk/raster/r.in.poly/get_item.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster/r.in.poly/get_item.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -41,7 +41,7 @@
 
     /* read the feature's data */
     while (1) {
-	offset = ftell(fd);
+	offset = G_ftell(fd);
 
 	if (!G_getl2(buf, (sizeof buf) - 1, fd))
 	    break;
@@ -55,7 +55,7 @@
 	/* if we've found the next feature, rewind to the start of it and complete */
 	if (*buf == 'A' || *buf == 'a' ||
 	    *buf == 'L' || *buf == 'l' || *buf == 'P' || *buf == 'p') {
-	    fseek(fd, offset, 0);
+	    G_fseek(fd, offset, 0);
 	    break;
 	}
 

Modified: grass/trunk/raster/r.in.poly/getformat.c
===================================================================
--- grass/trunk/raster/r.in.poly/getformat.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster/r.in.poly/getformat.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -14,7 +14,7 @@
 
     max = min = 0;
     first = 1;
-    fseek(fd, 0L, 0);
+    G_fseek(fd, 0L, 0);
     while (G_getl2(buf, (sizeof buf) - 1, fd)) {
 	G_strip(buf);
 	if (*buf != '=')

Modified: grass/trunk/raster/r.in.poly/poly2rast.c
===================================================================
--- grass/trunk/raster/r.in.poly/poly2rast.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster/r.in.poly/poly2rast.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -51,7 +51,7 @@
 	if (npasses > 1)
 	    G_message(_("Pass #%d (of %d) ..."), pass, npasses);
 
-	fseek(ifd, 0L, 0);
+	G_fseek(ifd, 0L, 0);
 	while (get_item(ifd, &type, &cat, &x, &y, &count, &labels)) {
 	    set_cat(cat);
 	    switch (type) {

Modified: grass/trunk/raster/r.in.xyz/main.c
===================================================================
--- grass/trunk/raster/r.in.xyz/main.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster/r.in.xyz/main.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -472,7 +472,7 @@
 	    G_fatal_error(_("Unable to open input file <%s>"), infile);
     }
 
-    can_seek = fseek(in_fp, 0, SEEK_SET) == 0;
+    can_seek = fseek(in_fp, 0L, SEEK_SET) == 0;
 
     /* can't rewind() non-files */
     if (!can_seek && npasses != 1) {
@@ -506,8 +506,8 @@
 		break;
 	    linesize = strlen(buff) + 1;
 	}
-	fseek(in_fp, 0L, SEEK_END);
-	filesize = ftell(in_fp);
+	G_fseek(in_fp, 0L, SEEK_END);
+	filesize = G_ftell(in_fp);
 	rewind(in_fp);
 	if (linesize < 6)	/* min possible: "0,0,0\n" */
 	    linesize = 6;

Modified: grass/trunk/raster/r.le/r.le.patch/driver.c
===================================================================
--- grass/trunk/raster/r.le/r.le.patch/driver.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster/r.le/r.le.patch/driver.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -2302,7 +2302,7 @@
 	d = div;
 
     if (k > 2000) {
-	if (fseek(stdout, 0L, 0))
+	if (G_fseek(stdout, 0L, 0))
 	    G_fatal_error("Can't reset the \"stdout\", exit.\n");
 	k = 0;
     }

Modified: grass/trunk/raster/r.le/r.le.pixel/driver.c
===================================================================
--- grass/trunk/raster/r.le/r.le.pixel/driver.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster/r.le/r.le.pixel/driver.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -1245,7 +1245,7 @@
 	d = div;
 
     if (k > 2000) {
-	if (fseek(stdout, 0L, 0))
+	if (G_fseek(stdout, 0L, 0))
 	    G_fatal_error("Can't reset the \"stdout\", exit.\n");
 	k = 0;
     }

Modified: grass/trunk/raster/r.out.mat/main.c
===================================================================
--- grass/trunk/raster/r.out.mat/main.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster/r.out.mat/main.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -373,7 +373,7 @@
 
 
     /* done! */
-    filesize = ftell(fp1);
+    filesize = G_ftell(fp1);
     fclose(fp1);
 
     G_verbose_message(_("%ld bytes written to '%s'"), filesize, outfile);

Modified: grass/trunk/raster3d/r3.showdspf/cap_data.c
===================================================================
--- grass/trunk/raster3d/r3.showdspf/cap_data.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/raster3d/r3.showdspf/cap_data.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -86,7 +86,7 @@
 	    D_Cap->Rows = yrc;
 	    D_Cap->Cols = xrc;
 	    for (y = ystart; y < yloop; y++) {
-		fseek(fp, D_offset +
+		G_fseek(fp, D_offset +
 		      (xysize * (D_spec->E[Z]) + y * xdim + offset) *
 		      sizeof(float), 0);
 		fread(DB, xrc, sizeof(float), fp);
@@ -105,7 +105,7 @@
 	    D_Cap->Rows = yrc;
 	    D_Cap->Cols = xrc;
 	    for (y = ystart; y < yloop; y++) {
-		fseek(fp, D_offset +
+		G_fseek(fp, D_offset +
 		      (xysize * (D_spec->B[Z] + offset) + y * xdim + offset) *
 		      sizeof(float), 0);
 		fread(DB, xrc, sizeof(float), fp);
@@ -125,7 +125,7 @@
 
 	    for (z = zstart; z < zloop; z++) {
 		for (y = ystart; y < yloop; y++) {
-		    fseek(fp, D_offset +
+		    G_fseek(fp, D_offset +
 			  (xysize * z + xdim * y + (D_spec->E[X] + offset)) *
 			  sizeof(float), 0);
 		    fread(DB++, sizeof(float), 1, fp);
@@ -146,7 +146,7 @@
 
 	    for (z = zstart; z < zloop; z++) {
 		for (y = ystart; y < yloop; y++) {
-		    fseek(fp, D_offset +
+		    G_fseek(fp, D_offset +
 			  (xysize * z + xdim * y + (D_spec->B[X] + offset)) *
 			  sizeof(float), 0);
 		    fread(DB++, sizeof(float), 1, fp);
@@ -164,7 +164,7 @@
 	    D_Cap->Cols = xrc;
 	    for (z = zstart; z < zloop; z++) {
 		/* fill in the buff one line at a time */
-		fseek(fp, D_offset +
+		G_fseek(fp, D_offset +
 		      (xysize * z + xdim * (D_spec->E[Y] + offset) + offset) *
 		      sizeof(float), 0);
 		fread(DB, sizeof(float), xrc, fp);
@@ -182,7 +182,7 @@
 	    D_Cap->Cols = xrc;
 	    for (z = zstart; z < zloop; z++) {
 		/* fill in the buff one line at a time */
-		fseek(fp, D_offset +
+		G_fseek(fp, D_offset +
 		      (xysize * z + xdim * (D_spec->B[Y] + offset) + offset) *
 		      sizeof(float), 0);
 		fread(DB, sizeof(float), xrc, fp);

Modified: grass/trunk/vector/v.support/main.c
===================================================================
--- grass/trunk/vector/v.support/main.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/vector/v.support/main.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -185,7 +185,7 @@
 	    Vect_close(&Map);
 	    exit(EXIT_FAILURE);
 	}
-	fseek(Map.hist_fp, (long)0, SEEK_END);
+	G_fseek(Map.hist_fp, (long)0, SEEK_END);
 	Vect_hist_write(&Map,
 			"---------------------------------------------------------------------------------\n");
 	Vect_hist_write(&Map, "COMMAND: ");

Modified: grass/trunk/vector/v.vol.rst/user1.c
===================================================================
--- grass/trunk/vector/v.vol.rst/user1.c	2009-08-13 00:31:07 UTC (rev 38702)
+++ grass/trunk/vector/v.vol.rst/user1.c	2009-08-13 00:36:20 UTC (rev 38703)
@@ -432,7 +432,7 @@
 	}
 
 	/* seek to the beginning */
-	fseek(Tmp_fd_z, 0L, 0);
+	G_fseek(Tmp_fd_z, 0L, 0);
 
 	/* Read data in from temp file */
 	read_val =
@@ -483,7 +483,7 @@
 	}
 
 	/* seek to the beginning */
-	fseek(Tmp_fd_dx, 0L, 0);
+	G_fseek(Tmp_fd_dx, 0L, 0);
 
 	/* Read data in from temp file */
 	read_val =
@@ -534,7 +534,7 @@
 	}
 
 	/* seek to the beginning */
-	fseek(Tmp_fd_dy, 0L, 0);
+	G_fseek(Tmp_fd_dy, 0L, 0);
 
 	/* Read data in from temp file */
 	read_val =
@@ -585,7 +585,7 @@
 	}
 
 	/* seek to the beginning */
-	fseek(Tmp_fd_dz, 0L, 0);
+	G_fseek(Tmp_fd_dz, 0L, 0);
 
 	/* Read data in from temp file */
 	read_val =
@@ -636,7 +636,7 @@
 	}
 
 	/* seek to the beginning */
-	fseek(Tmp_fd_xx, 0L, 0);
+	G_fseek(Tmp_fd_xx, 0L, 0);
 
 	/* Read data in from temp file */
 	read_val =
@@ -687,7 +687,7 @@
 	}
 
 	/* seek to the beginning */
-	fseek(Tmp_fd_yy, 0L, 0);
+	G_fseek(Tmp_fd_yy, 0L, 0);
 
 	/* Read data in from temp file */
 	read_val =
@@ -738,7 +738,7 @@
 	}
 
 	/* seek to the beginning */
-	fseek(Tmp_fd_xy, 0L, 0);
+	G_fseek(Tmp_fd_xy, 0L, 0);
 
 	/* Read data in from temp file */
 	read_val =



More information about the grass-commit mailing list