[GRASS-SVN] r60203 - grass/trunk/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 11 18:53:47 PDT 2014


Author: hcho
Date: 2014-05-11 18:53:47 -0700 (Sun, 11 May 2014)
New Revision: 60203

Modified:
   grass/trunk/lib/gis/strings.c
Log:
Added G_store_upper/lower()

Modified: grass/trunk/lib/gis/strings.c
===================================================================
--- grass/trunk/lib/gis/strings.c	2014-05-11 21:22:26 UTC (rev 60202)
+++ grass/trunk/lib/gis/strings.c	2014-05-12 01:53:47 UTC (rev 60203)
@@ -100,6 +100,54 @@
 }
 
 /*!
+  \brief Copy string to allocated memory and convert copied string
+  to upper case
+  
+  This routine allocates enough memory to hold the string <b>s</b>,
+  copies <em>s</em> to the allocated memory, and returns a pointer
+  to the allocated memory.
+  
+  If <em>s</em> is NULL then empty string is returned.
+  
+  \param s string
+ 
+  \return pointer to newly allocated upper case string
+*/
+char *G_store_upper(const char *s)
+{
+    char *u_s;
+
+    u_s = G_store(s);
+    G_str_to_upper(u_s);
+
+    return u_s;
+}
+
+/*!
+  \brief Copy string to allocated memory and convert copied string
+  to lower case
+  
+  This routine allocates enough memory to hold the string <b>s</b>,
+  copies <em>s</em> to the allocated memory, and returns a pointer
+  to the allocated memory.
+  
+  If <em>s</em> is NULL then empty string is returned.
+  
+  \param s string
+ 
+  \return pointer to newly allocated lower case string
+*/
+char *G_store_lower(const char *s)
+{
+    char *l_s;
+
+    l_s = G_store(s);
+    G_str_to_lower(l_s);
+
+    return l_s;
+}
+
+/*!
   \brief Replace all occurencies of character in string bug with new
   
   \param[in,out] bug base string



More information about the grass-commit mailing list