[GRASS-SVN] r46978 - grass/trunk/lib/driver
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jul 5 06:09:39 EDT 2011
Author: martinl
Date: 2011-07-05 03:09:39 -0700 (Tue, 05 Jul 2011)
New Revision: 46978
Modified:
grass/trunk/lib/driver/driver.h
grass/trunk/lib/driver/init.c
grass/trunk/lib/driver/parse_ftcap.c
Log:
libdriver: doxygen documentation updated
variable `name` added to `driver` data structure
Modified: grass/trunk/lib/driver/driver.h
===================================================================
--- grass/trunk/lib/driver/driver.h 2011-07-05 10:07:39 UTC (rev 46977)
+++ grass/trunk/lib/driver/driver.h 2011-07-05 10:09:39 UTC (rev 46978)
@@ -21,6 +21,8 @@
struct driver
{
+ char *name;
+
void (*Box)(double, double, double, double);
void (*Erase)(void);
int (*Graph_set)(void);
Modified: grass/trunk/lib/driver/init.c
===================================================================
--- grass/trunk/lib/driver/init.c 2011-07-05 10:07:39 UTC (rev 46977)
+++ grass/trunk/lib/driver/init.c 2011-07-05 10:09:39 UTC (rev 46978)
@@ -1,17 +1,17 @@
+/*!
+ \file lib/driver/init.c
-/****************************************************************************
- *
- * MODULE: driver
- * AUTHOR(S): Glynn Clements <glynn gclements.plus.com> (original contributor)
- * Huidae Cho <grass4u gmail.com>
- * PURPOSE:
- * COPYRIGHT: (C) 2006-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.
- *
- *****************************************************************************/
+ \brief Display Driver - initialization
+
+ (C) 2006-2011 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 Glynn Clements <glynn gclements.plus.com> (original contributor)
+ \author Huidae Cho <grass4u gmail.com>
+*/
+
#include <grass/config.h>
#include <stdio.h>
@@ -39,6 +39,11 @@
double text_cosrot;
int matrix_valid;
+/*!
+ \brief Initialize display driver
+
+ \param pointer to driver structure
+*/
void LIB_init(const struct driver *drv)
{
const char *p;
@@ -47,7 +52,6 @@
ftcap = parse_fontcap();
/* initialize graphics */
-
p = getenv("GRASS_WIDTH");
screen_width = (p && atoi(p)) ? atoi(p) : DEF_WIDTH;
Modified: grass/trunk/lib/driver/parse_ftcap.c
===================================================================
--- grass/trunk/lib/driver/parse_ftcap.c 2011-07-05 10:07:39 UTC (rev 46977)
+++ grass/trunk/lib/driver/parse_ftcap.c 2011-07-05 10:09:39 UTC (rev 46978)
@@ -1,3 +1,17 @@
+/*!
+ \file lib/driver/parse_ftcap.c
+
+ \brief Display Driver - fontcaps
+
+ (C) 2006-2011 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 Glynn Clements <glynn gclements.plus.com> (original contributor)
+ \author Huidae Cho <grass4u gmail.com>
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -7,11 +21,23 @@
#include <grass/fontcap.h>
#include "driverlib.h"
+/*!
+ \brief Check if font exists
+*/
int font_exists(const char *name)
{
return access(name, R_OK) >= 0;
}
+/*!
+ \brief Parse fontcap entry
+
+ \param e pointer to GFONT_CAP struct
+ \param str ?
+
+ \return 1 on success
+ \return 0 on failure
+*/
int parse_fontcap_entry(struct GFONT_CAP *e, const char *str)
{
char name[GNAME_MAX], longname[GNAME_MAX], path[GPATH_MAX], encoding[128];
@@ -39,6 +65,11 @@
return 1;
}
+/*!
+ \brief Parse fontcaps
+
+ \return pointer to GFONT_CAP structure
+*/
struct GFONT_CAP *parse_fontcap(void)
{
char *capfile, file[GPATH_MAX];
@@ -85,6 +116,11 @@
return fonts;
}
+/*!
+ \brief Free allocated GFONT_CAP structure
+
+ \param fpcap pointer to GFONT_CAP to be freed
+*/
void free_fontcap(struct GFONT_CAP *ftcap)
{
int i;
@@ -101,4 +137,3 @@
G_free(ftcap);
}
-
More information about the grass-commit
mailing list