[GRASS-SVN] r34144 - grass/trunk/lib/sites

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Nov 2 22:49:26 EST 2008


Author: hamish
Date: 2008-11-02 22:49:26 -0500 (Sun, 02 Nov 2008)
New Revision: 34144

Modified:
   grass/trunk/lib/sites/sites.c
Log:
sites lib warning to less scary G_message; i18n (merge from devbr6)

Modified: grass/trunk/lib/sites/sites.c
===================================================================
--- grass/trunk/lib/sites/sites.c	2008-11-03 03:40:00 UTC (rev 34143)
+++ grass/trunk/lib/sites/sites.c	2008-11-03 03:49:26 UTC (rev 34144)
@@ -21,7 +21,9 @@
 #include <grass/site.h>
 #include <grass/dbmi.h>
 #include <grass/Vect.h>
+#include <grass/glocale.h>
 
+
 #define DQUOTE '"'
 #define SPACE ' '
 #define BSLASH 92
@@ -92,7 +94,7 @@
 				      site_att_cmp);
 
 	    if (sa == NULL) {
-		G_warning("Attributes for category %d not found", cat);
+		G_warning(_("Attributes for category %d not found"), cat);
 		for (i = 0; i < Map->n_site_dbl; i++)
 		    s->dbl_att[i] = 0;
 		for (i = 0; i < Map->n_site_str; i++)
@@ -131,7 +133,7 @@
     G_debug(4, "cattype = %d", s->cattype);
 
     if (s->cattype == FCELL_TYPE || s->cattype == DCELL_TYPE)
-	G_fatal_error("Category must be integer");
+	G_fatal_error(_("Category must be integer"));
 
     if (s->cattype == CELL_TYPE)
 	Vect_cat_set(Cats, 1, s->ccat);
@@ -205,9 +207,9 @@
 		if ((head->time =
 		     (struct TimeStamp *)G_malloc(sizeof(struct TimeStamp)))
 		    == NULL)
-		    G_fatal_error("Memory error in writing timestamp");
+		    G_fatal_error(_("Memory error in writing timestamp"));
 		else if (G_scan_timestamp(head->time, head->stime) < 0) {
-		    G_warning("Illegal TimeStamp string");
+		    G_warning(_("Illegal TimeStamp string"));
 		    return -1;	/* added to prevent crash 5/2000 MN */
 		}
 	    }
@@ -236,7 +238,7 @@
     if (head->stime && strlen(head->stime) > 0) {
 	if ((head->time =
 	     (struct TimeStamp *)G_malloc(sizeof(struct TimeStamp))) == NULL)
-	    G_fatal_error("Memory error in allocating timestamp");
+	    G_fatal_error(_("Memory error in allocating timestamp"));
 	if (G_scan_timestamp(head->time, head->stime) < 0) {
 	    G_warning(datetime_error_msg());
 
@@ -290,8 +292,9 @@
     dbColumn *column;
     dbValue *value;
 
-    G_warning
-	("Adapted sites library used for vector points (module should be updated to GRASS 6 vector library).");
+    G_message(
+	_("Dev note: Adapted sites library used for vector points. "
+	  "(module should be updated to GRASS 6 vector library)"));
 
     Map = (struct Map_info *)G_malloc(sizeof(struct Map_info));
 
@@ -314,7 +317,7 @@
 
     driver = db_start_driver_open_database(fi->driver, fi->database);
     if (driver == NULL)
-	G_fatal_error("Cannot open database %s by driver %s", fi->database,
+	G_fatal_error(_("Cannot open database %s by driver %s"), fi->database,
 		      fi->driver);
 
     db_init_string(&stmt);
@@ -322,7 +325,7 @@
     db_append_string(&stmt, fi->table);
 
     if (db_open_select_cursor(driver, &stmt, &cursor, DB_SEQUENTIAL) != DB_OK)
-	G_fatal_error("Cannot select attributes.");
+	G_fatal_error(_("Cannot select attributes"));
 
     nrows = db_get_num_rows(&cursor);
     G_debug(1, "%d rows selected from vector attribute table", nrows);
@@ -337,7 +340,7 @@
     adbl = astr = 0;
     while (1) {
 	if (db_fetch(&cursor, DB_NEXT, &more) != DB_OK)
-	    G_fatal_error("Cannot fetch row.");
+	    G_fatal_error(_("Cannot fetch row"));
 
 	if (!more)
 	    break;
@@ -417,8 +420,9 @@
 {
     struct Map_info *Map;
 
-    G_warning
-	("Adapted sites library used for vector points (module should be updated to GRASS 6 vector library).");
+    G_message(
+	_("Dev note: Adapted sites library used for vector points. "
+	  "(module should be updated to GRASS 6 vector library)"));
     G_warning("Site/vector attributes ignored.");
 
     Map = (struct Map_info *)G_malloc(sizeof(struct Map_info));
@@ -518,7 +522,7 @@
     Site *s;
 
     if (n_dim < 2 || n_s_att < 0 || n_d_att < 0)
-	G_fatal_error("G_oldsite_new_struct: invalid # dims or fields\n");
+	G_fatal_error(_("G_oldsite_new_struct: invalid # dims or fields"));
 
     if ((s = (Site *) G_malloc(sizeof(Site))) == NULL)
 	return (Site *) NULL;
@@ -1188,7 +1192,7 @@
 
     driver = db_start_driver_open_database(fi->driver, fi->database);
     if (driver == NULL)
-	G_fatal_error("Cannot open database %s by driver %s", fi->database,
+	G_fatal_error(_("Cannot open database %s by driver %s"), fi->database,
 		      fi->driver);
 
     db_init_string(&stmt);
@@ -1196,7 +1200,7 @@
     db_append_string(&stmt, fi->table);
 
     if (db_open_select_cursor(driver, &stmt, &cursor, DB_SEQUENTIAL) != DB_OK)
-	G_fatal_error("Cannot select attributes.");
+	G_fatal_error(_("Cannot select attributes"));
 
     nrows = db_get_num_rows(&cursor);
     G_debug(1, "%d rows selected from vector attribute table", nrows);
@@ -1252,9 +1256,8 @@
     return ncols;
 }
 
-/*
-   Frees fields allocated with G_sites_get_fields
- */
+
+/* Frees fields allocated with G_sites_get_fields */
 void G_sites_free_fields(int ncols, char **cnames, int *ctypes, int *ndx)
 {
     for (; ncols > 0; ncols--)
@@ -1265,7 +1268,3 @@
 }
 
 /*** ACS_MODIFY_END - sites_attribute management *******************************/
-
-/*******************************************************************************/
-
-/*******************************************************************************/



More information about the grass-commit mailing list