[GRASS-SVN] r54693 - grass/trunk/lib/imagery

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 18 02:38:11 PST 2013


Author: martinl
Date: 2013-01-18 02:38:11 -0800 (Fri, 18 Jan 2013)
New Revision: 54693

Modified:
   grass/trunk/lib/imagery/sigfile.c
   grass/trunk/lib/imagery/sigsetfile.c
Log:
imagerylib: update signature functions to use G_unqualified_name()


Modified: grass/trunk/lib/imagery/sigfile.c
===================================================================
--- grass/trunk/lib/imagery/sigfile.c	2013-01-18 10:37:22 UTC (rev 54692)
+++ grass/trunk/lib/imagery/sigfile.c	2013-01-18 10:38:11 UTC (rev 54693)
@@ -1,9 +1,9 @@
-/**
-   \file sigfile.c
+/*!
+   \file lib/imagery/sigfile.c
    
-   \brief Imagery Library - Signature file functions.
+   \brief Imagery Library - Signature file functions (statistics for i.maxlik).
  
-   (C) 2001-2008 by the GRASS Development Team
+   (C) 2001-2008, 2013 by the GRASS Development Team
    
    This program is free software under the GNU General Public License
    (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -14,7 +14,7 @@
 #include <string.h>
 #include <grass/imagery.h>
 
-/**
+/*!
    \brief Create signature file
 
    \param group group name
@@ -46,10 +46,10 @@
     return fd;
 }
 
-/**
-   \brief Open signature file
+/*!
+   \brief Open existing signature file
 
-   \param group group name
+   \param group group name (may be fully qualified)
    \param subgroup subgroup name in given group
    \param name signature filename
 
@@ -63,13 +63,10 @@
     char group_name[GNAME_MAX], group_mapset[GMAPSET_MAX];
     FILE *fd;
 
-    if (!G_name_is_fully_qualified(group, group_name, group_mapset)) {
-	strcpy(group_name, group);
-    }
-    
+    G_unqualified_name(group, NULL, group_name, group_mapset);
     sprintf(element, "subgroup/%s/sig/%s", subgroup, name);
 
-    fd = G_fopen_old_misc("group", element, group_name, G_mapset());
+    fd = G_fopen_old_misc("group", element, group_name, group_mapset);
     
     return fd;
 }

Modified: grass/trunk/lib/imagery/sigsetfile.c
===================================================================
--- grass/trunk/lib/imagery/sigsetfile.c	2013-01-18 10:37:22 UTC (rev 54692)
+++ grass/trunk/lib/imagery/sigsetfile.c	2013-01-18 10:38:11 UTC (rev 54693)
@@ -1,14 +1,14 @@
 /*!
   \file lib/imagery/sigsetfile.c
  
-  \brief Imagery Library - Open/Create signiture files
+  \brief Imagery Library - Signature file functions (statistics for i.smap)
  
-  (C) 2001-2011 by the GRASS Development Team
+  (C) 2001-2011, 2013 by the GRASS Development Team
   
   This program is free software under the GNU General Public License
   (>=v2). Read the file COPYING that comes with GRASS for details.
   
-  \author GRASS GIS Development Team
+  \author USA CERL
 */
 
 #include <string.h>
@@ -62,15 +62,13 @@
 }
 
 /*!
-  \brief Open existing signiture file in given group/subgroup
+  \brief Open existing signiture file
 
-  Note: Prints warning on error and returns NULL.
-
-  \param group name of group
+  \param group name of group (may be fully qualified)
   \param subgroup name of subgroup
   \param name name of signiture file
 
-  \return pointer to FILE
+  \return pointer to FILE*
   \return NULL on error
 */
 FILE *I_fopen_sigset_file_old(const char *group, const char *subgroup,
@@ -80,13 +78,10 @@
     char group_name[GNAME_MAX], group_mapset[GMAPSET_MAX];
     FILE *fd;
 
-    if (!G_name_is_fully_qualified(group, group_name, group_mapset)) {
-	strcpy(group_name, group);
-    }
-
+    G_unqualified_name(group, NULL, group_name, group_mapset);
     sprintf(element, "subgroup/%s/sigset/%s", subgroup, name);
 
-    fd = G_fopen_old_misc("group", element, group_name, G_mapset());
+    fd = G_fopen_old_misc("group", element, group_name, group_mapset);
     
     return fd;
 }



More information about the grass-commit mailing list