فهرست منبع

imagerylib: update signature functions to use G_unqualified_name()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54693 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 سال پیش
والد
کامیت
79ea9c0b06
2فایلهای تغییر یافته به همراه18 افزوده شده و 26 حذف شده
  1. 10 13
      lib/imagery/sigfile.c
  2. 8 13
      lib/imagery/sigsetfile.c

+ 10 - 13
lib/imagery/sigfile.c

@@ -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
    This program is free software under the GNU General Public License
    (>=v2). Read the file COPYING that comes with GRASS for details.
    (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -14,7 +14,7 @@
 #include <string.h>
 #include <string.h>
 #include <grass/imagery.h>
 #include <grass/imagery.h>
 
 
-/**
+/*!
    \brief Create signature file
    \brief Create signature file
 
 
    \param group group name
    \param group group name
@@ -46,10 +46,10 @@ FILE *I_fopen_signature_file_new(const char *group,
     return fd;
     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 subgroup subgroup name in given group
    \param name signature filename
    \param name signature filename
 
 
@@ -63,13 +63,10 @@ FILE *I_fopen_signature_file_old(const char *group,
     char group_name[GNAME_MAX], group_mapset[GMAPSET_MAX];
     char group_name[GNAME_MAX], group_mapset[GMAPSET_MAX];
     FILE *fd;
     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);
     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;
     return fd;
 }
 }

+ 8 - 13
lib/imagery/sigsetfile.c

@@ -1,14 +1,14 @@
 /*!
 /*!
   \file lib/imagery/sigsetfile.c
   \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
   This program is free software under the GNU General Public License
   (>=v2). Read the file COPYING that comes with GRASS for details.
   (>=v2). Read the file COPYING that comes with GRASS for details.
   
   
-  \author GRASS GIS Development Team
+  \author USA CERL
 */
 */
 
 
 #include <string.h>
 #include <string.h>
@@ -62,15 +62,13 @@ FILE *I_fopen_sigset_file_new(const char *group, const char *subgroup,
 }
 }
 
 
 /*!
 /*!
-  \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 subgroup name of subgroup
   \param name name of signiture file
   \param name name of signiture file
 
 
-  \return pointer to FILE
+  \return pointer to FILE*
   \return NULL on error
   \return NULL on error
 */
 */
 FILE *I_fopen_sigset_file_old(const char *group, const char *subgroup,
 FILE *I_fopen_sigset_file_old(const char *group, const char *subgroup,
@@ -80,13 +78,10 @@ FILE *I_fopen_sigset_file_old(const char *group, const char *subgroup,
     char group_name[GNAME_MAX], group_mapset[GMAPSET_MAX];
     char group_name[GNAME_MAX], group_mapset[GMAPSET_MAX];
     FILE *fd;
     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);
     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;
     return fd;
 }
 }