[GRASS-SVN] r31304 - grass/branches/develbranch_6/lib/ogsf

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 9 16:04:39 EDT 2008


Author: martinl
Date: 2008-05-09 16:04:39 -0400 (Fri, 09 May 2008)
New Revision: 31304

Modified:
   grass/branches/develbranch_6/lib/ogsf/GK2.c
   grass/branches/develbranch_6/lib/ogsf/GP2.c
   grass/branches/develbranch_6/lib/ogsf/GS2.c
   grass/branches/develbranch_6/lib/ogsf/GSX.c
   grass/branches/develbranch_6/lib/ogsf/GV2.c
   grass/branches/develbranch_6/lib/ogsf/GVL2.c
   grass/branches/develbranch_6/lib/ogsf/Gp3.c
   grass/branches/develbranch_6/lib/ogsf/Gs3.c
   grass/branches/develbranch_6/lib/ogsf/Gv3.c
   grass/branches/develbranch_6/lib/ogsf/Gvl3.c
   grass/branches/develbranch_6/lib/ogsf/gk.c
   grass/branches/develbranch_6/lib/ogsf/gp.c
   grass/branches/develbranch_6/lib/ogsf/gpd.c
   grass/branches/develbranch_6/lib/ogsf/gs.c
   grass/branches/develbranch_6/lib/ogsf/gs_bm.c
   grass/branches/develbranch_6/lib/ogsf/gs_norms.c
   grass/branches/develbranch_6/lib/ogsf/gs_query.c
   grass/branches/develbranch_6/lib/ogsf/gsd_cplane.c
   grass/branches/develbranch_6/lib/ogsf/gsd_fonts.c
   grass/branches/develbranch_6/lib/ogsf/gsd_fringe.c
   grass/branches/develbranch_6/lib/ogsf/gsd_img_mpeg.c
   grass/branches/develbranch_6/lib/ogsf/gsd_img_ppm.c
   grass/branches/develbranch_6/lib/ogsf/gsd_img_tif.c
   grass/branches/develbranch_6/lib/ogsf/gsd_label.c
   grass/branches/develbranch_6/lib/ogsf/gsd_legend.c
   grass/branches/develbranch_6/lib/ogsf/gsd_objs.c
   grass/branches/develbranch_6/lib/ogsf/gsd_prim.c
   grass/branches/develbranch_6/lib/ogsf/gsd_surf.c
   grass/branches/develbranch_6/lib/ogsf/gsd_views.c
   grass/branches/develbranch_6/lib/ogsf/gsd_wire.c
   grass/branches/develbranch_6/lib/ogsf/gsdiff.c
   grass/branches/develbranch_6/lib/ogsf/gsdrape.c
   grass/branches/develbranch_6/lib/ogsf/gsds.c
   grass/branches/develbranch_6/lib/ogsf/gsget.c
   grass/branches/develbranch_6/lib/ogsf/gsget.h
   grass/branches/develbranch_6/lib/ogsf/gv.c
   grass/branches/develbranch_6/lib/ogsf/gv_quick.c
   grass/branches/develbranch_6/lib/ogsf/gvd.c
   grass/branches/develbranch_6/lib/ogsf/gvl.c
   grass/branches/develbranch_6/lib/ogsf/gvl_calc.c
   grass/branches/develbranch_6/lib/ogsf/gvl_calc2.c
   grass/branches/develbranch_6/lib/ogsf/gvl_file.c
   grass/branches/develbranch_6/lib/ogsf/gvld.c
   grass/branches/develbranch_6/lib/ogsf/mc33_table.h
   grass/branches/develbranch_6/lib/ogsf/rgbpack.h
   grass/branches/develbranch_6/lib/ogsf/rowcol.h
   grass/branches/develbranch_6/lib/ogsf/trans.c
Log:
ogsf: doxygenization (headers, initial fn desc), not completed
i18n, fprintf -> G_


Modified: grass/branches/develbranch_6/lib/ogsf/GK2.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/GK2.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/GK2.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -20,6 +20,7 @@
 #include <grass/gstypes.h>
 #include <grass/keyframe.h>
 #include <grass/kftypes.h>
+#include <grass/glocale.h>
 
 static int _add_key(Keylist *, int, float);
 static void _remove_key(Keylist *);
@@ -177,7 +178,7 @@
 }
 
 /*!
-  \brief ADD
+  \brief Show tension stop ?
 
   Use GK_showtension_start/GK_update_tension/GK_showtension_stop to
   initialize and stop multi-view display of path when changing
@@ -188,6 +189,9 @@
     return;
 }
 
+/*!
+  \brief Update tension
+*/
 void GK_update_tension(void)
 {
     if (Views) {
@@ -197,8 +201,11 @@
     return;
 }
 
+/*!
+  \brief Print keyframe info
 
-
+  \param name filename
+*/
 void GK_print_keys(char *name)
 {
     Keylist *k;
@@ -206,7 +213,7 @@
     int cnt = 1;
 
     if (NULL == (fp = fopen(name, "w"))) {
-	fprintf(stderr, "Cannot open file for output\n"), exit(1);
+	G_fatal_error (_("Unable to open file <%s> for writing"), name);
     }
     /* write a default frame rate of 30 at top of file */
     fprintf(fp, "30 \n");
@@ -262,8 +269,7 @@
 	Views = gk_make_linear_framesfromkeys(Keys, Numkeys, Viewsteps, loop);
 
 	if (!Views) {
-	    fprintf(stderr,
-		    "Check no. of frames requested and keyframes marked\n");
+	    G_warning(_("Check no. of frames requested and keyframes marked"));
 	}
     }
     else if (Numkeys > 2) {
@@ -276,8 +282,7 @@
 	    (Keys, Numkeys, Viewsteps, loop, 1.0 - Tension);
 
 	if (!Views) {
-	    fprintf(stderr,
-		    "Check no. of frames requested and keyframes marked\n");
+	    G_warning(_("Check no. of frames requested and keyframes marked"));
 	}
     }
 
@@ -322,7 +327,9 @@
   Precis works as in other functions - to identify keyframe to move.
   Only the first keyframe in the precis range will be moved.
 
-  \param ADD
+  \param oldpos old position
+  \param precis precision value
+  \param newpos new position
 
   \return number of keys moved (1 or 0)
 */
@@ -344,14 +351,16 @@
 }
 
 /*!
-  Delete key
+  Delete keyframe
 
   The values pos and precis are used to determine which keyframes to
   delete.  Any keyframes with their position within precis of pos will
   be deleted if justone is zero.  If justone is non-zero, only the first
   (lowest pos) keyframe in the range will be deleted.
 
-  \param ADD
+  \param pos position
+  \param precis precision
+  \param justone delete only one keyframe
 
   \return number of keys deleted.
 */
@@ -409,7 +418,10 @@
    pre-existing keyframe. e.g., if anykey.pos - newkey.pos &lt;= precis,
    GK_add_key() will fail unless force_replace is TRUE.
 
-   \param ADD
+   \param pos postion
+   \param fmaks
+   \param force_replace
+   \param precis precision value
    
    \return 1 if key is added
    \return -1 key not added
@@ -432,16 +444,12 @@
     newk->fields[KF_FROMY] = tmp[Y];
     newk->fields[KF_FROMZ] = tmp[Z];
 
-#ifdef KDEBUG
-    {
-	fprintf(stderr, "KEY FROM: %f %f %f\n", tmp[X], tmp[Y], tmp[Z]);
-    }
-#endif
+    G_debug (3, "KEY FROM: %f %f %f", tmp[X], tmp[Y], tmp[Z]);
 
 /* Instead of View Dir try get_focus (view center) */
 /* View Dir is implied from eye and center position */
 /*    GS_get_viewdir(tmp); */
