[GRASS-SVN] r43509 - grass/branches/releasebranch_6_4/imagery/i.ortho.photo/libes

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 18 12:12:09 EDT 2010


Author: neteler
Date: 2010-09-18 16:12:09 +0000 (Sat, 18 Sep 2010)
New Revision: 43509

Modified:
   grass/branches/releasebranch_6_4/imagery/i.ortho.photo/libes/camera.c
   grass/branches/releasebranch_6_4/imagery/i.ortho.photo/libes/elev.c
Log:
backport: i18N

Modified: grass/branches/releasebranch_6_4/imagery/i.ortho.photo/libes/camera.c
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.ortho.photo/libes/camera.c	2010-09-18 16:11:29 UTC (rev 43508)
+++ grass/branches/releasebranch_6_4/imagery/i.ortho.photo/libes/camera.c	2010-09-18 16:12:09 UTC (rev 43509)
@@ -5,6 +5,7 @@
 **********************************************************/
 #include "orthophoto.h"
 #include <grass/ortholib.h>
+#include <grass/glocale.h>
 
 /* Put the "camera" name into the group file "CAMERA" */
 int I_put_group_camera(char *group, char *camera)
@@ -33,12 +34,12 @@
     G_suppress_warnings(0);
     if (!fd) {
 	sprintf(buf,
-		"unable to open camera file for group [%s] in mapset [%s]",
+		_("Unable to open camera file for group <%s> in mapset <%s>"),
 		group, G_mapset());
 	G_warning(buf);
 	return 0;
     }
-    fgets(buf, sizeof buf, fd);
+    G_getl2(buf, sizeof(buf), fd);
     sscanf(buf, "%s", camera);
-    return (1);
+    return 1;
 }

Modified: grass/branches/releasebranch_6_4/imagery/i.ortho.photo/libes/elev.c
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.ortho.photo/libes/elev.c	2010-09-18 16:11:29 UTC (rev 43508)
+++ grass/branches/releasebranch_6_4/imagery/i.ortho.photo/libes/elev.c	2010-09-18 16:12:09 UTC (rev 43509)
@@ -5,17 +5,18 @@
 **********************************************************/
 #include <stdio.h>
 #include <unistd.h>
+#include <grass/gis.h>
+#include <grass/ortholib.h>
+#include <grass/glocale.h>
 #include "orthophoto.h"
-#include <grass/ortholib.h>
-#include <grass/gis.h>
 
+
 #define IN_BUF 200
 
 
 /* Put the "elev" name into the block file "ELEV" */
-int
-I_put_group_elev(char *group, char *elev, char *mapset_elev, char *tl,
-		 char *math_exp, char *units, char *nd)
+int I_put_group_elev(char *group, char *elev, char *mapset_elev, char *tl,
+		     char *math_exp, char *units, char *nd)
 {
     FILE *fd;
 
@@ -36,24 +37,29 @@
 }
 
 
-/* Return the elev name from the block file ELEV */
-int
-I_get_group_elev(char *group, char *elev, char *mapset_elev, char *tl,
-		 char *math_exp, char *units, char *nd)
+/* Return the elev name from the block file ELEV
+    returns 0 on fail,  1 on success */
+int I_get_group_elev(char *group, char *elev, char *mapset_elev, char *tl,
+		     char *math_exp, char *units, char *nd)
 {
     char buf[IN_BUF];
     FILE *fd;
 
-    if (!I_find_group_elev_file(group))
+    if (!I_find_group_elev_file(group)) {
+	G_warning(
+	    _("Unable to find elevation file for group <%s> in mapset <%s>"),
+	      group, G_mapset());
 	return 0;
+    }
 
     G_suppress_warnings(1);
     fd = I_fopen_group_elev_old(group);
     G_suppress_warnings(0);
+
     if (!fd) {
-	G_warning
-	    ("unable to open elevation file for group [%s] in mapset [%s]",
-	     group, G_mapset());
+	G_warning(
+	    _("Unable to open elevation file for group <%s> in mapset <%s>"),
+	      group, G_mapset());
 	G_sleep(3);
 
 	return 0;
@@ -73,5 +79,5 @@
     sscanf(buf, "no data values  :%s\n", nd);
     fclose(fd);
 
-    return (1);
+    return 1;
 }



More information about the grass-commit mailing list