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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 5 02:14:06 PDT 2012


Author: wenzeslaus
Date: 2012-09-05 02:14:05 -0700 (Wed, 05 Sep 2012)
New Revision: 53090

Modified:
   grass/trunk/lib/gis/adj_cellhd.c
   grass/trunk/lib/gis/put_window.c
   grass/trunk/lib/gis/set_window.c
Log:
dox: region (window) functions doc improvements

Modified: grass/trunk/lib/gis/adj_cellhd.c
===================================================================
--- grass/trunk/lib/gis/adj_cellhd.c	2012-09-05 06:26:13 UTC (rev 53089)
+++ grass/trunk/lib/gis/adj_cellhd.c	2012-09-05 09:14:05 UTC (rev 53090)
@@ -34,8 +34,6 @@
  * \param[in,out] cellhd pointer to Cell_head structure
  * \param row_flag compute n-s resolution
  * \param col_flag compute e-w resolution
-
- * \return NULL on success
  */
 void G_adjust_Cell_head(struct Cell_head *cellhd, int row_flag, int col_flag)
 {
@@ -177,12 +175,13 @@
  * If <i>depth_flag</i> are false, number of depths is calculated from 
  * top-bottom resolution.
  *
+ * \warning This function can cause segmentation fault without any warning
+ * when it is called with Cell_head top and bottom set to zero.
+ *
  * \param[in,out] cellhd pointer to Cell_head structure
  * \param row_flag compute n-s resolution
  * \param col_flag compute e-w resolution
  * \param depth_flag compute t-b resolution
- *
- * \return NULL on success
  */
 void G_adjust_Cell_head3(struct Cell_head *cellhd, int row_flag,
 			 int col_flag, int depth_flag)

Modified: grass/trunk/lib/gis/put_window.c
===================================================================
--- grass/trunk/lib/gis/put_window.c	2012-09-05 06:26:13 UTC (rev 53089)
+++ grass/trunk/lib/gis/put_window.c	2012-09-05 09:14:05 UTC (rev 53090)
@@ -15,20 +15,31 @@
 #include <grass/gis.h>
 
 /*!
- * \brief Write the database region
+ * \brief Writes the database region (window)
  *
  * Writes the database region file (WIND) in the user's current mapset
- * from region. 
-
- * <b>Warning:</b> Since this routine actually changes the database
- * region, it should only be called by modules which the user knows
+ * or when environmental variable \c WIND_OVERRIDE is set,
+ * it writes the region to file specified by \c WIND_OVERRIDE variable.
+ *
+ * When \c WIND_OVERRIDE is set the current process and child processes
+ * are affected.
+ * Otherwise the whole GRASS session is affected.
+ *
+ * \warning When environmental variable \c WIND_OVERRIDE is not set,
+ * this routine actually changes the database region.
+ * So in this case it should only be called by modules which the user knows
  * will change the region. It is probably fair to say that only the
- * <tt>g.region</tt>.
+ * \gmod{g.region} should call this routine unless \c WIND_OVERRIDE is set.
  *
+ * This function does not adjust the \p window before setting the region
+ * so you should call G_adjust_Cell_head() before calling this function.
+ *
  * \param[in,out] window pointer to Cell_head
  *
  * \return 1 on success
  * \return -1 on error (no diagnostic message is printed)
+ *
+ * \sa G_get_window(), G_set_window(), python.core.use_temp_region()
  */
 int G_put_window(const struct Cell_head *window)
 {
@@ -47,7 +58,7 @@
  * <b>Warning:</b> Since this routine actually changes the database
  * region, it should only be called by modules which the user knows
  * will change the region. It is probably fair to say that only the
- * <tt>g.region</tt>.
+ * <tt>g.region</tt> should call this routine.
  *
  * \param[in,out] window pointer to Cell_head
  * \param dir directory name
@@ -55,6 +66,8 @@
  *
  * \return 1 on success
  * \return -1 on error (no diagnostic message is printed)
+ *
+ * \sa G_put_window()
  */
 int G__put_window(const struct Cell_head *window, const char *dir, const char *name)
 {

Modified: grass/trunk/lib/gis/set_window.c
===================================================================
--- grass/trunk/lib/gis/set_window.c	2012-09-05 06:26:13 UTC (rev 53089)
+++ grass/trunk/lib/gis/set_window.c	2012-09-05 09:14:05 UTC (rev 53090)
@@ -18,11 +18,17 @@
 
 /*!
   \brief Get the current working window (region)
-  
+
   The current working window values are returned in the structure
-  <i>window</i>.
-  
-  \param[out] window window structure to be set
+  \p window.
+
+  Previous calls to G_set_window() affects values returned by this function.
+  Previous calls to G_put_window() affects values returned by this function
+  only if the current working window is not initialized.
+
+  \param[out] window pointer to window structure to be set
+
+  \sa G_set_window(), G_get_window()
 */
 void G_get_set_window(struct Cell_head *window)
 {
@@ -31,9 +37,16 @@
 }
 
 /*!
-  \brief Establishes 'window' as the current working window.
-  
+  \brief Establishes \p window as the current working window (region).
+
+  This function adjusts the \p window before setting the region
+  so you don't have to call G_adjust_Cell_head().
+
+  \note Only the current process is affected.
+
   \param window window to become operative window
+
+  \sa G_get_set_window(), G_put_window()
 */
 void G_set_window(struct Cell_head *window)
 {



More information about the grass-commit mailing list