-
+    
 /* ACS 1 line: was 	GS_get_focus(tmp);
  	with this kanimator works also for flythrough navigation
 	also changed in gk.c
@@ -472,7 +480,8 @@
   Step should be a value between 1 and the number of frames.  If
   render is non-zero, calls draw_all.
 
-  \param ADD
+  \param step step value
+  \param render
 */
 void GK_do_framestep(int step, int render)
 {
@@ -488,7 +497,7 @@
 /*!
   \brief Draw the current path
 
-  \param ADD
+  \param flag
 */
 void GK_show_path(int flag)
 {
@@ -512,6 +521,11 @@
     return;
 }
 
+/*!
+  \brief Show vector sets
+
+  \param flag
+*/
 void GK_show_vect(int flag)
 {
     if (flag) {
@@ -533,6 +547,11 @@
     return;
 }
 
+/*!
+  \brief Show point sets
+
+  \param flag
+*/
 void GK_show_site(int flag)
 {
     if (flag) {
@@ -556,6 +575,11 @@
     return;
 }
 
+/*!
+  \brief Show volumes
+
+  \param flag
+*/
 void GK_show_vol(int flag)
 {
     if (flag) {
@@ -579,24 +603,23 @@
     return;
 }
 
+/*!
+  \brief Show list
 
+  \param flag
+*/
 void GK_show_list( int flag)
 {
+    if (flag) {
+	Fmode |= FM_LABEL;
+	
+	if (Views) {
+	    GS_draw_all_list();
+	}
+    }
+    else {
+	Fmode &= ~FM_LABEL;
+    }
 
-        if (flag) {
-
-                Fmode |= FM_LABEL;
-
-                if (Views) {
-
-                GS_draw_all_list();
-
-                }
-        }
-        else {
-                Fmode &= ~FM_LABEL;
-        }
-
-        return;
+    return;
 }
-

Modified: grass/branches/develbranch_6/lib/ogsf/GP2.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/GP2.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/GP2.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,7 +1,7 @@
 /*!
   \file GP2.c
  
-  \brief OGSF library - loading and manipulating point sets
+  \brief OGSF library - loading and manipulating point sets (higher level functions)
  
   GRASS OpenGL gsurf OGSF Library 
  
@@ -12,7 +12,8 @@
   Read the file COPYING that comes with GRASS
   for details.
   
-  \author Bill Brown USACERL, GMSL/University of Illinois (January 1994)
+  \author Bill Brown USACERL (January 1994)
+  Doxygenized by Martin landa <landa.martin gmail.com> (May 2008)
 */
 
 #include <stdlib.h>
@@ -25,7 +26,14 @@
 static int Site_ID[MAX_SITES];
 static int Next_site = 0;
 
-/***********************************************************************/
+/*!
+  \brief Check if point set exists
+
+  \param id point set id
+  
+  \return 1 found
+  \return 0 not found
+*/
 int GP_site_exists(int id)
 {
     int i, found = 0;
@@ -49,7 +57,12 @@
     return (found);
 }
 
-/***********************************************************************/
+/*!
+  \brief Register new point set
+
+  \return point set id
+  \return -1 on error (number of point sets exceeded)
+*/
 int GP_new_site(void)
 {
     geosite *np;
@@ -71,7 +84,11 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get number of available point sets
+
+  \return number of point sets
+*/
 int GP_num_sites(void)
 {
     return (gp_num_sites());
@@ -80,11 +97,12 @@
 /*!
   \brief Get list of point sets
   
-  Must free when no longer needed!
+  Must freed when no longer needed!
 
   \param numsites number of point sets
 
-  \return ADD
+  \return pointer to list of points sets
+  \return NULL on error
 */
 int *GP_get_site_list(int *numsites)
 {
@@ -93,8 +111,8 @@
     *numsites = Next_site;
 
     if (Next_site) {
-	if (NULL == (ret = (int *) malloc(Next_site * sizeof(int)))) {
-	    fprintf(stderr, "can't malloc\n");
+	ret = (int *) G_malloc(Next_site * sizeof(int)); /* G_fatal_error */
+	if (!ret) {
 	    return (NULL);
 	}
 
@@ -108,7 +126,14 @@
     return (NULL);
 }
 
-/***********************************************************************/
+/*!
+  \brief Delete registrated point set
+
+  \param id point set id
+
+  \return 1 on success
+  \return -1 on error (point sets not available)
+*/
 int GP_delete_site(int id)
 {
     int i, j, found = 0;
@@ -140,16 +165,25 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Load point set from file
+
+  Check to see if handle already loaded, if so - free before loading new 
+  for now, always load to memory 
+  
+  \todo load file handle & ready for reading instead of using
+  memory
+
+  \param id point set id
+  \param filename point set filename
+
+  \return -1 on error
+  \return 1 on success
+*/
 int GP_load_site(int id, char *filename)
 {
     geosite *gp;
 
-    /* check to see if handle already loaded, if so - free before loading new */
-    /* for now, always load to memory */
-    /* TODO SOON: load file handle & ready for reading instead of using */
-    /* memory */
-
     if (NULL == (gp = gp_get_site(id))) {
 	return (-1);
     }
@@ -170,7 +204,15 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get point set filename
+
+  \param id point set id
+  \param[out] filename point set filename
+
+  \return -1 on error (point set not found)
+  \return 1 on success
+*/
 int GP_get_sitename(int id, char *filename)
 {
     geosite *gp;
@@ -184,7 +226,9 @@
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get point set mode
+*/
 int GP_get_sitemode(int id, int *atmod, int *color, int *width, float *size,
 		    int *marker)
 {
@@ -203,7 +247,18 @@
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set mode for point set
+
+  \param id point set id
+  \param atmod
+  \param color color value
+  \param width 
+  \param size point size
+  \param marker marker symbol
+
+  \return -1 on error (point set not found)
+*/
 int GP_set_sitemode(int id, int atmod, int color, int width, float size,
 		    int marker)
 {
@@ -222,9 +277,18 @@
     return (1);
 }
 
-/***********************************************************************/
-/* TODO: make similar routines for attmode_size, attmode_marker (use transform) */
-/* return 1 for success, 0 for no attribute info, -1 for bad parameter */
+/*!
+  \brief Set attribute mode color
+
+  \todo make similar routines for attmode_size, attmode_marker (use transform)
+  
+  \param id surface id
+  \param filename filename
+
+  \return 1 for success
+  \return 0 for no attribute info
+  \return -1 for bad parameter
+*/
 int GP_attmode_color(int id, char *filename)
 {
     geosite *gp;
@@ -245,7 +309,14 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set attribute mode to none
+
+  \param id point set id
+
+  \return -1 on error (invalid point set id)
+  \return 1 on success
+*/
 int GP_attmode_none(int id)
 {
     geosite *gp;
@@ -259,7 +330,16 @@
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set z-mode
+
+  \param id poin set id
+  \param use_z use z ?
+
+  \return 1 on success
+  \return 0 no z
+  \return -1 on error (invalid point set id)
+*/
 int GP_set_zmode(int id, int use_z)
 {
     geosite *gp;
@@ -281,7 +361,15 @@
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get z-mode
+
+  \param id point set id
+  \param[out] use_z use z
+  
+  \return -1 on error (invalid point set id)
+  \return 1 on success
+*/
 int GP_get_zmode(int id, int *use_z)
 {
     geosite *gp;
@@ -294,7 +382,12 @@
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set trans ?
+
+  \param id point set id
+  \param xtrans,ytrans,ztrans x/y/z trans values
+*/
 void GP_set_trans(int id, float xtrans, float ytrans, float ztrans)
 {
     geosite *gp;
@@ -315,7 +408,12 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get trans
+
+  \param id point set id
+  \param xtrans,ytrans,ztrans x/y/z trans values
+*/
 void GP_get_trans(int id, float *xtrans, float *ytrans, float *ztrans)
 {
     geosite *gp;
@@ -337,7 +435,15 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Select surface
+
+  \param hp point set id
+  \param hs surface id
+
+  \return 1 surface selected
+  \return -1 on error
+*/
 int GP_select_surf(int hp, int hs)
 {
     geosite *gp;
@@ -357,7 +463,15 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Unselect surface
+
+  \param hp point set id
+  \param hs surface id
+
+  \return 1 surface unselected
+  \return -1 on error
+*/
 int GP_unselect_surf(int hp, int hs)
 {
     geosite *gp;
@@ -385,7 +499,15 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Check if surface is selected
+
+  \param hp point set id
+  \param hs surface id
+
+  \return 1 selected
+  \return 0 not selected
+*/
 int GP_surf_is_selected(int hp, int hs)
 {
     int i;
@@ -404,7 +526,11 @@
     return (0);
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw point set
+
+  \param id point set id
+*/
 void GP_draw_site(int id)
 {
     geosurf *gs;
@@ -427,8 +553,8 @@
 		if (gs) {
 		    gpd_2dsite(gp, gs, 0);
 		#ifdef TRACE_GP_FUNCS
-		    fprintf(stderr, "Drawing site %d on Surf %d\n", id,
-			    gp->drape_surf_id[i]);
+		    G_debug (3, "Drawing site %d on Surf %d", id,
+			     gp->drape_surf_id[i]);
 		    print_site_fields(gp);
 		#endif
 		}
@@ -439,7 +565,9 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw all available point sets
+*/
 void GP_alldraw_site(void)
 {
     int id;
@@ -451,7 +579,15 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Set client data
+
+  \param id point set id
+  \param clientd client data
+
+  \return 1 on success
+  \return -1 on error (invalid point set id)
+*/
 int GP_Set_ClientData(int id, void *clientd)
 {
     geosite *gp;
@@ -466,7 +602,14 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get client data
+
+  \param id point set id
+
+  \return pointer to client data
+  \return NULL on error
+*/
 void *GP_Get_ClientData(int id)
 {
     geosite *gp;

Modified: grass/branches/develbranch_6/lib/ogsf/GS2.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/GS2.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/GS2.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,9 +1,20 @@
 /*!
   \file GS2.c
  
-  \brief OGSF library - loading and manipulating surfaces
+  \brief OGSF library - loading and manipulating surfaces (higher level functions)
  
   GRASS OpenGL gsurf OGSF Library 
+
+  Plans for handling color maps:
+  NOW:
+  if able to load as unsigned char, make lookup table containing palette
+  otherwise, load directly as packed color, set lookup = NULL
+  MAYBE LATER:
+  if able to load as POSITIVE short, make lookup table containing palette
+  - may want to calculate savings first (ie,  numcells > 32768)
+  (not exactly, it's Friday & time to go home - figure it later)
+  otherwise, load directly as packed color, set lookup = NULL
+  MESSY! - need to fix up!
  
   (C) 1999-2008 by the GRASS Development Team
  
@@ -12,8 +23,9 @@
   Read the file COPYING that comes with GRASS
   for details.
   
-  \author Bill Brown USACERL, GMSL/University of Illinois
-  Pierre de Mouveaux (p_de_mouveaux hotmail.com) (updated 24 oct. 1999)
+  \author Bill Brown USACERL (1993)
+  Pierre de Mouveaux <p_de_mouveaux hotmail.com> (updated October 1999)
+  Doxygenized by Martin Landa <landa.martin gmail.com> (May 2008)
 */
 
 #include <stdlib.h>
@@ -32,6 +44,7 @@
 
 #include <grass/gis.h>
 #include <grass/gstypes.h>
+#include <grass/glocale.h>
 
 #include "gsget.h"
 #include "rowcol.h"
@@ -50,13 +63,17 @@
 
 int gsd_getViewport(GLint *, GLint *);
 
+/* array of surface ids */
 static int Surf_ID[MAX_SURFS];
 static int Next_surf = 0;
 static int SDref_surf = 0;
+/* attributes array */
 static float Default_const[MAX_ATTS];
 static float Default_nulls[MAX_ATTS];
+/* largest dimension */
 static float Longdim;
-static float Region[4];		/* N, S, W, E */
+/* N, S, W, E */
+static float Region[4];
 static geoview Gv;
 static geodisplay Gd;
 static struct Cell_head wind;
@@ -64,13 +81,17 @@
 static int Numlights = 0;
 static int Modelshowing = 0;
 
-/***********************************************************************/
 void void_func(void)
 {
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Library initialization
+
+  Get region settings - wind, Region (NSWE array)
+  Compute scale
+*/
 void GS_libinit(void)
 {
     static int first = 1;
@@ -104,14 +125,26 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get largest dimension
+
+  \param[out] dim dimension
+
+  \return 1
+*/
 int GS_get_longdim(float *dim)
 {
     *dim = Longdim;
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get 2D region extent
+
+  \param[out] n,s,w,e extent values
+
+  \return 1
+*/
 int GS_get_region(float *n, float *s, float *w, float *e)
 {
     *n = Region[0];
@@ -122,7 +155,12 @@
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set attributes to default
+
+  \param defs attributes array (dim MAX_ATTS)
+  \param null_defs null attributes array (dim MAX_ATTS)
+*/
 void GS_set_att_defaults(float *defs, float *null_defs)
 {
     int i;
@@ -141,7 +179,14 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  Check if surface exists
+
+  \param id surface id
+
+  \return 0 not found
+  \return 1 found
+*/
 int GS_surf_exists(int id)
 {
     int i, found = 0;
@@ -165,10 +210,15 @@
     return (found);
 }
 
-/***********************************************************************/
-/* note that origin has 1/2 cell added to represent center of cells
-   because library assumes that east - west = (cols - 1) * ew_res,
-   since left and right columns are on the edges.
+/*!
+  \brief Add new surface
+
+  Note that origin has 1/2 cell added to represent center of cells
+  because library assumes that east - west = (cols - 1) * ew_res,
+  since left and right columns are on the edges.
+
+  \return surface id
+  \return -1 on error (MAX_SURFS exceded)
 */
 int GS_new_surface(void)
 {
@@ -199,7 +249,12 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Add new light model
+
+  \return light model id
+  \return -1 on error (MAX_LIGHTS exceded)
+*/
 int GS_new_light(void)
 {
     static int first = 1;
@@ -232,8 +287,15 @@
     return (-1);
 }
 
-/* FIX THIS: i think lights array doesnt match sgi_light array */
-/***********************************************************************/
+/*!
+  \brief Set light position
+
+  \bug I think lights array doesnt match sgi_light array
+  
+  \param num light id (starts with 1?)
+  \param xpos,ypos,zpos coordinates
+  \param local ?
+*/
 void GS_setlight_position(int num, float xpos, float ypos, float zpos,
 			  int local)
 {
@@ -253,7 +315,13 @@
 }
 
 
-/***********************************************************************/
+/*!
+  \brief Get light position
+
+  \param num light id (starts with 1?)
+  \param[out] xpos,ypos,zpos coordinates
+  \param[out] local ?
+*/
 void GS_getlight_position(int num, float *xpos, float *ypos, float *zpos,
 			  int *local)
 {
@@ -272,11 +340,10 @@
 }
 
 /*!
-  \brief ADD
+  \brief Set light color
   
-  Red, green, blue from 0.0 to 1.0
-
-  \param ADD
+  \param num light id (starts with 1?)
+  \param red,green,blue color values (from 0.0 to 1.0)
 */
 void GS_setlight_color(int num, float red, float green, float blue)
 {
@@ -294,7 +361,12 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get light color
+
+  \param num light id (starts with 1?)
+  \param[out] red,green,blue color values
+*/
 void GS_getlight_color(int num, float *red, float *green, float *blue)
 {
     if (num) {
@@ -310,11 +382,12 @@
 }
 
 /*!
-  \brief ADD
+  \brief Set light ambient
 
   Red, green, blue from 0.0 to 1.0
 
-  \param ADD
+  \param num light id (starts with 1?)
+  \param red,green,blue color values
 */
 void GS_setlight_ambient(int num, float red, float green, float blue)
 {
@@ -332,7 +405,12 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get light ambient
+
+  \param num light id (starts with 1?)
+  \param[out] red,green,blue color values
+*/
 void GS_getlight_ambient(int num, float *red, float *green, float *blue)
 {
     if (num) {
@@ -348,7 +426,9 @@
 }
 
 
-/***********************************************************************/
+/*!
+  \brief Switch off all lights
+*/
 void GS_lights_off(void)
 {
     int i;
@@ -360,7 +440,9 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Switch on all lights
+*/
 void GS_lights_on(void)
 {
     int i;
@@ -372,7 +454,12 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Switch on/off light
+
+  \param num light id (starts with 1?)
+  \param on non-zero for 'on' otherwise 'off'
+*/
 void GS_switchlight(int num, int on)
 {
     if (num) {
@@ -386,13 +473,22 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Check if transparency is set
+
+  \return 0 transparency not set
+  \return 1 transparency is set
+*/
 int GS_transp_is_set(void)
 {
     return (gs_att_is_set(NULL, ATT_TRANSP) || (FC_GREY == gsd_getfc()));
 }
 
-/***********************************************************************/
+/*!
+  \brief Retrieves coordinates for lighting model position, at center of view
+
+  \param pos[out] coordinates
+*/
 void GS_get_modelposition1(float pos[])
 {
     /* TODO: Still needs work to handle other cases */
@@ -406,7 +502,8 @@
     gs_get_datacenter(pos);
     gs_get_data_avg_zmax(&(pos[Z]));
 
-    fprintf(stderr, "model position: %f %f %f\n", pos[X], pos[Y], pos[Z]);
+    G_debug (1, "GS_get_modelposition1(): model position: %f %f %f",
+	     pos[X], pos[Y], pos[Z]);
 
     return;
 }
@@ -418,7 +515,8 @@
   know position to calculate size, have two dependent variables
   (nearclip * 2) from eye.
 
-  \param ADD
+  \param siz[out] size
+  \param pos[out] coordinates (X, Y, Z)
 */
 void GS_get_modelposition(float *siz, float *pos)
 {
@@ -446,10 +544,16 @@
 }
 
 
-/***********************************************************************/
-/* TODO -- scale used to calculate len of arrow still needs work
- * needs go function that returns center / eye distance
- * gsd_get_los function is not working correctly ??
+/*!
+  \brief Set decoration, north arrow ??
+
+  \todo scale used to calculate len of arrow still needs work
+  needs go function that returns center / eye distance
+  gsd_get_los function is not working correctly ??
+
+  \param pt point value in true world coordinates (?)
+  \param id surface id
+  \param[out] pos2 output coordinates
 */
 void GS_set_Narrow(int *pt, int id, float *pos2)
 {
@@ -517,7 +621,7 @@
 /*!
   \brief ADD
 
-  \param id geographic object id
+  \param id surface id
   \param pt point, X, Y value in true world coordinates
 */
 void GS_draw_X(int id, float *pt)
@@ -553,7 +657,12 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw line on surface
+
+  \param id surface id
+  \param x1,y1,x2,y2 line nodes
+*/
 void GS_draw_line_onsurf(int id, float x1, float y1, float x2, float y2)
 {
     float p1[2], p2[2];
@@ -581,9 +690,17 @@
     return;
 }
 
-/***********************************************************************/
-/*  Like above but limits points in line to n or points found in segment,
- *  whichever is smaller.  Returns number of points used.
+/*!
+  \brief Draw multiline on surface
+
+  Like above but limits points in line to n or points found in segment,
+  whichever is smaller.
+
+  \param id surface id
+  \param x1,y1,x2,y2 line nodes
+  \param lasp ?
+  \paran n ?
+  \return number of points used
 */
 int GS_draw_nline_onsurf(int id, float x1, float y1, float x2, float y2,
 			 float *lasp, int n)
@@ -614,9 +731,14 @@
     return (ret);
 }
 
-/***********************************************************************/
-/* this is slow - should be moved to gs_ but GS_ good for testing
- * and useful for app programmer
+/*!
+  \brief Draw flow-line on surace
+
+  This is slow - should be moved to gs_ but GS_ good for testing
+  and useful for app programmer
+
+  \param id surface id
+  \param x,y coordinates of flow-line
 */
 void GS_draw_flowline_at_xy(int id, float x, float y)
 {
@@ -671,19 +793,21 @@
 	    p1[Y] = next[Y];
 	}
 
-#ifdef DEBUG_MSG
-	{
-	    fprintf(stderr, "dir: %f %f \n", nv[X], nv[Y]);
-	}
-#endif
+	G_debug(3, "GS_draw_flowline_at_xy(): dir: %f %f",
+		nv[X], nv[Y]);
     }
 
     return;
 }
 
-/*****************************************************************
- *  * draw fringe around data at selected corners
- *  *****************************************************************/
+/*!
+  \brief Draw fringe around data at selected corners
+
+  \param id surface id
+  \param clr ?
+  \param elev elevation value
+  \param where ?
+*/
 void GS_draw_fringe(int id, unsigned long clr, float elev, int *where)
 {
   geosurf *gs;
@@ -694,54 +818,72 @@
 }
 
 
-/***********************************************************************/
-int
-GS_draw_legend(char *name, GLuint fontbase, int size, int *flags,
+/*!
+  \brief Draw legend
+
+  \todo add legend from list option
+  make font loading more flexible
+
+  \param name legend name
+  \param fontbase font-base
+  \param size ? 
+  \param flags legend flags
+  \param range values range
+  \param pt ?
+*/
+int GS_draw_legend(char *name, GLuint fontbase, int size, int *flags,
 	       float *range, int *pt)
 {
     int list_no;
-/* TODO - add legend from list option */
-/* make font loading more flexible */
 
     list_no = gsd_put_legend(name, fontbase, size, flags, range, pt);
 
     return (list_no);
 }
 
-/*********************************************************************/
+/*!
+  \brief Draw pre-defined list
+
+  Uses glFlush() to ensure all drawing is complete
+  before returning
+
+  \param list_id list id
+*/
 void GS_draw_list(GLuint list_id)
 {
-/* Function to draw pre-defined list */
-/* Uses glFlush() to ensure all drawing is complete
- * before returning
-*/
     gsd_calllist(list_id);
     glFlush();
     return;
 }
 
-/*********************************************************************/
+/*!
+  \brief Draw all glLists
+
+  Uses glFlush() to ensure all drawing is complete
+  before returning
+*/
 void GS_draw_all_list(void)
 {
-/* Function to draw all glLists */
-/* Uses glFlush() to ensure all drawing is complete
- * before returning
-*/
-    gsd_calllists(0); /* not sure if 0 is right  - MN*/
+    gsd_calllists(0); /* not sure if 0 is right - MN */
     glFlush();
     return;
 }
 
-/*******************************************************************/
+/*!
+  \brief Delete pre-defined list
+
+  \param list_id list id
+*/
 void GS_delete_list(GLuint list_id)
 {
-    /* Function to draw pre-defined list */
     gsd_deletelist(list_id, 1);
 
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw lighting model
+*/
 void GS_draw_lighting_model1(void)
 {
     static float center[3];
@@ -776,9 +918,12 @@
     return;
 }
 
-/***********************************************************************/
-/* Just turn off any cutting planes and draw it just outside near
-clipping plane, since lighting is infinite now */
+/*!
+  \brief Draw lighting model
+
+  Just turn off any cutting planes and draw it just outside near
+  clipping plane, since lighting is infinite now
+*/
 void GS_draw_lighting_model(void)
 {
     static float center[3], size;
@@ -825,10 +970,16 @@
     return;
 }
 
-/***********************************************************************/
-/* may be called to update total mask for a surface at convenient times */
-/* instead of waiting until ready to redraw surface */
-/***********************************************************************/
+/*!
+  \brief Update current mask
+
+  May be called to update total mask for a surface at convenient times
+  instead of waiting until ready to redraw surface
+
+  \param id surface id
+
+  \return ?
+*/
 int GS_update_curmask(int id)
 {
     geosurf *gs;
@@ -837,7 +988,16 @@
     return (gs_update_curmask(gs));
 }
 
-/***********************************************************************/
+/*!
+  \brief Check if point is masked ?
+
+  \param id surface id
+  \param pt point
+
+  \return 1 masked
+  \return 0 not masked
+  \return -1 on error, invalid surface id
+*/
 int GS_is_masked(int id, float *pt)
 {
     geosurf *gs;
@@ -853,7 +1013,9 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Unset ?
+*/
 void GS_unset_SDsurf(void)
 {
     gsdiff_set_SDref(NULL);
@@ -862,7 +1024,14 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Set ?
+
+  \param id surface id
+
+  \return 1 on success
+  \return 0 on error, invalid surface id
+*/
 int GS_set_SDsurf(int id)
 {
     geosurf *gs;
@@ -877,7 +1046,13 @@
     return (0);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set ?
+  
+  \param scale scale value
+
+  \return 1
+*/
 int GS_set_SDscale(float scale)
 {
     gsdiff_set_SDscale(scale);
@@ -885,7 +1060,14 @@
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get ?
+
+  \param[out] id ?
+
+  \return 1 on success
+  \return 0 on error
+*/
 int GS_get_SDsurf(int *id)
 {
     geosurf *gs;
@@ -899,7 +1081,13 @@
     return (0);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get ?
+
+  \param[out] scale value
+
+  \return 1
+*/
 int GS_get_SDscale(float *scale)
 {
     *scale = gsdiff_get_SDscale();
@@ -907,7 +1095,13 @@
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Update normals
+
+  \param id surface id
+
+  \return ?
+*/
 int GS_update_normals(int id)
 {
     geosurf *gs;
@@ -917,7 +1111,18 @@
     return (gs_calc_normals(gs));
 }
 
-/***********************************************************************/
+/*!
+  \brief Get attributes
+
+  \param id surface id
+  \param att
+  \param[out] set
+  \param[out] constant
+  \param[out] mapname
+
+  \return 1 on success
+  \return -1 on error (invalid surface id)
+*/
 int GS_get_att(int id, int att, int *set, float *constant, char *mapname)
 {
     int src;
@@ -946,11 +1151,20 @@
 
 #define CATSREADY
 #ifdef CATSREADY
-/***********************************************************************/
-/* prints "no data" or a description (i.e., "coniferous forest") to catstr
-*  returns -1 if no category info or point outside of window, otherwise 1
-*  Usually call after GS_get_selected_point_on_surface
-*  att_src must be MAP_ATT
+/*!
+  \brief Print categories on given position
+
+  prints "no data" or a description (i.e., "coniferous forest") to catstr
+  Usually call after GS_get_selected_point_on_surface
+  att_src must be MAP_ATT
+
+  \param id surface id
+  \param att
+  \param catstr
+  \param x,y real coordinates
+
+  \return -1 if no category info or point outside of window
+  \return 1 on success
 */
 int GS_get_cat_at_xy(int id, int att, char *catstr, float x, float y)
 {
@@ -1004,10 +1218,17 @@
     return (1);
 }
 
-/***********************************************************************/
-/* gets surface normal at x,y (real coordinates)
-*  returns -1 if point outside of window or masked, otherwise 1
-*  Usually call after GS_get_selected_point_on_surface
+/*!
+  \brief Get surface normal at x,y (real coordinates)
+
+  Usually call after GS_get_selected_point_on_surface()
+
+  \param id surface id
+  \param x,y real coordinates
+  \param[out] nv surface normal
+  
+  \return -1 if point outside of window or masked
+  \return 1 on success
 */
 int GS_get_norm_at_xy(int id, float x, float y, float *nv)
 {
@@ -1058,19 +1279,22 @@
 }
 
 /*!
-  \brief Colors are translated to rgb and returned as Rxxx Gxxx Bxxx
+  \brief Get RGB color  at given point
 
   Colors are translated to rgb and returned as Rxxx Gxxx Bxxx
-  Usually call after GS_get_selected_point_on_surface
+  Usually call after GS_get_selected_point_on_surface()
   
   Prints "NULL" or the value (i.e., "921.5") to valstr
 
   Usually call after GS_get_selected_point_on_surface()
 
-  \param ADD
+  \param id surface id
+  \param att
+  \param[out] valstr value string (allocated, dim?)
+  \param x,y real coordinates
 
   \return -1 if point outside of window or masked
-  \return 1
+  \return 1 on success
 */
 int GS_get_val_at_xy(int id, int att, char *valstr, float x, float y)
 {
@@ -1147,7 +1371,14 @@
 
 #endif
 
-/***********************************************************************/
+/*!
+  \brief Unset attribute
+
+  \param id surface id
+  \param att attribute id
+
+  \return ?
+*/
 int GS_unset_att(int id, int att)
 {
     geosurf *gs;
@@ -1158,7 +1389,15 @@
     return (gs_set_att_src(gs, att, NOTSET_ATT));
 }
 
-/***********************************************************************/
+/*!
+  \brief Set attribute constant
+
+  \param id surface id
+  \param att attribute id
+  \param constant value
+
+  \return ?
+*/
 int GS_set_att_const(int id, int att, float constant)
 {
     geosurf *gs;
@@ -1172,8 +1411,17 @@
     return (ret);
 }
 
-/***********************************************************************/
-/* mask attribute special: constant is set to indicate invert or no */
+/*!
+  \brief Set mask mode
+
+  Mask attribute special: constant is set to indicate invert or no
+
+  \param id surface id
+  \param mode id
+
+  \return mode id
+  \return -1 on error (invalid surface id)
+*/
 int GS_set_maskmode(int id, int mode)
 {
     geosurf *gs;
@@ -1190,7 +1438,15 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get mask mode
+
+  \param id surface id
+  \param[out] mode id
+
+  \return 1 on success
+  \return -1 on error (invalid surface id)
+*/
 int GS_get_maskmode(int id, int *mode)
 {
     geosurf *gs;
@@ -1206,7 +1462,15 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set client data
+
+  \param id surface id
+  \param clientd ?
+
+  \return 1 on success
+  \return -1 on error (invalid surface id)
+*/
 int GS_Set_ClientData(int id, void *clientd)
 {
     geosurf *gs;
@@ -1221,7 +1485,14 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get client data
+
+  \param id surface id
+
+  \return pointer to client data
+  \return NULL on error
+*/
 void *GS_Get_ClientData(int id)
 {
     geosurf *gs;
@@ -1234,14 +1505,26 @@
     return (NULL);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get number of surfaces
+
+  \return number of surfaces
+*/
 int GS_num_surfs(void)
 {
     return (gs_num_surfaces());
 }
 
-/***********************************************************************/
-/* USER must free!! */
+/*!
+  \brief Get surface list
+  
+  Must be freed when not neeed!
+
+  \param[out] numsurf number of available surfaces
+
+  \return pointer to surface array
+  \return NULL on error
+*/
 int *GS_get_surf_list(int *numsurfs)
 {
     int i, *ret;
@@ -1249,10 +1532,7 @@
     *numsurfs = Next_surf;
 
     if (Next_surf) {
-	if (NULL == (ret = (int *) malloc(Next_surf * sizeof(int)))) {
-	    fprintf(stderr, "can't malloc\n");
-	    return (NULL);
-	}
+	ret = (int *) G_malloc(Next_surf * sizeof(int));
 
 	for (i = 0; i < Next_surf; i++) {
 	    ret[i] = Surf_ID[i];
@@ -1264,7 +1544,14 @@
     return (NULL);
 }
 
-/***********************************************************************/
+/*!
+  \brief Delete surface
+
+  \param id surface id
+
+  \return 1 on success
+  \return -1 on error
+*/
 int GS_delete_surface(int id)
 {
     int i, j, found = 0;
@@ -1299,20 +1586,17 @@
     return (-1);
 }
 
-/***********************************************************************/
-/* plans for handling color maps:
-NOW:
-    if able to load as unsigned char, make lookup table containing palette
-    otherwise, load directly as packed color, set lookup = NULL
-MAYBE LATER:
-    if able to load as POSITIVE short, make lookup table containing palette
-	- may want to calculate savings first (ie,  numcells > 32768)
-	(not exactly, it's Friday & time to go home - figure it later)
-    otherwise, load directly as packed color, set lookup = NULL
-MESSY! - need to fix up!
+
+/*!
+  \brief Load attribute map
+
+  \param id surface id
+  \param filename filename
+  \param att attribute id
+
+  \return -1 on error (invalid surface id)
+  \return ?
 */
-
-/***********************************************************************/
 int GS_load_att_map(int id, char *filename, int att)
 {
     geosurf *gs;
@@ -1329,11 +1613,7 @@
     }
 #endif
 
-#ifdef DEBUG_MSG
-    {
-	fprintf(stderr, "att_map: %s\n", filename);
-    }
-#endif
+    G_debug (3, "GS_load_att_map(): att_map: %s", filename);
 
     gs = gs_get_surf(id);
 
@@ -1357,10 +1637,9 @@
     /* Get MAPSET to ensure names are fully qualified */
     mapset = G_find_cell2(filename, "");
     if (mapset == NULL) {
-	    /* Check for valid filename */
-	    fprintf(stderr, "Error: Raster %s does not exist in current Mapset\n", filename);
-	    fprintf(stderr, "Load Failed\n");
-	    exit (-1);
+	/* Check for valid filename */
+	G_fatal_error ("Raster map <%s> not found",
+		       G_fully_qualified_name(filename, mapset));
     }
     filename = G_fully_qualified_name(filename, mapset);
 
@@ -1371,9 +1650,8 @@
 		    rast_head.east <= wind.west ||
 		    rast_head.west >= wind.east)
     {
-	    fprintf(stderr, "Error: Raster %s is outside of current region\n",filename);
-	    fprintf(stderr, "Load Failed\n");
-	    exit (-1);
+	G_fatal_error(_("Raster map <%s> is outside of current region. Load failed."),
+		      filename);
     }
 
     while (!reuse && (0 < hdata)) {
@@ -1381,12 +1659,9 @@
 	atty = ATTY_FLOAT | ATTY_CHAR | ATTY_INT | ATTY_SHORT | ATTY_MASK;
 
 	if (0 < (hdata = gsds_findh(filename, &changed, &atty, begin))) {
-#ifdef DEBUG_MSG
-	    {
-		fprintf(stderr, "%s already has data handle %d.CF=%x\n",
-			filename, hdata, changed);
-	    }
-#endif
+	    
+	    G_debug(3, "GS_load_att_map(): %s already has data handle %d.CF=%x",
+		    filename, hdata, changed);
 
 	    /* handle found */
 	    if (ATT_COLOR == att) {
@@ -1421,21 +1696,13 @@
 	}
 	/* TODO: FIX THIS stuff with lookup sharing! */
 
-#ifdef DEBUG_MSG
-	{
-	    fprintf(stderr, "%s is being reused. hdata=%d\n", filename,
-		    hdata);
-	}
-#endif
+	G_debug(3, "GS_load_att_map(): %s is being reused. hdata=%d",
+		filename, hdata);
     }
     else {
-#ifdef DEBUG_MSG
-	{
-	    fprintf(stderr, "%s not loaded in correct form - loading now\n",
-		    filename);
-	}
-#endif
-
+	G_debug(3, "GS_load_att_map(): %s not loaded in correct form - loading now",
+		filename);
+	
 	/* not loaded - need to get new dataset handle */
 	gs->att[att].hdata = gsds_newh(filename);
 
@@ -1462,15 +1729,13 @@
 	}
 
 	if (0 > gs_malloc_att_buff(gs, att, ATTY_NULL)) {
-	    Gs_status("Out of memory - Unable to load map");
-	    exit(0);
+	    G_fatal_error (_("GS_load_att_map(): Out of memory. Unable to load map"));
 	}
 
 	switch (atty) {
 	case ATTY_MASK:
 	    if (0 > gs_malloc_att_buff(gs, att, ATTY_MASK)) {
-		Gs_status("Out of memory - Unable to load map");
-		exit(0);
+		G_fatal_error (_("GS_load_att_map(): Out of memory. Unable to load map"));
 	    }
 
 	    ret = Gs_loadmap_as_bitmap(&wind, filename, tbuff->bm);
@@ -1479,8 +1744,7 @@
 	    break;
 	case ATTY_CHAR:
 	    if (0 > gs_malloc_att_buff(gs, att, ATTY_CHAR)) {
-		Gs_status("Out of memory - Unable to load map");
-		exit(0);
+		G_fatal_error (_("GS_load_att_map(): Out of memory. Unable to load map"));
 	    }
 
 	    ret = Gs_loadmap_as_char(&wind, filename, tbuff->cb,
@@ -1490,8 +1754,7 @@
 	    break;
 	case ATTY_SHORT:
 	    if (0 > gs_malloc_att_buff(gs, att, ATTY_SHORT)) {
-		Gs_status("Out of memory - Unable to load map");
-		exit(0);
+		G_fatal_error (_("GS_load_att_map(): Out of memory. Unable to load map"));
 	    }
 
 	    ret = Gs_loadmap_as_short(&wind, filename, tbuff->sb,
@@ -1501,25 +1764,20 @@
 	    break;
 	case ATTY_FLOAT:
 	    if (0 > gs_malloc_att_buff(gs, att, ATTY_FLOAT)) {
-		Gs_status("Out of memory - Unable to load map");
-		exit(0);
+		G_fatal_error (_("GS_load_att_map(): Out of memory. Unable to load map"));
 	    }
 
 	    ret = Gs_loadmap_as_float(&wind, filename, tbuff->fb,
 				      tbuff->nm, &has_null);
 	    filename = G_fully_qualified_name(filename, mapset);
-#ifdef DEBUG_MSG
-	    {
-		fprintf(stderr, "HAS-NULL = %d\n", has_null);
-	    }
-#endif
 
+	    G_debug(3, "HAS-NULL = %d", has_null);
+
 	    break;
 	case ATTY_INT:
 	default:
 	    if (0 > gs_malloc_att_buff(gs, att, ATTY_INT)) {
-		Gs_status("Out of memory - Unable to load map");
-		exit(0);
+		G_fatal_error (_("GS_load_att_map(): Out of memory. Unable to load map"));
 	    }
 
 	    ret = Gs_loadmap_as_int(&wind, filename, tbuff->ib,
@@ -1535,11 +1793,7 @@
 	    return (-1);
 	}
 
-#ifdef DEBUG_MSG
-	{
-	    fprintf(stderr, "HAS-NULL = %d\n", has_null);
-	}
-#endif
+	G_debug(3, "HAS-NULL = %d", has_null);
 
 	if (!has_null) {
 	    gsds_free_data_buff(gs->att[att].hdata, ATTY_NULL);
@@ -1576,8 +1830,7 @@
 	else if (ATTY_FLOAT == atty) {
 	    if (!reuse) {
 		if (0 > gs_malloc_att_buff(gs, att, ATTY_INT)) {
-		    Gs_status("Out of memory - Unable to load map");
-		    exit(0);
+		    G_fatal_error (_("GS_load_att_map(): Out of memory. Unable to load map"));
 		}
 
 		Gs_pack_colors_float(filename, tbuff->fb, tbuff->ib,
@@ -1607,23 +1860,24 @@
     }
 
     if (ret < 0) {
-	fprintf(stderr, "loading error\n");
+	G_warning (_("Loading failed"));
     }
 
     if (-1 == Gs_update_attrange(gs, att)) {
-	Gs_status("Error finding range");
+	G_warning(_("Error finding range"));
     }
 
-#ifdef DEBUG_MSG
-    {
-	fprintf(stderr, "Range Updated: %f %f\n", gs->zmin, gs->zmax);
-    }
-#endif
+    G_debug (3, "Range Updated: %f %f",
+	     gs->zmin, gs->zmax);
 
     return (ret);
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw surface
+
+  \param id surface id
+*/
 void GS_draw_surf(int id)
 {
     geosurf *gs;
@@ -1656,8 +1910,13 @@
     return;
 }
 
-/***********************************************************************/
-/* overrides draw_mode for fast display */
+/*!
+  \brief Draw wire
+
+  Overrides draw_mode for fast display
+
+  \param id surface id
+*/
 void GS_draw_wire(int id)
 {
     geosurf *gs;
@@ -1677,8 +1936,11 @@
     return;
 }
 
-/***********************************************************************/
-/* overrides draw_mode for fast display */
+/*!
+  \brief Draw all wires
+
+  Overrides draw_mode for fast display
+*/
 void GS_alldraw_wire(void)
 {
     geosurf *gs;
@@ -1693,7 +1955,9 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw all surfaces
+*/
 void GS_alldraw_surf(void)
 {
     int i;
@@ -1705,7 +1969,12 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Set Z exag for surface
+
+  \param id surface id
+  \param exag z-exag value
+*/
 void GS_set_exag(int id, float exag)
 {
     geosurf *gs;
@@ -1729,7 +1998,11 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Set global z-exag value
+  
+  \param exag exag value to be set up
+*/
 void GS_set_global_exag(float exag)
 {
 
@@ -1751,7 +2024,11 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get global z-exag value
+
+  \return value
+*/
 float GS_global_exag(void)
 {
 #ifdef TRACE_GS_FUNCS
@@ -1763,7 +2040,14 @@
     return (Gv.vert_exag);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set wire color
+
+  \todo error-handling
+
+  \param id surface id
+  \param colr color value
+*/
 void GS_set_wire_color(int id, int colr)
 {
     geosurf *gs;
@@ -1783,7 +2067,15 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get wire color
+
+  \param id surface id
+  \param[out] colr color value
+
+  \return 1 on success
+  \return -1 on error
+*/
 int GS_get_wire_color(int id, int *colr)
 {
     geosurf *gs;
@@ -1799,7 +2091,14 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set all draw-modes
+
+  \param mode mode id
+
+  \return 0 on success
+  \return -1 on error
+*/
 int GS_setall_drawmode(int mode)
 {
     int i;
@@ -1813,7 +2112,15 @@
     return (0);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set draw mode
+
+  \param id surface id
+  \param mode mode id
+
+  \return 0 on success
+  \return -1 on error (invalid surface id)
+*/
 int GS_set_drawmode(int id, int mode)
 {
     geosurf *gs;
@@ -1835,7 +2142,15 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get draw mode
+
+  \param id surface id
+  \param[out] mode mode id
+
+  \return 1 on success
+  \return -1 on error (invalid surface id)
+*/
 int GS_get_drawmode(int id, int *mode)
 {
     geosurf *gs;
@@ -1851,7 +2166,13 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set no-zero ?
+  
+  \param id surface id
+  \param att attribute id
+  \param mode mode id
+*/
 void GS_set_nozero(int id, int att, int mode)
 {
     geosurf *gs;
@@ -1879,7 +2200,16 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get no-zero ?
+  
+  \param id surface id
+  \param att attribute id
+  \param[out] mode mode id
+
+  \return -1 on error (invalid surface id)
+  \return 1 on success
+*/
 int GS_get_nozero(int id, int att, int *mode)
 {
     geosurf *gs;
@@ -1909,7 +2239,15 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set all draw resolutions
+
+  \param xres,yres x/y resolution value
+  \param xwire,ywire x/y wire value
+
+  \return 0 on success
+  \return -1 on error
+*/
 int GS_setall_drawres(int xres, int yres, int xwire, int ywire)
 {
     int i;
@@ -1923,7 +2261,16 @@
     return (0);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set draw resolution for surface
+
+  \param id surface id
+  \param xres,yres x/y resolution value
+  \param xwire,ywire x/y wire value
+
+  \return -1 on error
+  \return 0 on success
+*/
 int GS_set_drawres(int id, int xres, int yres, int xwire, int ywire)
 {
     geosurf *gs;
@@ -1954,7 +2301,13 @@
     return (0);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get draw resolution of surface
+
+  \param id surface id
+  \param[out] xres,yres x/y resolution value
+  \param[out] xwire,ywire x/y wire value
+*/
 void GS_get_drawres(int id, int *xres, int *yres, int *xwire, int *ywire)
 {
     geosurf *gs;
@@ -1977,7 +2330,12 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get dimension of surface
+
+  \param id surface id
+  \param[out] rows,cols number of rows/cols
+*/
 void GS_get_dims(int id, int *rows, int *cols)
 {
     geosurf *gs;
@@ -1998,10 +2356,19 @@
     return;
 }
 
-/***********************************************************************/
-/* Use no_zero range because if zero IS data, then range won't be that
-much off (it's just a GUESS, after all), but if zero is NO data, could
-drastically affect guess */
+/*!
+  \brief Get exag-value guess
+
+  Use no_zero range because if zero IS data, then range won't be that
+  much off (it's just a GUESS, after all), but if zero is NO data, could
+  drastically affect guess
+
+  \param id surface id
+  \param[out] exag exag value
+
+  \return 1 on success
+  \return -1 on error
+*/
 int GS_get_exag_guess(int id, float *exag)
 {
     geosurf *gs;
@@ -2023,32 +2390,21 @@
 	    return (1);
 	}
 
-#ifdef DEBUG_MSG
-	{
-	    fprintf(stderr, "%f %f\n", gs->zrange_nz, Longdim);
-	    G_sleep(1);
-	}
-#endif
+	G_debug (3, "GS_get_exag_guess(): %f %f",
+		 gs->zrange_nz, Longdim);
 
 	while (gs->zrange_nz * guess / Longdim >= .25) {
 	    guess *= .1;
 
-#ifdef DEBUG_MSG
-	    {
-		fprintf(stderr, "%f\n", guess);
-	    }
-#endif
-
+	    G_debug (3, "GS_get_exag_guess(): %f",
+		     guess);
 	}
 
 	while (gs->zrange_nz * guess / Longdim < .025) {
 	    guess *= 10.;
 
-#ifdef DEBUG_MSG
-	    {
-		fprintf(stderr, "%f\n", guess);
-	    }
-#endif
+	    G_debug (3, "GS_get_exag_guess(): %f",
+		     guess);
 	}
 
 	*exag = guess;
@@ -2060,9 +2416,12 @@
 }
 
 /*!
-  Get Z extents for all loaded surfaces, treating zeros as "no data"
+  Get Z extents for all loaded surfaces
 
-  \param ADD
+  Treating zeros as "no data"
+
+  \param[out] min min value
+  \param[out] max max value
 */
 void GS_get_zrange_nz(float *min, float *max)
 {
@@ -2090,7 +2449,12 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Set trans ?
+
+  \param id surface id
+  \param xtrans,ytrans,ztrans real trans coordinates
+*/
 void GS_set_trans(int id, float xtrans, float ytrans, float ztrans)
 {
     geosurf *gs;
@@ -2112,7 +2476,12 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get trans ?
+
+  \param id surface id
+  \param[out] xtrans,ytrans,ztrans real trans coordinates
+*/
 void GS_get_trans(int id, float *xtrans, float *ytrans, float *ztrans)
 {
     geosurf *gs;
@@ -2135,7 +2504,11 @@
 }
 
 
-/***********************************************************************/
+/*!
+  \brief Get default draw color
+
+  \return color value
+*/
 unsigned int GS_default_draw_color(void)
 {
 
@@ -2148,7 +2521,11 @@
     return ((unsigned int) Gd.bgcol);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get background color
+
+  \return color value
+*/
 unsigned int GS_background_color(void)
 {
     return ((unsigned int) Gd.bgcol);
@@ -2185,7 +2562,9 @@
     return;
 }
 
-/***********************************************************************/
+/*
+  \brief Ready to draw
+*/
 void GS_ready_draw(void)
 {
 
@@ -2200,7 +2579,9 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw done
+*/
 void GS_done_draw(void)
 {
 
@@ -2219,7 +2600,11 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Set focus
+
+  \param realto real coordinates to
+*/
 void GS_set_focus(float *realto)
 {
 
@@ -2236,6 +2621,11 @@
     return;
 }
 
+/*!
+  \brief Set real focus
+
+  \param realto real coordinates to
+*/
 void GS_set_focus_real(float *realto)
 {
 
@@ -2252,8 +2642,15 @@
 }
 
 
-/***********************************************************************/
-/* OK to call with NULL argument if just want to check state */
+/*!
+  \brief Get focus
+
+  OK to call with NULL argument if just want to check state
+
+  \param realto real coordinates to
+
+  \return ?
+*/
 int GS_get_focus(float *realto)
 {
 
@@ -2272,7 +2669,11 @@
     return (Gv.infocus);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set focus to map center
+
+  \param id surface id
+*/
 void GS_set_focus_center_map(int id)
 {
     float center[3];
@@ -2307,7 +2708,11 @@
     }
 }
 
-/***********************************************************************/
+/*!
+  \brief Move position to
+
+  \param pt point model coordinates
+*/
 void GS_moveto(float *pt)
 {
     float ft[3];
@@ -2338,7 +2743,11 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Move position to (real)
+
+  \param pt point real coordinates
+*/
 void GS_moveto_real(float *pt)
 {
     gsd_real2model(pt);
@@ -2348,11 +2757,15 @@
 }
 
 /*!
-  \brief Get Z extents for a single surface
+  \brief Get z-extent for a single surface
 
-  \param ADD
+  \param id surface id
+  \param[out] min min z-value
+  \param[out] max max z-value
+  \param[out] mid middle z-value ?
 
-  \return ADD
+  \return -1 on error (invalid surface id)
+  \return ?
 */
 int GS_get_zextents(int id, float *min, float *max, float *mid)
 {
@@ -2372,47 +2785,54 @@
 }
 
 /*!
-  \brief Get Z extents for all loaded surfaces
+  \brief Get z-extent for all loaded surfaces
 
-  \param ADD
+  \param[out] min min z-value
+  \param[out] max max z-value
+  \param doexag ?
 
-  \return ADD
+  \return 1 on success
+  \return -1 on error
 */
 int GS_get_zrange(float *min, float *max, int doexag)
 {
     int ret_surf, ret_vol;
-	float surf_min, surf_max;
-	float vol_min, vol_max;
-
+    float surf_min, surf_max;
+    float vol_min, vol_max;
+    
 #ifdef TRACE_GS_FUNCS
     {
 	Gs_status("GS_get_zrange");
     }
 #endif
-
-	ret_surf = gs_get_zrange(&surf_min, &surf_max);
-	ret_vol = gvl_get_zrange(&vol_min, &vol_max);
-
-	if (ret_surf > 0 && ret_vol	> 0) {
-		*min = (surf_min < vol_min) ? surf_min : vol_min;
-		*max = (surf_max < vol_max) ? surf_max : vol_max;
-	} else if (ret_surf > 0) {
-		*min = surf_min;
-		*max = surf_max;
-	} else if (ret_vol > 0) {
-		*min = vol_min;
-		*max = vol_max;
-	}
-
+    
+    ret_surf = gs_get_zrange(&surf_min, &surf_max);
+    ret_vol = gvl_get_zrange(&vol_min, &vol_max);
+    
+    if (ret_surf > 0 && ret_vol > 0) {
+	*min = (surf_min < vol_min) ? surf_min : vol_min;
+	*max = (surf_max < vol_max) ? surf_max : vol_max;
+    } else if (ret_surf > 0) {
+	*min = surf_min;
+	*max = surf_max;
+    } else if (ret_vol > 0) {
+	*min = vol_min;
+	*max = vol_max;
+    }
+    
     if (doexag) {
 	*min *= Gv.vert_exag;
 	*max *= Gv.vert_exag;
     }
-
+    
     return ((ret_surf > 0 || ret_vol > 0) ? (1) :(-1));
 }
 
-/***********************************************************************/
+/*!
+  \brief Get 'from' coordinates
+
+  \param[out] fr from model coordinates
+*/
 void GS_get_from(float *fr)
 {
 
@@ -2427,7 +2847,11 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get 'from' real coordinates
+
+  \param[out] fr 'from' real coordinates
+*/
 void GS_get_from_real(float *fr)
 {
     GS_v3eq(fr, Gv.from_to[FROM]);
@@ -2436,7 +2860,11 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get 'to' real coordinates
+
+  \param[out] to 'to' real coordinates
+*/
 void GS_get_to_real(float *to)
 {
 float realto[3];
@@ -2451,9 +2879,12 @@
 }
 
 
-/***********************************************************************/
-/* This function returns current viewport settings (tmp) and */
-/* Max viewport size (num) */
+/*!
+  \brief Get zoom setup
+  
+  \param[out] a,b,c,d current viewport settings
+  \param[out] maxx,maxy max viewport size
+*/
 void GS_zoom_setup(int *a, int *b, int *c, int *d, int *maxx, int *maxy)
 {
     GLint tmp[4];
@@ -2469,8 +2900,13 @@
     return;
 }
 
-/***********************************************************************/
-/* TODO need set_to? - just use viewdir? */
+/*!
+  \brief Get 'to' model coordinates
+
+  \todo need set_to? - just use viewdir?
+
+  \param[out] to 'to' model coordinates
+*/
 void GS_get_to(float *to)
 {
 
@@ -2485,7 +2921,11 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get viewdir
+
+  \param[out] dir viewdir value
+*/
 void GS_get_viewdir(float *dir)
 {
     GS_v3dir(Gv.from_to[FROM], Gv.from_to[TO], dir);
@@ -2493,8 +2933,13 @@
     return;
 }
 
-/***********************************************************************/
-/* Automatically turns off focus */
+/*!
+  \brief Set viewdir
+  
+  Automatically turns off focus
+
+  \param dir viewdir value
+*/
 void GS_set_viewdir(float *dir)
 {
     float tmp[3];
@@ -2510,7 +2955,11 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Set field of view
+
+  \param fov fov value
+*/
 void GS_set_fov(int fov)
 {
     Gv.fov = fov;
@@ -2519,7 +2968,7 @@
 }
 
 /*!
-  \brief ADD
+  \brief Get fied of view
 
   \return field of view, in 10ths of degrees
 */
@@ -2528,16 +2977,22 @@
     return (Gv.fov);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get twist value
+
+  10ths of degrees off twelve o'clock
+*/
 int GS_get_twist(void)
 {
     return (Gv.twist);
 }
 
 /*!
-  \brief 10ths of degrees off twelve o'clock (?)
+  \brief Set twist value
+
+  10ths of degrees off twelve o'clock
   
-  \params tenths of degrees clockwise from 12:00.
+  \params t tenths of degrees clockwise from 12:00.
 */
 void GS_set_twist(int t)
 {
@@ -2546,7 +3001,9 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Unset focus
+*/
 void GS_set_nofocus(void)
 {
 
@@ -2561,10 +3018,11 @@
     return;
 }
 
-/*******************************************************************
- * Make sure that the center of view is set
-******************************************************************/
+/*!
+  \brief Set focus
 
+  Make sure that the center of view is set
+*/
 void GS_set_infocus(void)
 {
 
@@ -2581,7 +3039,11 @@
 
 
 
-/***********************************************************************/
+/*!
+  \brief Set viewport
+
+  \param left,right,bottom,top viewport extent values
+*/
 void GS_set_viewport(int left, int right, int bottom, int top)
 {
 
@@ -2607,7 +3069,8 @@
 
   \param sx,sy screen coordinates
 
-  \return ADD
+  \return 1 on success
+  \return 0 on error (invalid surface id)
 */
 int GS_look_here(int sx, int sy)
 {
@@ -2651,7 +3114,9 @@
   view ray with surfaces and return coordinates of intersection in x, y,
   z, and identifier of surface in id.
 
-  \param ADD
+  \param sx,sy screen coordinates
+  \param[out] id surface id
+  \param[out] x,y,z point on surface (model coordinates?)
 
   \returns 0 if no intersections found
   \return number of intersections
@@ -2668,13 +3133,12 @@
     gsd_get_los(los, (short) sx, (short) sy);
 
     if (!gs_setlos_enterdata(los)) {
-	fprintf(stderr, "gs_setlos_enterdata(los) returns false\n");
-
+	G_debug (3, "gs_setlos_enterdata(los): returns false");
 	return (0);
     }
 
     for (i = 0; i < Next_surf; i++) {
-	fprintf(stderr, "id=%d  ", i);
+	G_debug (3, "id=%d", i);
 
 	gs = gs_get_surf(Surf_ID[i]);
 
@@ -2719,7 +3183,12 @@
     return (numhits);
 }
 
-/************************************************************************/
+/*!
+  \brief Set cplace rotation
+
+  \param num cplace id
+  \param dx,dy,dz rotation values
+*/
 void GS_set_cplane_rot(int num, float dx, float dy, float dz)
 {
     gsd_cplane_setrot(num, dx, dy, dz);
@@ -2727,7 +3196,12 @@
     return;
 }
 
-/************************************************************************/
+/*!
+  \brief Set cplace trans
+  
+  \param num cplace id
+  \param dx,dy,dz rotation values
+*/
 void GS_set_cplane_trans(int num, float dx, float dy, float dz)
 {
     gsd_cplane_settrans(num, dx, dy, dz);
@@ -2736,7 +3210,11 @@
 }
 
 
-/************************************************************************/
+/*!
+  \brief Draw cplace
+
+  \param num cplace id
+*/
 void GS_draw_cplane(int num)
 {
     geosurf *gsurfs[MAX_SURFS];
@@ -2755,7 +3233,15 @@
     return;
 }
 
-/************************************************************************/
+/*!
+  \brief Draw cplace fence ?
+
+  \param hs1,hs2
+  \param num cplane id
+
+  \return 0 on error
+  \return 1 on success
+*/
 int GS_draw_cplane_fence(int hs1, int hs2, int num)
 {
     geosurf *gs1, *gs2;
@@ -2773,7 +3259,9 @@
     return (1);
 }
 
-/************************************************************************/
+/*!
+  \brief Draw all cplace fences ?
+*/
 void GS_alldraw_cplane_fences(void)
 {
     int onstate[MAX_CPLANES], i;
@@ -2789,7 +3277,11 @@
     return;
 }
 
-/************************************************************************/
+/*!
+  \brief Set cplace
+
+  \param num cplane id
+*/
 void GS_set_cplane(int num)
 {
     gsd_cplane_on(num);
@@ -2797,7 +3289,11 @@
     return;
 }
 
-/************************************************************************/
+/*!
+  \brief Unset cplace
+
+  \param num cplane id
+*/
 void GS_unset_cplane(int num)
 {
     gsd_cplane_off(num);
@@ -2805,7 +3301,12 @@
     return;
 }
 
-/************************************************************************/
+/*!
+  \brief Get scale
+
+  \param sx,sy,sz x/y/z scale values
+  \param doexag ?
+*/
 void GS_get_scale(float *sx, float *sy, float *sz, int doexag)
 {
     float zexag;
@@ -2817,7 +3318,11 @@
     return;
 }
 
-/************************************************************************/
+/*!
+  \brief Set fence color
+
+  \param mode mode id
+*/
 void GS_set_fencecolor(int mode)
 {
     gsd_setfc(mode);
@@ -2825,7 +3330,11 @@
     return;
 }
 
-/************************************************************************/
+/*!
+  \brief Get fence color
+
+  \return color value
+*/
 int GS_get_fencecolor(void)
 {
     return gsd_getfc();
@@ -2834,12 +3343,13 @@
 /*!
   \brief Measure distance "as the ball rolls" between two points on surface
 
-  returns distance following terrain.
+  \param hs
+  \param x1,y1,x2,y2 distance line nodes
+  \param dist ?
+  \param use_exag use exag ?
 
-  \param  ADD
-
-  \return on error or if one or more points is not in region,
-  \return 1 on success.
+  \return 0 on error or if one or more points is not in region,
+  \return distance following terrain
 */
 int GS_get_distance_alongsurf(int hs, float x1, float y1, float x2, float y2,
 			      float *dist, int use_exag)
@@ -2861,13 +3371,27 @@
     return (gs_distance_onsurf(gs, p1, p2, dist, use_exag));
 }
 
-/************************************************************************/
+/*!
+  \brief Save 3d view
+
+  \param vname view file name
+  \param surfid surface id
+
+  \return ?
+*/
 int GS_save_3dview(char *vname, int surfid)
 {
     return (Gs_save_3dview(vname, &Gv, &Gd, &wind, gs_get_surf(surfid)));
 }
 
-/************************************************************************/
+/*!
+  \brief Load 3d view
+
+  \param vname view file name
+  \param surfid surface id
+
+  \return ?
+*/
 int GS_load_3dview(char *vname, int surfid)
 {
 
@@ -2881,7 +3405,11 @@
 * Following routines use Graphics Library
 ************************************************************************/
 
-/* TODO: allow to set center? */
+/*!
+  \brief Init view
+
+  \todo allow to set center?
+*/
 void GS_init_view(void)
 {
     static int first = 1;
@@ -2949,7 +3477,11 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Clear view
+
+  \param col color value
+*/
 void GS_clear(int col)
 {
 
@@ -2984,7 +3516,9 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get aspect value
+*/
 double GS_get_aspect(void)
 {
     int left, right, bottom, top;
@@ -3009,6 +3543,13 @@
     return ((double) (right - left) / (top - bottom));
 }
 
+/*!
+  \brief Check for transparency
+
+  Disabled.
+
+  \return 1
+*/
 int GS_has_transparency(void)
 {
     /* OGLXXX

Modified: grass/branches/develbranch_6/lib/ogsf/GSX.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/GSX.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/GSX.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,12 +1,20 @@
-/*
-* $Id$
+/*!
+  \file GSX.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL (December 1993)
 */
 
-/*  GSX.c 
-    Bill Brown, USACERL  
-    December 1993
-*/
-
 #include <grass/gstypes.h>
 
 void (*Cxl_func) ();

Modified: grass/branches/develbranch_6/lib/ogsf/GV2.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/GV2.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/GV2.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,7 +1,7 @@
 /*!
   \file GV2.c
  
-  \brief OGSF library - loading and manipulating vector sets
+  \brief OGSF library - loading and manipulating vector sets (higher level functions)
  
   GRASS OpenGL gsurf OGSF Library 
  
@@ -13,6 +13,7 @@
   for details.
   
   \author Bill Brown USACERL, GMSL/University of Illinois
+  Doxygenized by Martin Landa <landa.martin gmail.com>
 */
 
 #include <stdio.h>
@@ -29,7 +30,14 @@
 static int Vect_ID[MAX_VECTS];
 static int Next_vect = 0;
 
-/***********************************************************************/
+/*!
+  \brief Check if vector set exists
+
+  \param id vector set id
+
+  \return 0 not found
+  \return 1 found
+*/
 int GV_vect_exists(int id)
 {
     int i, found = 0;
@@ -53,7 +61,12 @@
     return (found);
 }
 
-/***********************************************************************/
+/*!
+  \brief Register new vector set
+
+  \return vector set id
+  \return -1 on error
+*/
 int GV_new_vector(void)
 {
     geovect *nv;
@@ -76,7 +89,11 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get number of available vector sets
+
+  \return number of vector sets
+*/
 int GV_num_vects(void)
 {
     return (gv_num_vects());
@@ -89,7 +106,8 @@
 
   \param numvects number of vector sets
 
-  \return ADD
+  \return pointer to list of point sets
+  \return NULL on error
 */
 int *GV_get_vect_list(int *numvects)
 {
@@ -98,23 +116,29 @@
     *numvects = Next_vect;
 
     if (Next_vect) {
-	if (NULL == (ret = (int *) malloc(Next_vect * sizeof(int)))) {
-	    fprintf(stderr, "can't malloc\n");
-
+	ret = (int *) G_malloc(Next_vect * sizeof(int));
+	if (!ret) {
 	    return (NULL);
 	}
-
+	
 	for (i = 0; i < Next_vect; i++) {
 	    ret[i] = Vect_ID[i];
 	}
-
+	
 	return (ret);
     }
 
     return (NULL);
 }
 
-/***********************************************************************/
+/*!
+  \brief Delete vector set from list
+
+  \param id vector set id
+
+  \return 1 on success
+  \return -1 on error
+*/
 int GV_delete_vector(int id)
 {
     int i, j, found = 0;
@@ -147,15 +171,25 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Load vector set
+
+  Check to see if handle already loaded, if so - free before loading
+  new for now, always load to memory
+  
+  \todo Load file handle & ready for reading instead of using
+  memory
+
+  \param id vector set id
+  \param filename filename
+
+  \return -1 on error (invalid vector set id)
+  \return 1 on success
+*/
 int GV_load_vector(int id, char *filename)
 {
     geovect *gv;
 
-    /* check to see if handle already loaded, if so - free before loading */
-    /* new for now, always load to memory */
-    /* TODO SOON: load file handle & ready for reading instead of using */
-    /* memory */
     if (NULL == (gv = gv_get_vect(id))) {
 	return (-1);
     }
@@ -175,7 +209,15 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get vector map name
+
+  \param id vector set id
+  \param filename filename
+
+  \return -1 on error (invalid vector set id)
+  \return 1 on success
+*/
 int GV_get_vectname(int id, char *filename)
 {
     geovect *gv;
@@ -189,7 +231,18 @@
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set vector set mode
+
+  \param id vector set id
+  \param mem
+  \param color color value
+  \param width
+  \param flat
+
+  \return -1 on error (invalid vector set id)
+  \return 1 on success
+*/
 int GV_set_vectmode(int id, int mem, int color, int width, int flat)
 {
     geovect *gv;
@@ -206,7 +259,18 @@
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get vector set mode
+
+  \param id vector set id
+  \param[out] mem
+  \param[out] color color value
+  \param[out] width
+  \param[out] flat
+
+  \return -1 on error (invalid vector set id)
+  \return 1 on success
+*/
 int GV_get_vectmode(int id, int *mem, int *color, int *width, int *flat)
 {
     geovect *gv;
@@ -223,7 +287,12 @@
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set trans ?
+
+  \param id vector set id
+  \param xtrans,ytrans,ztrans x/y/z trans values
+*/
 void GV_set_trans(int id, float xtrans, float ytrans, float ztrans)
 {
     geovect *gv;
@@ -245,7 +314,12 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get trans ?
+
+  \param id vector set id
+  \param[out] xtrans,ytrans,ztrans x/y/z trans values
+*/
 int GV_get_trans(int id, float *xtrans, float *ytrans, float *ztrans)
 {
     geovect *gv;
@@ -267,9 +341,11 @@
   \brief Select surface identified by hs to have vector identified
   by hv draped over it
 
-  \param ADD
+  \param hv vector set id
+  \param hs surface id
 
-  \return ADD
+  \return 1 on success
+  \return -1 on error
 */
 int GV_select_surf(int hv, int hs)
 {
@@ -291,7 +367,15 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Unselect surface
+
+  \param hv vector set id
+  \param hs surface id
+
+  \return 1 on success
+  \return -1 on error
+*/
 int GV_unselect_surf(int hv, int hs)
 {
     geovect *gv;
@@ -320,7 +404,15 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Check if surface is selected
+
+  \param hv vector set id
+  \param hs surface id
+
+  \return 1 selected
+  \return 0 not selected
+*/
 int GV_surf_is_selected(int hv, int hs)
 {
     int i;
@@ -339,7 +431,11 @@
     return (0);
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw vector set
+
+  \param vid vector set id
+*/
 void GV_draw_vect(int vid)
 {
     geosurf *gs;
@@ -361,7 +457,9 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw all vector sets
+*/
 void GV_alldraw_vect(void)
 {
     int id;
@@ -373,7 +471,11 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw vector sets
+
+  \param vid vector set id
+*/
 void GV_draw_fastvect(int vid)
 {
     geosurf *gs;
@@ -395,7 +497,15 @@
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Set client data
+
+  \param id vector set id
+  \param clientd pointer to client data
+
+  \return 1 on success
+  \return -1 on error
+*/
 int GV_Set_ClientData(int id, void *clientd)
 {
     geovect *gv;
@@ -410,7 +520,14 @@
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get client data
+
+  \param id vector set id
+
+  \return pointer to client data
+  \return NULL on error
+*/
 void *GV_Get_ClientData(int id)
 {
     geovect *gv;

Modified: grass/branches/develbranch_6/lib/ogsf/GVL2.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/GVL2.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/GVL2.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,7 +1,19 @@
-/*  GVL.c
-    Volume access routines
-    Bill Brown, UI-GMSL, May 1997
-    Tomas Paudits, Februar 2004
+/*!
+  \file GVL2.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown UI-GMSL (May 1997)
+  Tomas Paudits (February 2004)
 */
 
 #include <grass/gis.h>

Modified: grass/branches/develbranch_6/lib/ogsf/Gp3.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/Gp3.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/Gp3.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,13 +1,20 @@
-/*
-* $Id$
+/*!
+  \file Gp3.c
+ 
+  \brief OGSF library - loading and manipulating point sets
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL, GMSL/University of Illinois (January 1994)
 */
 
-/*  Gp.c 
-    Bill Brown, USACERL  
-    January 1994
-    Uses GRASS routines!
-*/
-
 #include <stdlib.h>
 #include <grass/gis.h>
 #include <grass/site.h>

Modified: grass/branches/develbranch_6/lib/ogsf/Gs3.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/Gs3.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/Gs3.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,12 +1,20 @@
-/*
-* $Id$
+/*!
+  \file Gs3.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL, GMSL/University of Illinois (January 1993)
 */
 
-/*  Gs.c 
-    Bill Brown, USACERL  
-    January 1993
-*/
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -62,14 +70,18 @@
 
 #define NO_DATA_COL 0xffffff
 
-/************************************************************************/
-/* This should be a function variable that 
- * may be replaced by a user's function. 
- * Or else use G_set_error_routine.
+/*!
+  \brief Warning handling
+
+  This should be a function variable that 
+  may be replaced by a user's function. 
+  Or else use G_set_error_routine().
+
+  \param str message
 */
 void Gs_warning(char *str)
 {
-    fprintf(stderr, "%s\n", str);
+    G_warning("%s", str);
 
     return;
 }
@@ -78,10 +90,10 @@
 /* This should be a function variable that 
  * may be replaced by a user's function. 
  * Or else use G_set_error_routine.
-*/
+ */
 void Gs_status(char *str)
 {
-    fprintf(stderr, "%s\n", str);
+    G_debug(3, "%s", str);
 
     return;
 }

Modified: grass/branches/develbranch_6/lib/ogsf/Gv3.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/Gv3.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/Gv3.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,12 +1,20 @@
-/*
-* $Id$
+/*!
+  \file Gv3.c
+ 
+  \brief OGSF library - loading and manipulating vector sets
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL (December 1993)
 */
 
-/*  Gv.c 
-    Bill Brown, USACERL  
-    December 1993
-    Uses GRASS routines!
-*/
 #include <stdlib.h>
 #include <grass/gis.h>
 #include <grass/Vect.h>

Modified: grass/branches/develbranch_6/lib/ogsf/Gvl3.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/Gvl3.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/Gvl3.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,7 +1,18 @@
-/*  GVL3.c
-    Volume access routines
-    Tomas Paudits
-    December 2003
+/*!
+  \file Gvl3.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Tomas Paudits (December 2003)
 */
 
 #include <grass/gis.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gk.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gk.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gk.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,5 +1,18 @@
-/*
-* $Id$
+/*!
+  \file gk.c
+ 
+  \brief OGSF library - setting and manipulating keyframes animation
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL, GMSL/University of Illinois
 */
 
 #include <stdlib.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gp.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gp.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gp.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,12 +1,20 @@
-/*
-* $Id$
+/*!
+  \file gp.c
+ 
+  \brief OGSF library - loading and manipulating point sets
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL, GMSL/University of Illinois (January 1994)
 */
 
-/*  gp.c
-    Bill Brown, USACERL  
-    January 1994
-*/
-
 #include <stdlib.h>
 #include <stdio.h>
 

Modified: grass/branches/develbranch_6/lib/ogsf/gpd.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gpd.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gpd.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,12 +1,20 @@
-/*
-* $Id$
+/*!
+  \file gpd.c
+ 
+  \brief OGSF library - loading and manipulating point sets
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL, GMSL/University of Illinois (December 1993)
 */
 
-/*  gpd.c
-    Bill Brown, USACERL  
-    December 1993
-*/
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gs.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gs.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gs.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,12 +1,20 @@
-/*
-* $Id$
+/*!
+  \file gs.c
+ 
+  \brief OGSF library - loading and manipulating surfaces (lower level functions)
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL, GMSL/University of Illinois (January 1993)
 */
 
-/*  gs.c
-    Bill Brown, USACERL  
-    January 1993
-*/
-
 #include <stdlib.h>
 #include <stdio.h>
 
@@ -26,7 +34,7 @@
 /***********************************************************************/
 void gs_err(char *msg)
 {
-    fprintf(stderr, "%s\n", msg);
+    G_warning ("%s", msg);
 
     return;
 }

Modified: grass/branches/develbranch_6/lib/ogsf/gs_bm.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gs_bm.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gs_bm.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,12 +1,20 @@
-/*
-* $Id$
+/*!
+  \file gs_bm.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL, GMSL/University of Illinois (September 1993)
 */
 
-/*  gs.c
-    Bill Brown, USACERL  
-    September 1993
-*/
-
 #include <grass/gstypes.h>
 #include "gsget.h"
 #include <stdio.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gs_norms.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gs_norms.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gs_norms.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
+/*!
+  \file gs_norms.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
-/*  gs_norms.c
-    Bill Brown, USACERL
-    functions for calculating normals
+  (C) 1999-2008 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 Bill Brown USACERL
 */
 
 #include <grass/gstypes.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gs_query.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gs_query.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gs_query.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
+/*!
+  \file gs_query.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
-/*  gs_query.c
-    Bill Brown, USACERL  
-    January 1994
+  (C) 1999-2008 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 Bill Brown USACERL (January 1994)
 */
 
 #include <math.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_cplane.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_cplane.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_cplane.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,12 +1,20 @@
-/*
-* $Id$
+/*!
+  \file gsd_cplane.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL, GMSL/University of Illinois (January 1993)
 */
 
-/*  gsd_cplane.c
-    Bill Brown, USACERL  
-    January 1993
-*/
-
 /* DEBUG */
 #include <stdio.h>
 

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_fonts.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_fonts.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_fonts.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,17 +1,22 @@
-/*
-****************************************************************************
-*
-* MODULE: 	GRASS ogsf library
-* AUTHOR(S):	Bill Brown, USACERL
-* PURPOSE: 	This file needs to be re-written in OpenGL
-* COPYRIGHT:    (C) 2000 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.
-*
-*****************************************************************************/
+/*!
+  \file gsd_fonts.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  \todo This file needs to be re-written in OpenGL
 
+  (C) 1999-2008 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 Bill Brown USACERL, GMSL/University of Illinois
+*/
+
 #include <string.h>
 #include <assert.h>
 #include <grass/gstypes.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_fringe.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_fringe.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_fringe.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,4 +1,21 @@
+/*!
+  \file gsd_fonts.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  \todo This file needs to be re-written in OpenGL
 
+  (C) 1999-2008 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 Bill Brown USACERL, GMSL/University of Illinois
+*/
 
 #include <stdio.h>
 

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_img_mpeg.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_img_mpeg.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_img_mpeg.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,3 +1,20 @@
+/*!
+  \file gsd_img_mpeg.c
+ 
+  \brief OGSF library - FFMPEG stuff
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL, GMSL/University of Illinois
+*/
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_img_ppm.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_img_ppm.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_img_ppm.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,13 +1,28 @@
-/* - added little/big endian test Markus Neteler
- * -modified to PPM by Bob Covill <bcovill at tekmap.ns.ca>
- *
- * $Id$ 
- *
- * changed 10/99 Jaro
- * Created new function GS_write_ppm based
- * on RGB dump 
- */
+/*!
+  \file gsd_img_ppm.c
+ 
+  \brief OGSF library - PPM stuff
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
 
+  - added little/big endian test Markus Neteler
+  - modified to PPM by Bob Covill <bcovill at tekmap.ns.ca>
+  - changed 10/99 Jaro
+  - Created new function GS_write_ppm based on RGB dump 
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois
+  Markus Neteler
+  Bob Covill
+  Jaro Hofierka
+*/
+
 #include <stdlib.h>
 #include <stdio.h>
 

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_img_tif.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_img_tif.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_img_tif.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,11 +1,27 @@
-/*
- * $Id$
- *
- * endian added Markus
- * changed 10/99 Jaro
- * Created new function GS_write_tif based
- * on RGB dump 
- */
+/*!
+  \file gsd_img_tif.c
+ 
+  \brief OGSF library - TIFF stuff
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+
+  - added little/big endian test Markus Neteler
+  - modified to PPM by Bob Covill <bcovill at tekmap.ns.ca>
+  - changed 10/99 Jaro
+  - Created new function GS_write_tif based on RGB dump 
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois
+  Markus Neteler
+  Jaro Hofierka
+*/
+
 #include <grass/config.h>
 
 #ifdef HAVE_TIFFIO_H

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_label.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_label.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_label.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,20 +1,20 @@
-/*
-* $Id$
-*
-****************************************************************************
-*
-* MODULE: 	GRASS ogsf library
-* AUTHOR(S):	Original author - Bill Brown - USA CERL 1991 - 1992
-*   	    	<new author name here>
-* PURPOSE: 	This file needs to be re-written in OpenGL
-* COPYRIGHT:    (C) 2000 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.
-*
-*****************************************************************************/
+/*!
+  \file gsd_label.c
+ 
+  \brief OGSF library - label management
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL (1991-1992)
+*/
+
 #include <grass/gstypes.h>
 #include "rgbpack.h"
 #define MAX_LIST 20

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_legend.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_legend.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_legend.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,6 +1,21 @@
-/*
- * Converted code from legend.c in SG3d
- * routines to set viewport, close viewport, and make legend
+/*!
+  \file gsd_legend.c
+ 
+  \brief OGSF library - legend creation
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  Converted code from legend.c in SG3d
+  routines to set viewport, close viewport, and make legend
+ 
+  (C) 1999-2008 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 Bill Brown USACERL
 */
 
 #include <stdlib.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_objs.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_objs.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_objs.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
+/*!
+  \file gsd_label.c
+ 
+  \brief OGSF library - objects management
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
 
-/*  gsd.c
-    Bill Brown, USACERL  
-    October 1993
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (October 1993)
 */
 
 #include <stdio.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_prim.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_prim.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_prim.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,10 +1,18 @@
-/*
-    $Id$
+/*!
+  \file gsd_prim.c
+ 
+  \brief OGSF library - primitive drawing functions
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
 
-    gsd_prim.c
-    Bill Brown, USACERL  
-    January 1993
-    Primitive drawing functions
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (January 1993)
 */
 
 /* DEBUG */

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_surf.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_surf.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_surf.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
+/*!
+  \file gsd_surf.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
-/*  gsd.c
-    Bill Brown, USACERL  
-    October 1993
+  (C) 1999-2008 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 Bill Brown USACERL (October 1993)
 */
 
 #include <stdlib.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_views.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_views.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_views.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
+/*!
+  \file gsd_views.c
+ 
+  \brief OGSF library - manipulating views
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
-/*  gsd_views.c
-    Bill Brown, USACERL  
-    January 1993
+  (C) 1999-2008 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 Bill Brown USACERL (January 1993)
 */
 
 /* DEBUG */

Modified: grass/branches/develbranch_6/lib/ogsf/gsd_wire.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_wire.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_wire.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
+/*!
+  \file gsd_wire.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
-/*  gsd.c
-    Bill Brown, USACERL  
-    January 1993
+  (C) 1999-2008 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 Bill Brown USACERL (January 1993)
 */
 
 #include <stdio.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gsdiff.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsdiff.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsdiff.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,21 +1,29 @@
-/*
-* $Id$
-*/
+/*!
+  \file gsdiff.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  Routines to set up automatic on-the-fly recalculation
+  of surface elevations, doing a "scaled difference" using another
+  surface for reference
+  
+  Note that we're using a true difference here, between data set values,
+  no translations, etc.
+  
+  \todo generalize this concept to allow transform functions which are
+  dependent on surfaces that are dependent on other surfaces, etc., as long
+  as the dependency doesn't loop back.
 
-/*  gsdiff.c
-    Bill Brown, USACERL  
-    November 1994
-routines to set up automatic on-the-fly recalculation
-of surface elevations, doing a "scaled difference" using another
-surface for reference
-
-Note that we're using a true difference here, between data set values,
-no translations, etc.
-
-TODO: generalize this concept to allow transform functions which are
-dependent on surfaces that are dependent on other surfaces, etc., as long
-as the dependency doesn't loop back.
-
+  (C) 1999-2008 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 Bill Brown USACERL, GMSL/University of Illinois (November 1994)
 */
 
 #include <stdio.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gsdrape.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsdrape.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsdrape.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,47 +1,51 @@
-/*
-* $Id$
-*/
+/*!
+  \file gsdrape.c
+ 
+  \brief OGSF library - functions to intersect line segments with edges of surface polygons
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
-/* drape.c
- * AUTHOR: Bill Brown, UI GMS Lab
- * functions to intersect line segments with edges of surface polygons 
+  For efficiency, intersections are found without respect to which
+  specific triangle edge is intersected, but on a broader sense with
+  the horizontal, vertical, and diagonal seams in the grid, then
+  the intersections are ordered.  If quadstrips are used for drawing 
+  rather than tmesh, triangulation is not consistant; for diagonal
+  intersections, the proper diagonal to intersect would need to be
+  determined according to the algorithm used by qstrip (look at nearby
+  normals). It may be faster to go ahead and find the intersections 
+  with the other diagonals using the same methods, then at sorting 
+  time determine which diagonal array to look at for each quad.  
+  It would also require a mechanism for throwing out unused intersections
+  with the diagonals during the ordering phase.
+  Do intersections in 2D, fill line structure with 3D pts (maybe calling
+  routine will cache for redrawing).  Get Z value by using linear interp 
+  between corners.
+  
+  - check for easy cases:
+   - single point
+   - colinear with horizontal or vertical edges
+   - colinear with diagonal edges of triangles
+  - calculate three arrays of ordered intersections:
+   - with vertical edges
+   - with horizontal edges
+   - with diagonal edges and interpolate Z, using simple linear interpolation.
+  - eliminate duplicate intersections (need only compare one coord for each)
+  - build ordered set of points.
+  
+  Return static pointer to 3D set of points.  Max number of intersections
+  will be rows + cols + diags, so should allocate this number to initialize.
+  Let calling routine worry about copying points for caching.
+ 
+  (C) 1999-2008 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 Bill Brown UI GMS Lab
 */
 
-/*
-For efficiency, intersections are found without respect to which
-specific triangle edge is intersected, but on a broader sense with
-the horizontal, vertical, and diagonal seams in the grid, then
-the intersections are ordered.  If quadstrips are used for drawing 
-rather than tmesh, triangulation is not consistant; for diagonal
-intersections, the proper diagonal to intersect would need to be
-determined according to the algorithm used by qstrip (look at nearby
-normals). It may be faster to go ahead and find the intersections 
-with the other diagonals using the same methods, then at sorting 
-time determine which diagonal array to look at for each quad.  
-It would also require a mechanism for throwing out unused intersections
-with the diagonals during the ordering phase.
-Do intersections in 2D, fill line structure with 3D pts (maybe calling
-routine will cache for redrawing).  Get Z value by using linear interp 
-between corners.
-
-1) check for easy cases:
-    a) single point
-    b) colinear with horizontal or vertical edges
-    c) colinear with diagonal edges of triangles
-2) calculate three arrays of ordered intersections:
-    a) with vertical edges
-    b) with horizontal edges
-    c) with diagonal edges
-   and interpolate Z, using simple linear interpolation.
-3) eliminate duplicate intersections (need only compare one coord for each)
-4) build ordered set of points.
-
-Return static pointer to 3D set of points.  Max number of intersections
-will be rows + cols + diags, so should allocate this number to initialize.
-Let calling routine worry about copying points for caching.
-
-*/
-
 #include <stdio.h>
 #include <stdlib.h>
 

Modified: grass/branches/develbranch_6/lib/ogsf/gsds.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsds.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsds.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,5 +1,55 @@
-/*
-* $Id$
+/*!
+  \file gsds.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  The idea here is to treat datasets as seperate objects, which SHOULD:
+   - allow easier reuse of data for different attributes.
+   - allow a mechanism for changing data and have changes reflected
+   in each attribute using that data.
+   - allow a mechanism to automatically update data when the data source
+   is changed.
+   - allow easier weaning from GRASS.
+   - allow easier use of shared memory between processes.
+
+  These structures are defined in gstypes.h:
+
+  <code>
+  typedef struct{
+  float *fb;
+  int *ib;
+  short *sb;
+  char *cb;
+  struct BM *bm;
+  } typbuff;
+  </code>
+
+  How about adding a transform func here, so GET_MAPATT would do an
+  on-the-fly transformation? Or even a transform func LIST!
+
+  <code>
+  typedef struct{
+  int data_id;
+  int dims[MAXDIMS];
+  int ndims;
+  int numbytes;
+  char unique_name[80];
+  typbuff databuff;
+  int changed;
+  int need_reload;
+  } dataset;
+  </code>
+
+  (C) 1999-2008 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 Bill Brown UI GMS Lab
 */
 
 #include <stdlib.h>
@@ -8,40 +58,6 @@
 
 #include <grass/gstypes.h>
 
-/*  The idea here is to treat datasets as seperate objects, which SHOULD:
- *     - allow easier reuse of data for different attributes.
- *     - allow a mechanism for changing data and have changes reflected
- *       in each attribute using that data.
- *     - allow a mechanism to automatically update data when the data source
- *       is changed.
- *     - allow easier weaning from GRASS.
- *     - allow easier use of shared memory between processes.
- * 
- * These structures are defined in gstypes.h:
- * typedef struct{
- *     float *fb;
- *     int *ib;
- *     short *sb;
- *     char *cb;
- *     struct BM *bm;
- * } typbuff;
-  How about adding a transform func here, so GET_MAPATT would do an
-  on-the-fly transformation? Or even a transform func LIST!
- * 
- * typedef struct{
- *     int data_id;
- *     int dims[MAXDIMS];
- *     int ndims;
- *     int numbytes;
- *     char unique_name[80];
- *     typbuff databuff;
- *     int changed;
- *     int need_reload;
- * } dataset;
- *
- * 
-*/
-
 /*
 #define TRACE_FUNCS
 */

Modified: grass/branches/develbranch_6/lib/ogsf/gsget.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsget.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsget.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,5 +1,18 @@
-/*
-* $Id$
+/*!
+  \file gsd_get.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  (C) 1999-2008 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 Bill Brown USACERL (January 1993)
 */
 
 #include <grass/gstypes.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gsget.h
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsget.h	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gsget.h	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,11 +1,3 @@
-/*
-* $Id$
-*/
-
-/***********
-* gsget.h
-***********/
-
 #ifndef _GSGET_H
 #define _GSGET_H
 

Modified: grass/branches/develbranch_6/lib/ogsf/gv.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gv.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gv.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,12 +1,20 @@
-/*
-* $Id$
+/*!
+  \file gv.c
+ 
+  \brief OGSF library - loading and manipulating vector sets
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL (November 1993)
 */
 
-/*  gv.c
-    Bill Brown, USACERL  
-    November 1993
-*/
-
 #include <stdio.h>
 #include <stdlib.h>
 

Modified: grass/branches/develbranch_6/lib/ogsf/gv_quick.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gv_quick.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gv_quick.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,15 +1,21 @@
-/*
-* $Id$
-*/
+/*!
+  \file gv_quick.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
-/*  gv_quick.c
-    Bill Brown, USACERL  
-    December 1993
-*/
+  Trying some stuff to draw a quick version of a vector map, to represent
+  it when doing interactive translations.
 
-/*
-Trying some stuff to draw a quick version of a vector map, to represent
-it when doing interactive translations.
+  (C) 1999-2008 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 Bill Brown, USACERL (December 1993)
 */
 
 #include <stdio.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gvd.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gvd.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gvd.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,11 +1,19 @@
-/*
-* $Id$
+/*!
+  \file gvd.c
+ 
+  \brief OGSF library - loading and manipulating vector sets
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown USACERL (December 1993)
 */
-
-/*  gvd.c
-    Bill Brown, USACERL  
-    December 1993
-*/
 	
 #include <stdio.h>
 #include <stdlib.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gvl.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gvl.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gvl.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,13 +1,21 @@
-/*
-* $Id$
+/*!
+  \file gvl.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 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 Bill Brown, UI-GMSL (May 1997)
+  Tomas Paudits (February 2004)
 */
 
-/*  gvl.c
-    volume access routines
-    Bill Brown, UI-GMSL, May 1997
-	Tomas Paudits, Februar 2004
-*/
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <grass/gstypes.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gvl_calc.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gvl_calc.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gvl_calc.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,8 +1,20 @@
-/*  gvl_isosurf_calc.c
- * Tomas Paudits
- * Februar 2004
- */
+/*!
+  \file gvl_calc.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
+  (C) 1999-2008 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 Tomas Paudits (February 2004)
+*/
+
 #include <stdio.h>
 #include <math.h>
 

Modified: grass/branches/develbranch_6/lib/ogsf/gvl_calc2.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gvl_calc2.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gvl_calc2.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,9 +1,21 @@
-/*
-Based on implementation of MarchingCubes 33 Algorithm by
-Thomas Lewiner, thomas.lewiner at polytechnique.org, Math Dept, PUC-Rio
+/*!
+  \file gvl_calc2.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
-Implementation in ogsf library
-Tomas Paudits, 2004
+  Based on implementation of MarchingCubes 33 Algorithm by
+  Thomas Lewiner, thomas.lewiner at polytechnique.org, Math Dept, PUC-Rio
+
+  (C) 1999-2008 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 Tomas Paudits, 2004
 */
 
 #include <float.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gvl_file.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gvl_file.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gvl_file.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,3 +1,18 @@
+/*!
+  \file gvl_file.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  (C) 1999-2008 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.
+*/
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>

Modified: grass/branches/develbranch_6/lib/ogsf/gvld.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gvld.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/gvld.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,8 +1,20 @@
-/*  gvld.c
- * Tomas Paudits
- * Februar 2004
- */
+/*!
+  \file gvld.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
+  (C) 1999-2008 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 Tomas Paudits (February 2004)
+*/
+
 #include <stdio.h>
 #include <math.h>
 

Modified: grass/branches/develbranch_6/lib/ogsf/mc33_table.h
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/mc33_table.h	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/mc33_table.h	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,14 +1,26 @@
-#ifndef _CELL_TABLE_H
-#define _CELL_TABLE_H
+/*!
+  \file m33_table.h
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
-/*
-LookUpTable for the MarchingCubes 33 Algorithm
-Thomas Lewiner, thomas.lewiner at polytechnique.org, Math Dept, PUC-Rio
+  LookUpTable for the MarchingCubes 33 Algorithm
+  Thomas Lewiner, thomas.lewiner at polytechnique.org, Math Dept, PUC-Rio
 
-Implementation in ogsf library
-Tomas Paudits, 2004
+  (C) 1999-2008 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 Tomas Paudits, 2004
 */
 
+#ifndef _CELL_TABLE_H
+#define _CELL_TABLE_H
+
 typedef struct
 {
     unsigned char nedges;

Modified: grass/branches/develbranch_6/lib/ogsf/rgbpack.h
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/rgbpack.h	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/rgbpack.h	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,7 +1,3 @@
-/*
-* $Id$
-*/
-
 #ifndef _RGBPACK_H
 #define _RGBPACK_H
 

Modified: grass/branches/develbranch_6/lib/ogsf/rowcol.h
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/rowcol.h	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/rowcol.h	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,7 +1,3 @@
-/*
-* $Id$
-*/
-
 #ifndef _ROWCOL_H
 #define _ROWCOL_H
 

Modified: grass/branches/develbranch_6/lib/ogsf/trans.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/trans.c	2008-05-08 13:38:52 UTC (rev 31303)
+++ grass/branches/develbranch_6/lib/ogsf/trans.c	2008-05-09 20:04:39 UTC (rev 31304)
@@ -1,35 +1,42 @@
-/* NOTE: This file should be REMOVED and any calls to the functions in this
-** file should be replaced with appropriate OpenGL calls.
-*/
+/*!
+  \file trans.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
-/*
-**  Written by Dave Gerdes Jan 1990
-**  Copyright  Dave Gerdes 1990    All rights reserved
-**  US Army Construction Engineering Research Lab
-**
-**  Further authors: Justin Hickey, Bob Covill, Brad Douglas
-**
-**  COPYRIGHT:    (C) 1999, 2006 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.
-**
-**  Matrix Transformation library.
-**  
-**   P_pushmatrix ()
-**   P_popmatrix ()
-**   P_scale ()		
-**   P_rot ()
-**   P_transform ()      transform array of vectors using current T matrix
-**      		 This routine should be available in GL!
-**
-**  Arguments are same as GL counterparts
-**
-**  I threw this code together in January at the beginning of this
-**  class.  I was still learning about GL at the time.
-**  There are many places where the code could be improved.
-**
+  NOTE: This file should be REMOVED and any calls to the functions in this
+  file should be replaced with appropriate OpenGL calls.
+
+  Matrix Transformation library.
+  
+  P_pushmatrix ()
+  
+  P_popmatrix ()
+
+  P_scale ()		
+  
+  P_rot ()
+
+  P_transform ()      transform array of vectors using current T matrix
+
+  This routine should be available in GL!
+
+  Arguments are same as GL counterparts
+  
+  I threw this code together in January at the beginning of this
+  class.  I was still learning about GL at the time.
+  There are many places where the code could be improved.
+ 
+  (C) 1999-2008 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 Dave Gerdes Jan 1990 All rights reserved, US Army Construction Engineering Research Lab
+  Bill Brown USACERL (November 1993)
 */
 
 #include <stdio.h>



More information about the grass-commit mailing list