[GRASS-SVN] r38552 - in grass/trunk: display/d.extract
display/d.thematic.area display/d.vect display/d.zoom
general/g.region gui/wxpython/vdigit imagery/i.points include
include/vect lib/gis lib/nviz lib/sites lib/vector/Vlib
lib/vector/dglib lib/vector/diglib ps/ps.map raster/r.region
vector/lidar/lidarlib vector/lidar/v.lidar.correction
vector/lidar/v.lidar.edgedetection
vector/lidar/v.lidar.growing vector/lidar/v.outlier
vector/lidar/v.surf.bspline vector/v.clean vector/v.convert
vector/v.db.select vector/v.delaunay vector/v.distance
vector/v.edit vector/v.external vector/v.generalize
vector/v.hull vector/v.in.dxf vector/v.in.ogr vector/v.info
vector/v.kcv vector/v.kernel vector/v.label.sa
vector/v.neighbors vector/v.normal vector/v.out.dxf
vector/v.out.svg vector/v.patch vector/v.select
vector/v.support vector/v.to.3d vector/v.transform
vector/v.voronoi vector/v.what.rast visualization/nviz/src
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jul 31 07:46:59 EDT 2009
Author: martinl
Date: 2009-07-31 07:46:59 -0400 (Fri, 31 Jul 2009)
New Revision: 38552
Modified:
grass/trunk/display/d.extract/extract.c
grass/trunk/display/d.thematic.area/area.c
grass/trunk/display/d.thematic.area/main.c
grass/trunk/display/d.vect/area.c
grass/trunk/display/d.vect/main.c
grass/trunk/display/d.vect/plot1.c
grass/trunk/display/d.zoom/main.c
grass/trunk/general/g.region/main.c
grass/trunk/gui/wxpython/vdigit/driver.cpp
grass/trunk/gui/wxpython/vdigit/driver.h
grass/trunk/gui/wxpython/vdigit/driver_draw.cpp
grass/trunk/gui/wxpython/vdigit/driver_select.cpp
grass/trunk/gui/wxpython/vdigit/line.cpp
grass/trunk/imagery/i.points/driver.c
grass/trunk/include/P_site.h
grass/trunk/include/cluster.h
grass/trunk/include/proto_dbmi.h
grass/trunk/include/std_incs.h
grass/trunk/include/vect/dig_defines.h
grass/trunk/include/vect/dig_externs.h
grass/trunk/include/vect/dig_macros.h
grass/trunk/include/vect/dig_structs.h
grass/trunk/include/vector.h
grass/trunk/lib/gis/Makefile
grass/trunk/lib/gis/find_file.c
grass/trunk/lib/gis/find_vect.c
grass/trunk/lib/gis/legal_name.c
grass/trunk/lib/gis/open.c
grass/trunk/lib/gis/zero.c
grass/trunk/lib/nviz/nvizlib.dox
grass/trunk/lib/sites/sites.c
grass/trunk/lib/vector/Vlib/area.c
grass/trunk/lib/vector/Vlib/array.c
grass/trunk/lib/vector/Vlib/box.c
grass/trunk/lib/vector/Vlib/break_lines.c
grass/trunk/lib/vector/Vlib/build.c
grass/trunk/lib/vector/Vlib/build_nat.c
grass/trunk/lib/vector/Vlib/build_ogr.c
grass/trunk/lib/vector/Vlib/cindex.c
grass/trunk/lib/vector/Vlib/clean_nodes.c
grass/trunk/lib/vector/Vlib/close.c
grass/trunk/lib/vector/Vlib/close_ogr.c
grass/trunk/lib/vector/Vlib/constraint.c
grass/trunk/lib/vector/Vlib/dgraph.h
grass/trunk/lib/vector/Vlib/error.c
grass/trunk/lib/vector/Vlib/find.c
grass/trunk/lib/vector/Vlib/geos.c
grass/trunk/lib/vector/Vlib/graph.c
grass/trunk/lib/vector/Vlib/header.c
grass/trunk/lib/vector/Vlib/hist.c
grass/trunk/lib/vector/Vlib/init_head.c
grass/trunk/lib/vector/Vlib/level_two.c
grass/trunk/lib/vector/Vlib/line.c
grass/trunk/lib/vector/Vlib/map.c
grass/trunk/lib/vector/Vlib/merge_lines.c
grass/trunk/lib/vector/Vlib/open.c
grass/trunk/lib/vector/Vlib/open_nat.c
grass/trunk/lib/vector/Vlib/open_ogr.c
grass/trunk/lib/vector/Vlib/poly.c
grass/trunk/lib/vector/Vlib/read_nat.c
grass/trunk/lib/vector/Vlib/read_ogr.c
grass/trunk/lib/vector/Vlib/remove_duplicates.c
grass/trunk/lib/vector/Vlib/select.c
grass/trunk/lib/vector/Vlib/sindex.c
grass/trunk/lib/vector/Vlib/tin.c
grass/trunk/lib/vector/Vlib/write_nat.c
grass/trunk/lib/vector/dglib/graph.h
grass/trunk/lib/vector/dglib/graph_v1.h
grass/trunk/lib/vector/dglib/graph_v2.h
grass/trunk/lib/vector/diglib/box.c
grass/trunk/lib/vector/diglib/cindex.c
grass/trunk/lib/vector/diglib/cindex_rw.c
grass/trunk/lib/vector/diglib/file.c
grass/trunk/lib/vector/diglib/frmt.c
grass/trunk/lib/vector/diglib/inside.c
grass/trunk/lib/vector/diglib/plus.c
grass/trunk/lib/vector/diglib/plus_area.c
grass/trunk/lib/vector/diglib/plus_line.c
grass/trunk/lib/vector/diglib/plus_node.c
grass/trunk/lib/vector/diglib/plus_struct.c
grass/trunk/lib/vector/diglib/port_init.c
grass/trunk/lib/vector/diglib/portable.c
grass/trunk/lib/vector/diglib/spindex.c
grass/trunk/lib/vector/diglib/spindex_rw.c
grass/trunk/lib/vector/diglib/struct_alloc.c
grass/trunk/lib/vector/diglib/test.c
grass/trunk/ps/ps.map/ps_vareas.c
grass/trunk/ps/ps.map/ps_vlines.c
grass/trunk/ps/ps.map/ps_vpoints.c
grass/trunk/raster/r.region/main.c
grass/trunk/vector/lidar/lidarlib/PolimiFunct.h
grass/trunk/vector/lidar/lidarlib/raster.c
grass/trunk/vector/lidar/lidarlib/zones.c
grass/trunk/vector/lidar/v.lidar.correction/correction.c
grass/trunk/vector/lidar/v.lidar.correction/correction.h
grass/trunk/vector/lidar/v.lidar.correction/main.c
grass/trunk/vector/lidar/v.lidar.edgedetection/edgedetection.c
grass/trunk/vector/lidar/v.lidar.edgedetection/edgedetection.h
grass/trunk/vector/lidar/v.lidar.edgedetection/main.c
grass/trunk/vector/lidar/v.lidar.growing/main.c
grass/trunk/vector/lidar/v.outlier/main.c
grass/trunk/vector/lidar/v.outlier/outlier.c
grass/trunk/vector/lidar/v.outlier/outlier.h
grass/trunk/vector/lidar/v.surf.bspline/main.c
grass/trunk/vector/v.clean/prune.c
grass/trunk/vector/v.convert/read.c
grass/trunk/vector/v.db.select/main.c
grass/trunk/vector/v.delaunay/defs.h
grass/trunk/vector/v.delaunay/in_out.c
grass/trunk/vector/v.delaunay/in_out.h
grass/trunk/vector/v.delaunay/main.c
grass/trunk/vector/v.distance/main.c
grass/trunk/vector/v.edit/select.c
grass/trunk/vector/v.external/main.c
grass/trunk/vector/v.generalize/displacement.c
grass/trunk/vector/v.generalize/main.c
grass/trunk/vector/v.generalize/network.c
grass/trunk/vector/v.generalize/operators.h
grass/trunk/vector/v.hull/main.c
grass/trunk/vector/v.in.dxf/dxf_to_vect.c
grass/trunk/vector/v.in.ogr/geom.c
grass/trunk/vector/v.in.ogr/main.c
grass/trunk/vector/v.info/main.c
grass/trunk/vector/v.kcv/main.c
grass/trunk/vector/v.kernel/main.c
grass/trunk/vector/v.label.sa/labels.c
grass/trunk/vector/v.label.sa/labels.h
grass/trunk/vector/v.neighbors/main.c
grass/trunk/vector/v.normal/main.c
grass/trunk/vector/v.out.dxf/main.c
grass/trunk/vector/v.out.svg/main.c
grass/trunk/vector/v.patch/main.c
grass/trunk/vector/v.select/main.c
grass/trunk/vector/v.support/main.c
grass/trunk/vector/v.to.3d/main.c
grass/trunk/vector/v.transform/main.c
grass/trunk/vector/v.voronoi/defs.h
grass/trunk/vector/v.voronoi/sw_main.c
grass/trunk/vector/v.what.rast/main.c
grass/trunk/visualization/nviz/src/site_attr_commands.c
Log:
vectorlib:
* eliminate 'typedef struct'
* GRASS_VECT renamed to GV_
Modified: grass/trunk/display/d.extract/extract.c
===================================================================
--- grass/trunk/display/d.extract/extract.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/display/d.extract/extract.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -25,7 +25,7 @@
int screen_x, screen_y, cur_screen_x, cur_screen_y;
double x1, y1, x2, y2;
struct ilist *List, *CList;
- BOUND_BOX box;
+ struct bound_box box;
struct line_pnts *Points;
struct line_cats *Cats;
Modified: grass/trunk/display/d.thematic.area/area.c
===================================================================
--- grass/trunk/display/d.thematic.area/area.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/display/d.thematic.area/area.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -38,7 +38,7 @@
for (area = 1; area <= num; area++) {
int i;
- BOUND_BOX box;
+ struct bound_box box;
G_debug(3, "area = %d", area);
Modified: grass/trunk/display/d.thematic.area/main.c
===================================================================
--- grass/trunk/display/d.thematic.area/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/display/d.thematic.area/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -64,7 +64,7 @@
dbHandle handle;
dbCatValArray cvarr;
struct Cell_head window;
- BOUND_BOX box;
+ struct bound_box box;
double overlap, *breakpoints, *data = NULL, class_info = 0.0;
struct GASTATS stats;
FILE *fd;
Modified: grass/trunk/display/d.vect/area.c
===================================================================
--- grass/trunk/display/d.vect/area.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/display/d.vect/area.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -132,7 +132,7 @@
for (area = 1; area <= num; area++) {
int i;
- BOUND_BOX box;
+ struct bound_box box;
G_debug(3, "area = %d", area);
@@ -231,7 +231,7 @@
/* z height colors */
if (z_color_flag && Vect_is_3d(Map)) {
- BOUND_BOX box;
+ struct bound_box box;
double zval;
struct Colors colors;
Modified: grass/trunk/display/d.vect/main.c
===================================================================
--- grass/trunk/display/d.vect/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/display/d.vect/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -109,7 +109,7 @@
dbDriver *driver;
dbHandle handle;
struct Cell_head window;
- BOUND_BOX box;
+ struct bound_box box;
double overlap;
/* Initialize the GIS calls */
Modified: grass/trunk/display/d.vect/plot1.c
===================================================================
--- grass/trunk/display/d.vect/plot1.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/display/d.vect/plot1.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -323,7 +323,7 @@
/* z height colors */
if (z_color_flag && Vect_is_3d(Map)) {
- BOUND_BOX box;
+ struct bound_box box;
double zval;
struct Colors colors;
Modified: grass/trunk/display/d.zoom/main.c
===================================================================
--- grass/trunk/display/d.zoom/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/display/d.zoom/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -161,7 +161,7 @@
if (vect) {
struct Map_info Map;
- BOUND_BOX box;
+ struct bound_box box;
for (i = 0; vect[i]; i++) ;
nvects = i;
Modified: grass/trunk/general/g.region/main.c
===================================================================
--- grass/trunk/general/g.region/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/general/g.region/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -496,7 +496,7 @@
vect_ptr = parm.vect->answers;
for (; *vect_ptr != NULL; vect_ptr++) {
struct Map_info Map;
- BOUND_BOX box;
+ struct bound_box box;
char vect_name[GNAME_MAX];
struct Cell_head map_window;
Modified: grass/trunk/gui/wxpython/vdigit/driver.cpp
===================================================================
--- grass/trunk/gui/wxpython/vdigit/driver.cpp 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/gui/wxpython/vdigit/driver.cpp 2009-07-31 11:46:59 UTC (rev 38552)
@@ -498,7 +498,7 @@
std::vector<double> DisplayDriver::GetMapBoundingBox()
{
std::vector<double> region;
- BOUND_BOX bbox;
+ struct bound_box bbox;
if (!mapInfo) {
return region;
Modified: grass/trunk/gui/wxpython/vdigit/driver.h
===================================================================
--- grass/trunk/gui/wxpython/vdigit/driver.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/gui/wxpython/vdigit/driver.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -66,7 +66,7 @@
struct _region {
// GRASS region section
- BOUND_BOX box; // W,E,N,S,T,B
+ struct bound_box box; // W,E,N,S,T,B
double ns_res;
double ew_res;
double center_easting;
Modified: grass/trunk/gui/wxpython/vdigit/driver_draw.cpp
===================================================================
--- grass/trunk/gui/wxpython/vdigit/driver_draw.cpp 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/gui/wxpython/vdigit/driver_draw.cpp 2009-07-31 11:46:59 UTC (rev 38552)
@@ -32,7 +32,7 @@
return -1;
int nlines;
- BOUND_BOX mapBox;
+ struct bound_box mapBox;
struct ilist *listLines;
// ids.clear();
Modified: grass/trunk/gui/wxpython/vdigit/driver_select.cpp
===================================================================
--- grass/trunk/gui/wxpython/vdigit/driver_select.cpp 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/gui/wxpython/vdigit/driver_select.cpp 2009-07-31 11:46:59 UTC (rev 38552)
@@ -489,7 +489,7 @@
std::vector<double> region;
- BOUND_BOX region_box, line_box;
+ struct bound_box region_box, line_box;
struct ilist *list, *list_tmp;
list = list_tmp = NULL;
Modified: grass/trunk/gui/wxpython/vdigit/line.cpp
===================================================================
--- grass/trunk/gui/wxpython/vdigit/line.cpp 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/gui/wxpython/vdigit/line.cpp 2009-07-31 11:46:59 UTC (rev 38552)
@@ -962,7 +962,7 @@
{
int ret, type, nlines;
int lineBreak;
- BOUND_BOX lineBox;
+ struct bound_box lineBox;
struct ilist *list, *listBreak, *listRef;
struct line_pnts *points_check, *points;
Modified: grass/trunk/imagery/i.points/driver.c
===================================================================
--- grass/trunk/imagery/i.points/driver.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/imagery/i.points/driver.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -14,7 +14,7 @@
MENU("PLOT RASTER", plotcell, &use),
MENU("ANALYZE", analyze, &use),
INFO(" Input method -> ", &from_flag),
- OPTION("DIGITIZER", 2, &from_digitizer),
+ /* OPTION("DIGITIZER", 2, &from_digitizer), */
OPTION("KEYBOARD", 2, &from_keyboard),
OPTION("SCREEN", 2, &from_screen),
OTHER(mark, &use),
Modified: grass/trunk/include/P_site.h
===================================================================
--- grass/trunk/include/P_site.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/include/P_site.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -13,7 +13,7 @@
int G_site_s_cmp(const void *a, const void *b);
char *G_site_format(const Site * s, const char *fs, int id);
-/* SITE_ATT * G_sites_get_atts (struct Map_info * ptr, int* cat); */
+/* struct site_att * G_sites_get_atts (struct Map_info * ptr, int* cat); */
int G_sites_get_fields(struct Map_info *ptr, char ***cnames, int **ctypes,
int **ndx);
void G_sites_free_fields(int ncols, char **cnames, int *ctypes, int *ndx);
Modified: grass/trunk/include/cluster.h
===================================================================
--- grass/trunk/include/cluster.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/include/cluster.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -6,9 +6,9 @@
struct Cluster
{
- int nbands;
- int npoints;
- DCELL **points;
+ int nbands; /* number of bands */
+ int npoints; /* number of points */
+ DCELL **points; /* array of points */
int np;
double *band_sum; /* sum over each band */
@@ -24,10 +24,10 @@
double **mean; /* initial class means */
struct Signature S; /* final signature(s) */
- int nclasses;
+ int nclasses; /* number of classes */
int merge1, merge2;
- int iteration;
- double percent_stable;
+ int iteration; /* number of iterations */
+ double percent_stable; /* percentage stable */
};
/* c_assign.c */
Modified: grass/trunk/include/proto_dbmi.h
===================================================================
--- grass/trunk/include/proto_dbmi.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/include/proto_dbmi.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -53,7 +53,7 @@
int db_convert_value_to_string(dbValue * value, int sqltype,
dbString * string);
void db_copy_dbmscap_entry(dbDbmscap * dst, dbDbmscap * src);
-int db_copy_string(dbString * dst, dbString * src);
+int db_copy_string(dbString * dst, const dbString * src);
int db_table_to_sql(dbTable *, dbString *);
int db_copy_table(const char *, const char *, const char *, const char *,
const char *, const char *);
@@ -173,7 +173,7 @@
int db_get_index_number_of_columns(dbIndex * index);
const char *db_get_index_table_name(dbIndex * index);
int db_get_num_rows(dbCursor * cursor);
-char *db_get_string(dbString * x);
+char *db_get_string(const dbString * x);
dbColumn *db_get_table_column(dbTable * table, int n);
int db_get_table_delete_priv(dbTable * table);
const char *db_get_table_description(dbTable * table);
@@ -398,7 +398,7 @@
const char *db_whoami(void);
void db_zero(void *s, int n);
void db_zero_string(dbString * x);
-unsigned int db_sizeof_string(dbString * x);
+unsigned int db_sizeof_string(const dbString * x);
int db_set_login(const char *, const char *, const char *, const char *);
int db_get_login(const char *, const char *, const char **, const char **);
Modified: grass/trunk/include/std_incs.h
===================================================================
--- grass/trunk/include/std_incs.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/include/std_incs.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -16,7 +16,7 @@
#include <stdio.h>
#include <signal.h>
#include <sys/stat.h>
-#if defined(sparc) || defined (uts) || defined(SVR4) || defined(IGRAPH)
+#if defined(sparc) || defined (uts) || defined(SVR4) || defined(IdglGraph_s)
#include <dirent.h>
#else
#include <sys/dir.h>
Modified: grass/trunk/include/vect/dig_defines.h
===================================================================
--- grass/trunk/include/vect/dig_defines.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/include/vect/dig_defines.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,26 +1,58 @@
-#define GRASS_OK 0
-#define GRASS_ERR (-1)
+/*!
+ \file include/vect/dig_defines.h
+ Defines for diglib (part of vector library)
+*/
+
+/*! \brief Exit/print/return on error
+
+ \todo To be moved to gislib
+*/
#define GV_FATAL_EXIT 0
#define GV_FATAL_PRINT 1
#define GV_FATAL_RETURN 2
-#define GRASS_VECT_DIRECTORY "vector" /* name of vector directory */
-#define GRASS_VECT_FRMT_ELEMENT "frmt" /* format description, data location */
-#define GRASS_VECT_COOR_ELEMENT "coor" /* coordinates */
-#define GRASS_VECT_HEAD_ELEMENT "head" /* header information */
-#define GRASS_VECT_DBLN_ELEMENT "dbln" /* link to database */
-#define GRASS_VECT_HIST_ELEMENT "hist" /* history file */
-#define GV_TOPO_ELEMENT "topo" /* topology */
-#define GV_SIDX_ELEMENT "sidx" /* spatial index */
-#define GV_CIDX_ELEMENT "cidx" /* category index */
+/*! \brief Vector directory layout, element names */
+/*! \brief Name of vector directory */
+#define GV_DIRECTORY "vector"
+/*! \brief Format description, data location (OGR) */
+#define GV_FRMT_ELEMENT "frmt"
+/*! \brief Native format, coordinates */
+#define GV_COOR_ELEMENT "coor"
+/*! \brief Native format, header information */
+#define GV_HEAD_ELEMENT "head"
+/*! \brief Native format, link to database */
+#define GV_DBLN_ELEMENT "dbln"
+/*! \brief Native format, history file */
+#define GV_HIST_ELEMENT "hist"
+/*! \brief Native format, topology file */
+#define GV_TOPO_ELEMENT "topo"
+/*! \brief Native format, spatial index */
+#define GV_SIDX_ELEMENT "sidx"
+/*! \brief Native format, category index */
+#define GV_CIDX_ELEMENT "cidx"
+/*! \brief External format (OGR), feature index */
+#define GV_FIDX_ELEMENT "fidx"
+/*! \brief Endian check
+
+ \todo To be moved to gislib?
+*/
#define ENDIAN_LITTLE 0
#define ENDIAN_BIG 1
#define ENDIAN_OTHER 2
-/* sizes of types used in portable format (different names used in
- * Vlib/ and diglib/ for the same thing) */
+/*! \brief Sizes of types used in portable format (different names used in
+ Vlib/ and diglib/ for the same thing)
+
+ Assumptions:
+ - double = 8 byte IEEE
+ - float = 4 byte IEEE
+ - long = 4 byte int
+ - short = 2 byte int
+
+ \todo To be moved to gislib?
+*/
#define PORT_DOUBLE 8
#define PORT_FLOAT 4
#define PORT_LONG 4
@@ -29,22 +61,19 @@
#define PORT_CHAR 1
#define PORT_OFF_T 8
-/* replace by PORT_* in Vlib later and remove : */
+/*! \brief replace by PORT_* in Vlib later and remove :
+
+ \todo To be removed ?
+*/
#define DBL_SIZ 8
#define FLT_SIZ 4
#define LNG_SIZ 4
#define SHRT_SIZ 2
-/*
- ** assumptions:
- ** double = 8 byte IEEE
- ** float = 4 byte IEEE
- ** long = 4 byte int
- ** short = 2 byte int
- **
- */
+/*! \brief Limits for portable types
-/* Limits for portable types - I am not sure if OK */
+ \todo To be moved to gislib?
+*/
#define PORT_DOUBLE_MAX 1.7976931348623157e+308
#define PORT_DOUBLE_MIN 2.2250738585072014e-308
#define PORT_FLOAT_MAX 3.40282347e+38F
@@ -58,48 +87,70 @@
#define PORT_CHAR_MAX 127
#define PORT_CHAR_MIN (-128)
-/* Geometry data formats supported by lib */
-/* Don't change GV_FORMAT_* values, this order is hardcoded in lib */
-#define GV_FORMAT_NATIVE 0 /* grass native format */
-#define GV_FORMAT_OGR 1 /* OGR format */
+/*! \brief Geometry data formats supported by lib
+ Don't change GV_FORMAT_* values, this order is hardcoded in lib
+*/
+/*! \brief GRASS native format */
+#define GV_FORMAT_NATIVE 0
+/*! \brief OGR format */
+#define GV_FORMAT_OGR 1
-/* How may tables linked to map */
-#define GV_1TABLE 0 /* One table */
-#define GV_MTABLE 1 /* More, many, multi */
+/*! \brief One table linked to vector map */
+#define GV_1TABLE 0
+/*! \brief More tables linked to vector map */
+#define GV_MTABLE 1
+/*! \brief Read-only vector map open mode */
#define GV_MODE_READ 0
+/*! \brief Write vector map open mode */
#define GV_MODE_WRITE 1
+/*! \brief Read-write vector map open mode */
#define GV_MODE_RW 2
+/*! \brief Vector map open code */
#define VECT_OPEN_CODE 0x5522AA22
+/*! \brief Vector map close code */
#define VECT_CLOSED_CODE 0x22AA2255
+/*! \brief Vector level
+
+ - 1 without topology
+ - 2 topology
+ - 3 ?
+*/
#define LEVEL_1 1
#define LEVEL_2 2
#define LEVEL_3 3
-/* Topology level details */
-#define GV_BUILD_NONE 0
-#define GV_BUILD_BASE 1
-#define GV_BUILD_AREAS 2
-#define GV_BUILD_ATTACH_ISLES 3 /* Attach islands to areas */
-#define GV_BUILD_CENTROIDS 4 /* Assign centroids to areas */
-#define GV_BUILD_ALL GV_BUILD_CENTROIDS
+/*! \brief Topology level details */
+/*! \brief Nothing to build */
+#define GV_BUILD_NONE 0
+/*! \brief Basic level */
+#define GV_BUILD_BASE 1
+/*! \brief Build areas */
+#define GV_BUILD_AREAS 2
+/*! \brief Attach islands to areas */
+#define GV_BUILD_ATTACH_ISLES 3
+/*! \brief Assign centroids to areas */
+#define GV_BUILD_CENTROIDS 4
+#define GV_BUILD_ALL GV_BUILD_CENTROIDS
+/*! \brief Check if vector map is open */
#define VECT_OPEN(Map) (Map->open == VECT_OPEN_CODE)
-/* Memory mode */
+/*! \brief Memory mode */
#define GV_MEMORY_ALWAYS 1
#define GV_MEMORY_NEVER 2
#define GV_MEMORY_AUTO 3
+/*! \brief Coordinates file head size */
#define GV_COOR_HEAD_SIZE 14
#define GRASS_V_VERSION "5.0"
-/* The latest versions of files known by current version of the library. Used for new files */
+/*! \brief The latest versions of files known by current version of
+ the library. Used for new files */
#define GV_COOR_VER_MAJOR 5
#define GV_COOR_VER_MINOR 1
-
#define GV_TOPO_VER_MAJOR 5
#define GV_TOPO_VER_MINOR 0
#define GV_SIDX_VER_MAJOR 5
@@ -107,10 +158,10 @@
#define GV_CIDX_VER_MAJOR 5
#define GV_CIDX_VER_MINOR 0
-/* The oldest versions of the library, which are capable to read the files created by the current version */
+/*! \brief The oldest versions of the library, which are capable to
+ read the files created by the current version */
#define GV_COOR_EARLIEST_MAJOR 5
#define GV_COOR_EARLIEST_MINOR 1
-
#define GV_TOPO_EARLIEST_MAJOR 5
#define GV_TOPO_EARLIEST_MINOR 0
#define GV_SIDX_EARLIEST_MAJOR 5
@@ -118,25 +169,19 @@
#define GV_CIDX_EARLIEST_MAJOR 5
#define GV_CIDX_EARLIEST_MINOR 0
+/*! \brief 2D/3D vector data */
#define WITHOUT_Z 0
#define WITH_Z 1
-#define DIGITIZER 0
-#define MOUSE 1
-
-#define ON 1
-#define OFF 0
-
-/* note this is changed from 3.0 which had 0.04 -dpg */
-#define THRESH_FUDGE 0.03
-
+/*! \brief Side indicator left/right */
#define GV_LEFT 1
#define GV_RIGHT 2
-#define GV_FORWARD 1
+/*! \brief Direction indicator forward/backward */
+#define GV_FORWARD 1
#define GV_BACKWARD 2
-/* types used in memory on run time - may change */
+/*! \brief Types used in memory on run time (may change) */
#define GV_POINT 0x01
#define GV_LINE 0x02
#define GV_BOUNDARY 0x04
@@ -149,7 +194,7 @@
#define GV_POINTS (GV_POINT | GV_CENTROID )
#define GV_LINES (GV_LINE | GV_BOUNDARY )
-/* types used in store like 'coor' file or postgis type column - must not change */
+/*! \types Used in store like 'coor' file or postgis type column (must not change) */
#define GV_STORE_POINT 1
#define GV_STORE_LINE 2
#define GV_STORE_BOUNDARY 3
@@ -159,7 +204,7 @@
#define GV_STORE_AREA 7 /* used in category index file */
#define GV_STORE_VOLUME 8 /* used in category index file */
-/* Overlay operators */
+/*! \brief Overlay operators */
#define GV_ON_AND "AND" /* intersect */
#define GV_ON_OVERLAP "OVERLAP"
@@ -171,36 +216,11 @@
typedef enum overlay_operator OVERLAY_OPERATOR;
-#define ESC 033
+/*! \brief Maximum number of categories for one element */
+#define GV_NCATS_MAX PORT_INT_MAX
+/*! \brief Maximum field */
+#define GV_FIELD_MAX PORT_INT_MAX
+/*! \brief Maximum category value */
+#define GV_CAT_MAX PORT_INT_MAX
-#ifdef FOO
-/* these have all turned into global ints. in digit/globals.h */
-/* colors of unique items on screen */
-#define CLR_LINE BLUE
-#define CLR_AREA GREY
-#define CLR_DOT GREEN
-#define CLR_SITE GREEN
-
-#define CLR_LLINE MAGENTA
-#define CLR_LSITE AQUA
-#define CLR_LAREA ORANGE
-
-#define CLR_AMARK AQUA
-#define CLR_ALABEL ORANGE
-#define CLR_LLABEL MAGENTA
-
-#define CLR_HIGHLIGHT YELLOW
-#define CLR_ERASE BLACK
-#define CLR_UNKNOWN WHITE
-#define CLR_OVERLAY WHITE
-
-#define CLR_0_NODE GREEN
-#define CLR_1_NODE ORANGE
-#define CLR_2_NODE RED
-#endif
-
-#define GV_NCATS_MAX PORT_INT_MAX /* maximum number of categories for one element */
-#define GV_FIELD_MAX PORT_INT_MAX /* maximum field */
-#define GV_CAT_MAX PORT_INT_MAX /* maximum category value */
-
-#define BUILD_PROG "v.build"
+#define HEADSTR 50
Modified: grass/trunk/include/vect/dig_externs.h
===================================================================
--- grass/trunk/include/vect/dig_externs.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/include/vect/dig_externs.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,3 +1,9 @@
+/*!
+ \file include/vect/dig_externs.h
+
+ \brief Function prototypes for diglib (part of vector library)
+*/
+
void *dig_alloc_space(int, int *, int, void *, int); /* exits on error, calls _alloc_space () */
void *dig__alloc_space(int, int *, int, void *, int); /* returns NULL on error, calls calloc(), _frealloc() */
void *dig_falloc(int, int); /* exits on error, calls _falloc () */
Modified: grass/trunk/include/vect/dig_macros.h
===================================================================
--- grass/trunk/include/vect/dig_macros.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/include/vect/dig_macros.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,14 +1,8 @@
-/* convert UTM to screen */
-#define XADJ(x) (int)((x - U_west ) * U_to_D_xconv + D_west)
-#define YADJ(y) (int)((y - U_south) * U_to_D_yconv + D_south)
+/*!
+ \file include/vect/dig_macros.h
-#define _TOGGLE(x) ((x) ? 0 : 1)
-#define TOGGLE(x) ((x) = _TOGGLE (x))
-#define BEEP putchar ('\007')
-#define ON_OFF(x) ((x) ? " ON" : " OFF")
-/*
- #define ABS(x) ((x) < 0 ? -(x) : (x))
- */
+ \brief Macros for diglib (part of vector library
+*/
/* ALIVE MACROS take a pointer the the structure in question */
/* and return 0 or non-zero */
@@ -22,7 +16,3 @@
#define LESSER(x,y) ((x) < (y) ? (x) : (y))
#define GREATER(x,y) ((x) > (y) ? (x) : (y))
-
-
-/* temporary till 3.0 */
-/*#define R_standard_color(x) R_color (x) */
Modified: grass/trunk/include/vect/dig_structs.h
===================================================================
--- grass/trunk/include/vect/dig_structs.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/include/vect/dig_structs.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,13 +1,17 @@
-/*
- ** Written by Dave Gerdes 5/1988
- ** US Army Construction Engineering Research Lab
- */
+/*!
+ \file include/vect/dig_structs.h
+
+ \brief Structures for diglib (vector library)
+
+ \author Written by Dave Gerdes (CERL) 5/1988
+ \author Updated to GRASS 5.7 by Radim Blazek (2001)
+*/
#include <grass/config.h>
#ifndef DIG___STRUCTS___
#define DIG___STRUCTS___
-/* this file depends on <stdio.h> */
+/* this file depends on <stdio.h> */
#ifndef _STDIO_H
#include <stdio.h>
#endif
@@ -19,32 +23,20 @@
#include <grass/btree.h>
#include <grass/rtree.h>
-
#ifdef HAVE_OGR
#include "ogr_api.h"
#endif
-#define HEADSTR 50
+/*! \brief plus_t size
-/*
- ** NOTE: 3.10 changes plus_t to ints.
- ** This assumes that any reasonable machine will use 4 bytes to
- ** store an int. The mapdev code is not guaranteed to work if
- ** plus_t is changed to a type that is larger than an int.
- */
-/*
- typedef short plus_t;
- */
+ 3.10 changes plus_t to ints.
+ This assumes that any reasonable machine will use 4 bytes to
+ store an int. The mapdev code is not guaranteed to work if
+ plus_t is changed to a type that is larger than an int.
+*/
typedef int plus_t;
-typedef struct bound_box BOUND_BOX;
-
-typedef struct P_node P_NODE;
-typedef struct P_area P_AREA;
-typedef struct P_line P_LINE;
-typedef struct P_isle P_ISLE;
-
-/* Used by sites lib */
+/*! \brief Used by sites lib */
struct site_att
{
int cat; /* category */
@@ -52,9 +44,8 @@
char **str; /* string attributes */
};
-typedef struct site_att SITE_ATT;
-
-struct bound_box /* Bounding Box */
+/*! \brief Bounding box */
+struct bound_box
{
double N; /* north */
double S; /* south */
@@ -64,43 +55,42 @@
double B; /* bottom */
};
+/*! \brief File definition */
struct gvfile
{
FILE *file;
char *start; /* pointer to beginnig of the file in the memory */
- char *current; /* current position set by dig_seek */
+ char *current; /* current position set by dig_seek() */
char *end; /* end of file in the memory (pointer to first byte after) */
off_t size; /* size of the file loaded to memory */
off_t alloc; /* allocated space */
int loaded; /* 0 - not loaded, 1 - loaded */
};
-typedef struct gvfile GVFILE;
-
-/* category field information */
+/*! \brief Field information */
struct field_info
{
int number; /* field number */
char *name; /* field name */
- char *driver;
- char *database;
- char *table;
- char *key;
+ char *driver; /* db driver */
+ char *database; /* db database */
+ char *table; /* db table */
+ char *key; /* table key */
};
+/*! \brief Database links */
struct dblinks
{
- struct field_info *field;
- int alloc_fields, n_fields;
+ struct field_info *field; /* pointer to the first field_info structure */
+ int alloc_fields; /* number of allocated slots */
+ int n_fields; /* number of available fields */
};
-/* Portability info */
+/*! \brief Portability info - set in V1_open_new/old() */
struct Port_info
{
- /* portability stuff, set in V1_open_new/old() */
- /* file byte order */
- int byte_order;
- int off_t_size;
+ int byte_order; /* file byte order */
+ int off_t_size; /* off_t size */
/* conversion matrices between file and native byte order */
unsigned char dbl_cnvrt[PORT_DOUBLE];
@@ -110,9 +100,8 @@
unsigned char shrt_cnvrt[PORT_SHORT];
unsigned char off_t_cnvrt[PORT_OFF_T];
- /* *_quick specify if native byte order of that type
- * is the same as byte order of vector file (TRUE)
- * or not (FALSE);*/
+ /* *_quick specify if native byte order of that type is the same
+ as byte order of vector file (TRUE) or not (FALSE) */
int dbl_quick;
int flt_quick;
int lng_quick;
@@ -121,68 +110,70 @@
int off_t_quick;
};
-/* List of dead lines in the file, the space can be reused, not yet used */
+/*! \brief List of dead lines in the file, the space can be reused,
+ not yet used
+
+ \todo Implement it
+*/
struct recycle
{
- /* TODO */
char dummy;
};
+/*! \brief Vector map head */
struct dig_head
{
+ /* elements */
+ char *organization; /* orgranization name */
+ char *date; /* map date */
+ char *your_name; /* user name */
+ char *map_name; /* map name */
+ char *source_date; /* source date */
+ long orig_scale; /* original scale */
+ char *line_3; /* comments */
+ int plani_zone; /* zone */
+ double digit_thresh; /* threshold for digitization */
- /*** HEAD_ELEMENT ***/
- char *organization;
- char *date;
- char *your_name;
- char *map_name;
- char *source_date;
- long orig_scale;
- char *line_3;
- int plani_zone;
- /* double W, E, S, N; */
- double digit_thresh;
- /* double map_thresh; *//* not used in g57 */
-
/* Programmers should NOT touch any thing below here */
/* Library takes care of everything for you */
- /*** COOR_ELEMENT ***/
- int Version_Major;
+ /* coor elements */
+ int Version_Major; /* backward compatibility info */
int Version_Minor;
int Back_Major;
int Back_Minor;
- int with_z;
+ int with_z; /* 2D/3D vector data */
off_t size; /* coor file size */
long head_size; /* coor header size */
- struct Port_info port; /* Portability information */
+ struct Port_info port; /* portability information */
off_t last_offset; /* offset of last read line */
- struct recycle *recycle;
+ struct recycle *recycle; /* recycle dead line, not implemented yet */
- struct Map_info *Map; /* X-ref to Map_info struct ?? */
+ struct Map_info *Map; /* X-ref to Map_info struct (needed?) */
};
-/* Coor info */
+/*! \brief Coor file info */
struct Coor_info
{
off_t size; /* total size, in bytes */
long mtime; /* time of last modification */
};
-/* Non-native format inforamtion */
-/* TODO: structure size should not change depending on compilation I think, do it better */
-/* OGR */
+/*! \brief Non-native format info (OGR)
+
+ \todo Structure size should not change depending on compilation I think, do it better
+*/
struct Format_info_ogr
{
- char *dsn;
- char *layer_name;
+ char *dsn; /* OGR datasource name */
+ char *layer_name; /* OGR layer name */
#ifdef HAVE_OGR
- OGRDataSourceH ds;
- OGRLayerH layer;
+ OGRDataSourceH ds; /* pointer to OGRDataSourceH */
+ OGRLayerH layer; /* pointer to OGRLayerH */
#else
void *ds;
void *layer;
@@ -190,8 +181,8 @@
/* Level 1 (used by V*_read_next_line_ogr) */
struct line_pnts **lines; /* points cache */
- int *lines_types;
- int lines_alloc;
+ int *lines_types; /* list of line types */
+ int lines_alloc; /* number of allocated lines */
int lines_num; /* number of lines in cache */
int lines_next; /* next line to be read from cache */
@@ -203,139 +194,155 @@
#endif
int feature_cache_id; /* id of feature read in feature_cache */
- /* Array where OGR feature/part info is stored for each line in GRASS.
- * This is not used for GV_CENTROID.
- * Because one feature may contain more elements (geometry collection also recursively),
- * offset for one line may be stored in more records.
- * First record is FID, next records are part indexes if necessary.
- * Example:
- * 5. ring in 3. polygon in 7. feature (multipolygon) of geometry collection which has FID = 123
- * 123 (feature 123: geometry colletion)
- * 6 (7. feature in geometry collection: multiPolygon)
- * 2 (3. polygon)
- * 4 (5. ring in the polygon)
+ /* Array where OGR feature/part info is stored for each line in
+ * GRASS. This is not used for GV_CENTROID. Because one feature
+ * may contain more elements (geometry collection also
+ * recursively), offset for one line may be stored in more
+ * records. First record is FID, next records are part indexes if
+ * necessary. Example: 5. ring in 3. polygon in 7. feature
+ * (multipolygon) of geometry collection which has FID = 123 123
+ * (feature 123: geometry colletion) 6 (7. feature in geometry
+ * collection: multiPolygon) 2 (3. polygon) 4 (5. ring in the
+ * polygon)
*/
- int *offset;
+ int *offset; /* offset list */
int offset_num; /* number of items in offset */
int offset_alloc; /* space allocated for offset */
int next_line; /* used by V2_read_next_line_ogr */
};
+/*! \brief Non-native format info */
struct Format_info
{
- int i;
- struct Format_info_ogr ogr;
+ int i; /* id? */
+ struct Format_info_ogr ogr; /* OGR info */
};
-/* Category index */
+/*! \brief Category index */
struct Cat_index
{
int field; /* field number */
int n_cats; /* number of items in cat array */
int a_cats; /* allocated space in cat array */
- int (*cat)[3]; /* array of cats (cat,type, lines/area) */
+ int (*cat)[3]; /* array of cats (cat, type, lines/area) */
int n_ucats; /* number of unique cats (not updated) */
int n_types; /* number of types in type */
- int type[7][2]; /* number of elements for each type (point, line, boundary, centroid, area, face, kernel) */
- off_t offset; /* offset of the beginning of this index in cidx file */
+ int type[7][2]; /* number of elements for each type
+ * (point, line, boundary, centroid,
+ * area, face, kernel) */
+ off_t offset; /* offset of the beginning of this
+ * index in cidx file */
};
+/*! \brief Plus head info */
struct Plus_head
{
- int Version_Major; /* version codes */
+ /*** version info ***/
+ int Version_Major; /* version codes */
int Version_Minor;
- int Back_Major; /* earliest version that can use this data format */
+ int Back_Major; /* earliest version that can use this data format */
int Back_Minor;
- int spidx_Version_Major; /* version codes for spatial index */
+ int spidx_Version_Major; /* version codes for spatial index */
int spidx_Version_Minor;
- int spidx_Back_Major; /* earliest version that can use this data format */
+ int spidx_Back_Major; /* earliest version that can use this data format */
int spidx_Back_Minor;
- int cidx_Version_Major; /* version codes for category index */
+ int cidx_Version_Major; /* version codes for category index */
int cidx_Version_Minor;
- int cidx_Back_Major; /* earliest version that can use this data format */
+ int cidx_Back_Major; /* earliest version that can use this data format */
int cidx_Back_Minor;
- int with_z;
- int spidx_with_z;
+ int with_z; /* 2D/3D vector data */
+ int spidx_with_z; /* 2D/3D spatial index */
- int off_t_size; /* offset size here because Plus_head is available to all releveant functions */
+ int off_t_size; /* offset size here because Plus_head
+ is available to all releveant
+ functions */
- long head_size; /* topo header size */
- long spidx_head_size; /* spatial index header size */
- long cidx_head_size; /* category index header size */
+ /*** file header size ***/
+ long head_size; /* topo header size */
+ long spidx_head_size; /* spatial index header size */
+ long cidx_head_size; /* category index header size */
- int release_support; /* release memory occupied by support (topo, spatial, category) */
+ int release_support; /* release memory occupied by support
+ (topo, spatial, category) */
- struct Port_info port; /* Portability information */
- struct Port_info spidx_port; /* Portability information for spatial index */
- struct Port_info cidx_port; /* Portability information for category index */
- int mode; /* Read, Write, RW */
+ /*** portability info */
+ struct Port_info port; /* portability information */
+ struct Port_info spidx_port; /* portability information for
+ spatial index */
+ struct Port_info cidx_port; /* portability information for
+ category index */
+ int mode; /* read, write, RW */
- int built; /* the highest level of topology currently available (GV_BUILD_*) */
+ int built; /* the highest level of topology
+ currently available
+ (GV_BUILD_*) */
- struct bound_box box; /* box */
+ struct bound_box box; /* vector map bounding box */
- P_NODE **Node; /* P_NODE array of pointers *//* 1st item is 1 for */
- P_LINE **Line; /* P_LINE array of pointers *//* all these (not 0) */
- P_AREA **Area;
- P_ISLE **Isle;
- /* add here P_FACE, P_VOLUME, P_HOLE */
+ /*** topology ***/
+ struct P_node **Node; /* struct P_node array of pointers
+ 1st item is 1 for */
+ struct P_line **Line; /* struct P_line array of pointers
+ all these (not 0) */
+ struct P_area **Area;
+ struct P_isle **Isle;
+ /* add here P_FACE, P_VOLUME, P_HOLE */
- plus_t n_nodes; /* current Number of nodes */
- plus_t n_edges; /* current Number of edges */
- plus_t n_lines; /* current Number of lines */
- plus_t n_areas; /* current Number of areas */
- plus_t n_isles; /* current Number of isles */
- plus_t n_faces; /* current Number of faces */
- plus_t n_volumes; /* current Number of volumes */
- plus_t n_holes; /* current Number of holes */
+ plus_t n_nodes; /* current number of nodes */
+ plus_t n_edges; /* current number of edges */
+ plus_t n_lines; /* current number of lines */
+ plus_t n_areas; /* current number of areas */
+ plus_t n_isles; /* current number of isles */
+ plus_t n_faces; /* current number of faces */
+ plus_t n_volumes; /* current number of volumes */
+ plus_t n_holes; /* current number of holes */
- plus_t n_plines; /* Current Number of point lines */
- plus_t n_llines; /* Current Number of line lines */
- plus_t n_blines; /* Current Number of boundary lines */
- plus_t n_clines; /* Current Number of centroid lines */
- plus_t n_flines; /* Current Number of face lines */
- plus_t n_klines; /* Current Number of kernel lines */
- plus_t n_vfaces; /* Current Number of volume faces */
- plus_t n_hfaces; /* Current Number of hole faces */
+ plus_t n_plines; /* current number of points */
+ plus_t n_llines; /* current number of lines */
+ plus_t n_blines; /* current number of boundaries */
+ plus_t n_clines; /* current number of centroids */
+ plus_t n_flines; /* current number of faces */
+ plus_t n_klines; /* current number of kernels*/
+ plus_t n_vfaces; /* current number of volumes */
+ plus_t n_hfaces; /* current number of hole faces */
- plus_t alloc_nodes; /* # of nodes we have alloc'ed space for
- i.e. array size - 1 */
- plus_t alloc_edges;
- plus_t alloc_lines; /* # of lines we have alloc'ed space for */
- plus_t alloc_areas; /* # of areas we have alloc'ed space for */
- plus_t alloc_isles; /* # of isles we have alloc'ed space for */
- plus_t alloc_faces; /* # of faces we have alloc'ed space for */
- plus_t alloc_volumes; /* # of volumes we have alloc'ed space for */
- plus_t alloc_holes; /* # of holes we have alloc'ed space for */
+ plus_t alloc_nodes; /* number of nodes we have alloc'ed
+ space for i.e. array size - 1 */
+ plus_t alloc_edges; /* number of edges we have alloc'ed space for */
+ plus_t alloc_lines; /* number of lines we have alloc'ed space for */
+ plus_t alloc_areas; /* number of areas we have alloc'ed space for */
+ plus_t alloc_isles; /* number of isles we have alloc'ed space for */
+ plus_t alloc_faces; /* number of faces we have alloc'ed space for */
+ plus_t alloc_volumes; /* number of volumes we have alloc'ed space for */
+ plus_t alloc_holes; /* number of holes we have alloc'ed space for */
- off_t Node_offset; /* offset of array of nodes in topo file */
- off_t Edge_offset;
- off_t Line_offset;
- off_t Area_offset;
- off_t Isle_offset;
- off_t Volume_offset;
- off_t Hole_offset;
+ off_t Node_offset; /* offset of array of nodes in topo file */
+ off_t Edge_offset; /* offset of array of edges in topo file */
+ off_t Line_offset; /* offset of array of lines in topo file */
+ off_t Area_offset; /* offset of array of areas in topo file */
+ off_t Isle_offset; /* offset of array of isles in topo file */
+ off_t Volume_offset; /* offset of array of volumes in topo file */
+ off_t Hole_offset; /* offset of array of holes in topo file */
- /* Spatial index is always saved */
+ /*** spatial index ***/
+ int Spidx_built; /* set to 1 if spatial index is available */
+ int Spidx_new; /* set to 1 if new spatial index will be generated */
- int Spidx_built; /* set to 1 if spatial index is available */
- int Spidx_new; /* set to 1 if new spatial index will be generated */
-
- GVFILE spidx_fp; /* spatial index file pointer */
+ struct gvfile spidx_fp; /* spatial index file pointer */
- char *spidx_node_fname; /* node spatial index file name */
+ char *spidx_node_fname; /* node spatial index file name */
- off_t Node_spidx_offset; /* offset of spatial index in sidx file */
- off_t Line_spidx_offset;
- off_t Area_spidx_offset;
- off_t Isle_spidx_offset;
- off_t Face_spidx_offset;
- off_t Volume_spidx_offset;
- off_t Hole_spidx_offset;
+ off_t Node_spidx_offset; /* offset of nodes in sidx file */
+ off_t Line_spidx_offset; /* offset of lines in sidx file */
+ off_t Area_spidx_offset; /* offset of areas in sidx file */
+ off_t Isle_spidx_offset; /* offset of isles in sidx file */
+ off_t Face_spidx_offset; /* offset of faces in sidx file */
+ off_t Volume_spidx_offset; /* offset of volumes in sidx file */
+ off_t Hole_spidx_offset; /* offset of holes in sidx file */
struct RTree *Node_spidx; /* node spatial index */
struct RTree *Line_spidx; /* line spatial index */
@@ -345,70 +352,75 @@
struct RTree *Volume_spidx; /* volume spatial index */
struct RTree *Hole_spidx; /* hole spatial index */
- /* Category index */
+ /*** category index ***/
/* By default, category index is not updated */
- int update_cidx; /* update category index if vector is modified */
+ int update_cidx; /* update category index if vector is modified */
- int n_cidx; /* number of cat indexes (one for each field) */
- int a_cidx; /* allocated space for cat indexes */
- struct Cat_index *cidx; /* Array of category indexes */
- int cidx_up_to_date; /* set to 1 when cidx is created and reset to 0 whenever any line is changed */
+ int n_cidx; /* number of cat indexes (one for each field) */
+ int a_cidx; /* allocated space for cat indexes */
+ struct Cat_index *cidx; /* array of category indexes */
+ int cidx_up_to_date; /* set to 1 when cidx is created and reset to 0 whenever any line is changed */
- off_t coor_size; /* size of coor file */
- long coor_mtime; /* time of last coor modification */
+ off_t coor_size; /* size of coor file */
+ long coor_mtime; /* time of last coor modification */
- /* Level2 update: list of lines and nodes updated (topo info for the line was changed)
- * by last write/rewrite/delete operation.
- * Lines/nodes in the list may be deleted (e.g. delete boundary: first added for
- * delete area and then delete */
- int do_uplist; /* used internaly in diglib to know if list is maintained */
+ /*** level 2 ***/
+ /* update: list of lines and nodes updated (topo info for the line
+ was changed) by last write/rewrite/delete operation.
+ Lines/nodes in the list may be deleted (e.g. delete boundary:
+ first added for delete area and then delete */
+ int do_uplist; /* used internaly in diglib to know if list is maintained */
- int *uplines; /* array of updated lines */
- int alloc_uplines; /* allocated array */
- int n_uplines; /* number of updated lines */
- int *upnodes; /* array of updated nodes */
- int alloc_upnodes; /* allocated array */
- int n_upnodes; /* number of updated nodes */
+ int *uplines; /* array of updated lines */
+ int alloc_uplines; /* allocated array */
+ int n_uplines; /* number of updated lines */
+ int *upnodes; /* array of updated nodes */
+ int alloc_upnodes; /* allocated array */
+ int n_upnodes; /* number of updated nodes */
};
+/*! \brief Vector map info */
struct Map_info
{
- /* Common info for all formats */
- int format; /* format */
+ /* common info for all formats */
+ int format; /* format (native, ogr) */
int temporary; /* temporary file flag, not yet used */
- struct dblinks *dblnk; /* info about tables */
+ struct dblinks *dblnk; /* info about db links */
- struct Plus_head plus; /* topo file *head; */
+ struct Plus_head plus; /* topo file head info */
+ /* graph-related section */
int graph_line_type; /* line type used to build the graph */
dglGraph_s graph; /* graph structure */
- dglSPCache_s spCache; /* Shortest path cache */
- double *edge_fcosts; /* costs used for graph, (dglGetEdge() is not supported for _DGL_V1) */
+ dglSPCache_s spCache; /* shortest path cache */
+ double *edge_fcosts; /* costs used for graph, (dglGetEdge()
+ is not supported for _DGL_V1) */
double *edge_bcosts;
double *node_costs; /* node costs */
- int cost_multip; /* edge and node costs multiplicator */
+ int cost_multip; /* edge and node costs
+ multiplicator */
+
+ int open; /* should be 0x5522AA22 (VECT_OPEN_CODE) if opened correctly
+ or 0x22AA2255 (VECT_CLOSED_CODE) if closed
+ anything else implies that structure has
+ never been initialized
+ */
+ int mode; /* Open mode - read (GV_MODE_READ),
+ write (GV_MODE_WRITE),
+ rw (GV_MODE_RW) */
+ int level; /* Topology level - 1, 2, (3) */
+ int head_only; /* only header is opened */
+ int support_updated; /* support files were updated */
+ plus_t next_line; /* for level 2 sequential reads */
- /* All of these apply only to runtime, and none get written out
- ** to the dig_plus file
- */
- int open; /* should be 0x5522AA22 if opened correctly */
- /* or 0x22AA2255 if closed */
- /* anything else implies that structure has */
- /* never been initialized */
- int mode; /* Read, Write, RW */
- int level; /* 1, 2, (3) */
- int head_only; /* Only header is opened */
- int support_updated; /* Support files were updated */
- plus_t next_line; /* for Level II sequential reads */
-
char *name; /* for 4.0 just name, and mapset */
- char *mapset;
+ char *mapset; /* mapset name */
/* location and gisdbase is usefull if changed (v.proj or external apps) */
char *location; /* location name */
char *gisdbase; /* gisdbase path */
- /* Constraints for reading in lines (not polys yet) */
+ /* constraints for reading in lines (not polys yet) */
int Constraint_region_flag;
int Constraint_type_flag;
double Constraint_N;
@@ -422,7 +434,7 @@
/* format specific */
/* native */
- GVFILE dig_fp; /* Dig file pointer */
+ struct gvfile dig_fp; /* dig file pointer */
struct dig_head head; /* coor file head */
/* non native */
@@ -431,37 +443,46 @@
/* history file */
FILE *hist_fp;
- /* Temporary solution for sites */
- SITE_ATT *site_att; /* array of attributes loaded from db */
+ /* temporary solution for sites - to be removed ?*/
+ struct site_att *site_att; /* array of attributes loaded from db */
int n_site_att; /* number of attributes in site_att array */
int n_site_dbl; /* number of double attributes for one site */
int n_site_str; /* number of string attributes for one site */
};
+/*! \brief Node (topology) info */
struct P_node
{
double x; /* X coordinate */
double y; /* Y coordinate */
double z; /* Z coordinate */
- plus_t alloc_lines;
- plus_t n_lines; /* Number of attached lines (size of lines, angle) */
- /* If 0, then is degenerate node, for snappingi ??? */
- plus_t *lines; /* Connected lines */
- float *angles; /* Respected angles. Angles for lines/boundaries are in radians between
- * -PI and PI. Value for points or lines with identical points (degenerated)
- * is set to -9. */
+ plus_t alloc_lines; /* allocated space for lines */
+ plus_t n_lines; /* number of attached lines (size of
+ lines, angle). If 0, then is
+ degenerate node, for snappingi ???
+ */
+ plus_t *lines; /* list of connected lines */
+ float *angles; /* respected angles; angles for
+ lines/boundaries are in radians
+ between -PI and PI. Value for
+ points or lines with identical
+ points (degenerated) is set to
+ -9. */
};
+/*! \brief Line (topology) info */
struct P_line
{
plus_t N1; /* start node */
plus_t N2; /* end node */
- plus_t left; /* area/isle number to left, negative for isle */
- /* !!! area number for centroid, negative for */
- /* duplicate centroid */
- plus_t right; /* area/isle number to right, negative for isle */
+ plus_t left; /* area/isle number to left, negative
+ for isle area number for centroid,
+ negative for duplicate centroid
+ */
+ plus_t right; /* area/isle number to right, negative
+ * for isle */
- double N; /* Bounding Box */
+ double N; /* line bounding Box */
double S;
double E;
double W;
@@ -469,58 +490,62 @@
double B; /* bottom */
off_t offset; /* offset in coor file for line */
- int type;
+ int type; /* line type */
};
+/*! \brief Area (topology) info */
struct P_area
{
- double N; /* Bounding Box */
+ double N; /* area bounding Box */
double S;
double E;
double W;
double T; /* top */
double B; /* bottom */
- plus_t n_lines; /* Number of boundary lines */
- plus_t alloc_lines;
- plus_t *lines; /* Boundary Lines, negative means direction N2 to N1,
- lines are in clockwise order */
+ plus_t n_lines; /* number of boundary lines */
+ plus_t alloc_lines; /* allocated space */
+ plus_t *lines; /* list of boundary lines, negative
+ means direction N2 to N1, lines are
+ in clockwise order */
/********* Above this line is compatible with P_isle **********/
+ plus_t centroid; /* number of first centroid within area */
- plus_t centroid; /* Number of first centroid within area */
-
- plus_t n_isles; /* Number of islands inside */
+ plus_t n_isles; /* number of islands inside */
plus_t alloc_isles;
plus_t *isles; /* 1st generation interior islands */
};
+/*! \brief Isle (topology) info */
struct P_isle
{
- double N; /* Bounding Box */
+ double N; /* isle bounding Box */
double S;
double E;
double W;
double T; /* top */
double B; /* bottom */
- plus_t n_lines; /* Number of boundary lines */
+ plus_t n_lines; /* number of boundary lines */
plus_t alloc_lines;
- plus_t *lines; /* Boundary Lines, negative means direction N2 to N1,
- lines are in counter clockwise order */
+ plus_t *lines; /* list of boundary lines, negative
+ means direction N2 to N1, lines are
+ in counter clockwise order */
/********* Above this line is compatible with P_area **********/
-
plus_t area; /* area it exists w/in, if any */
};
+/*! \brief Line points (feature geometry info */
struct line_pnts
{
- double *x;
- double *y;
- double *z;
- int n_points;
- int alloc_points;
+ double *x; /* pointer to 1st x coordinate */
+ double *y; /* pointer to 1st y coordinate */
+ double *z; /* pointer to 1st z coordinate */
+ int n_points; /* number of points */
+ int alloc_points; /* allocated space */
};
+/*! \brief Line categories (feature category info */
struct line_cats
{
int *field; /* pointer to array of fields */
@@ -529,6 +554,7 @@
int alloc_cats; /* allocated space */
};
+/*! \brief Category list */
struct cat_list
{
int field; /* category field */
@@ -538,7 +564,10 @@
int alloc_ranges; /* allocated space */
};
-/* list of integers */
+/*! \brief List of integers
+
+ \todo To be moved to gislib?
+*/
struct ilist
{
int *value; /* items */
@@ -546,24 +575,19 @@
int alloc_values; /* allocated space */
};
-/* Vector array. Space allocated is size + 1. */
+/*! \brief Vector array. Space allocated is size + 1. */
struct varray
{
int size; /* array size */
- int *c; /* array where 'class' or new category or something like that is stored */
+ int *c; /* array where 'class' or new category
+ or something like that is stored */
};
-typedef struct varray VARRAY;
-
-/* Spatial index for use in modules. */
+/*! \brief Spatial index for use in modules. */
struct spatial_index
{
- struct RTree *si_tree;
- char *name;
+ struct RTree *si_tree; /* pointer to the tree */
+ char *name; /* sidx name */
};
-typedef struct spatial_index SPATIAL_INDEX;
-
-typedef dglGraph_s GRAPH; /* graph structure */
-
#endif /* DIG___STRUCTS___ */
Modified: grass/trunk/include/vector.h
===================================================================
--- grass/trunk/include/vector.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/include/vector.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -36,7 +36,7 @@
int Vect_line_distance(const struct line_pnts *, double, double, double, int,
double *, double *, double *, double *, double *,
double *);
-int Vect_line_box(const struct line_pnts *, BOUND_BOX *);
+int Vect_line_box(const struct line_pnts *, struct bound_box *);
void Vect_line_parallel(struct line_pnts *, double, double, int,
struct line_pnts *);
void Vect_line_parallel2(struct line_pnts *, double, double,
@@ -78,13 +78,13 @@
int Vect_destroy_cat_list(struct cat_list *);
/* Vector array */
-VARRAY *Vect_new_varray(int);
+struct varray *Vect_new_varray(int);
int Vect_set_varray_from_cat_string(const struct Map_info *, int, const char *, int,
- int, VARRAY *);
+ int, struct varray *);
int Vect_set_varray_from_cat_list(const struct Map_info *, int, struct cat_list *,
- int, int, VARRAY *);
+ int, int, struct varray *);
int Vect_set_varray_from_db(const struct Map_info *, int, const char *, int, int,
- VARRAY *);
+ struct varray *);
/* DB connection - field info */
struct dblinks *Vect_new_dblinks_struct(void);
@@ -103,6 +103,7 @@
const char *, int);
struct field_info *Vect_get_dblink(const struct Map_info *, int);
struct field_info *Vect_get_field(const struct Map_info *, int);
+struct field_info *Vect_get_field_by_name(const struct Map_info *, const char *);
void Vect_set_db_updated(struct Map_info *);
const char *Vect_get_column_names(const struct Map_info *, int);
const char *Vect_get_column_types(const struct Map_info *, int);
@@ -119,12 +120,12 @@
int Vect_destroy_list(struct ilist *);
/* Bounding box (MBR) */
-int Vect_point_in_box(double, double, double, const BOUND_BOX *);
-int Vect_box_overlap(const BOUND_BOX *, const BOUND_BOX *);
-int Vect_box_copy(BOUND_BOX *, const BOUND_BOX *);
-int Vect_box_extend(BOUND_BOX *, const BOUND_BOX *);
-int Vect_box_clip(double *, double *, double *, double *, const BOUND_BOX *);
-int Vect_region_box(const struct Cell_head *, BOUND_BOX *);
+int Vect_point_in_box(double, double, double, const struct bound_box *);
+int Vect_box_overlap(const struct bound_box *, const struct bound_box *);
+int Vect_box_copy(struct bound_box *, const struct bound_box *);
+int Vect_box_extend(struct bound_box *, const struct bound_box *);
+int Vect_box_clip(double *, double *, double *, double *, const struct bound_box *);
+int Vect_region_box(const struct Cell_head *, struct bound_box *);
/* Category index */
int Vect_cidx_get_num_fields(const struct Map_info *);
@@ -172,7 +173,7 @@
const char *Vect_get_proj_name(const struct Map_info *);
int Vect_set_thresh(struct Map_info *, double);
double Vect_get_thresh(const struct Map_info *);
-int Vect_get_constraint_box(const struct Map_info *, BOUND_BOX *);
+int Vect_get_constraint_box(const struct Map_info *, struct bound_box *);
/* Get map level 2 informations */
@@ -183,10 +184,10 @@
int Vect_get_num_areas(const struct Map_info *);
int Vect_get_num_faces(const struct Map_info *);
int Vect_get_num_islands(const struct Map_info *);
-int Vect_get_line_box(const struct Map_info *, int, BOUND_BOX *);
-int Vect_get_area_box(const struct Map_info *, int, BOUND_BOX *);
-int Vect_get_isle_box(const struct Map_info *, int, BOUND_BOX *);
-int Vect_get_map_box(const struct Map_info *, BOUND_BOX *);
+int Vect_get_line_box(const struct Map_info *, int, struct bound_box *);
+int Vect_get_area_box(const struct Map_info *, int, struct bound_box *);
+int Vect_get_isle_box(const struct Map_info *, int, struct bound_box *);
+int Vect_get_map_box(const struct Map_info *, struct bound_box *);
int V__map_overlap(struct Map_info *, double, double, double, double);
void Vect_set_release_support(struct Map_info *);
void Vect_set_category_index_update(struct Map_info *);
@@ -272,11 +273,11 @@
char *Vect_hist_read(char *, int, const struct Map_info *);
/* Selecting features */
-int Vect_select_lines_by_box(struct Map_info *, const BOUND_BOX *, int,
+int Vect_select_lines_by_box(struct Map_info *, const struct bound_box *, int,
struct ilist *);
-int Vect_select_areas_by_box(struct Map_info *, const BOUND_BOX *, struct ilist *);
-int Vect_select_isles_by_box(struct Map_info *, const BOUND_BOX *, struct ilist *);
-int Vect_select_nodes_by_box(struct Map_info *, const BOUND_BOX *, struct ilist *);
+int Vect_select_areas_by_box(struct Map_info *, const struct bound_box *, struct ilist *);
+int Vect_select_isles_by_box(struct Map_info *, const struct bound_box *, struct ilist *);
+int Vect_select_nodes_by_box(struct Map_info *, const struct bound_box *, struct ilist *);
int Vect_find_node(struct Map_info *, double, double, double, double, int);
int Vect_find_line(struct Map_info *, double, double, double, int, double,
int, int);
@@ -338,11 +339,11 @@
struct ilist *, struct ilist *, struct Map_info *);
/* Graph */
-void Vect_graph_init(GRAPH *, int);
-void Vect_graph_build(GRAPH *);
-void Vect_graph_add_edge(GRAPH *, int, int, double, int);
-void Vect_graph_set_node_costs(GRAPH *, int, double);
-int Vect_graph_shortest_path(GRAPH *, int, int, struct ilist *, double *);
+void Vect_graph_init(dglGraph_s *, int);
+void Vect_graph_build(dglGraph_s *);
+void Vect_graph_add_edge(dglGraph_s *, int, int, double, int);
+void Vect_graph_set_node_costs(dglGraph_s *, int, double);
+int Vect_graph_shortest_path(dglGraph_s *, int, int, struct ilist *, double *);
/* Network (graph) */
int Vect_net_build_graph(struct Map_info *, int, int, int, const char *,
@@ -387,17 +388,17 @@
char *Vect_subst_var(const char *, const struct Map_info *);
/* Custom spatial index */
-void Vect_spatial_index_init(SPATIAL_INDEX *, int);
-void Vect_spatial_index_destroy(SPATIAL_INDEX *);
-void Vect_spatial_index_add_item(SPATIAL_INDEX *, int, const BOUND_BOX *);
-void Vect_spatial_index_del_item(SPATIAL_INDEX *, int, const BOUND_BOX *);
-int Vect_spatial_index_select(const SPATIAL_INDEX *, const BOUND_BOX *, struct ilist *);
+void Vect_spatial_index_init(struct spatial_index *, int);
+void Vect_spatial_index_destroy(struct spatial_index *);
+void Vect_spatial_index_add_item(struct spatial_index *, int, const struct bound_box *);
+void Vect_spatial_index_del_item(struct spatial_index *, int, const struct bound_box *);
+int Vect_spatial_index_select(const struct spatial_index *, const struct bound_box *, struct ilist *);
/*
* Internal functions, MUST NOT be used in modules
*/
int Vect_print_header(const struct Map_info *);
-int Vect__init_head(struct Map_info *);
+void Vect__init_head(struct Map_info *);
/* Open/close/rewind map */
int Vect_coor_info(const struct Map_info *, struct Coor_info *);
@@ -466,8 +467,8 @@
int Vect_build_line_area(struct Map_info *, int, int);
int Vect_isle_find_area(struct Map_info *, int);
int Vect_attach_isle(struct Map_info *, int);
-int Vect_attach_isles(struct Map_info *, const BOUND_BOX *);
-int Vect_attach_centroids(struct Map_info *, const BOUND_BOX *);
+int Vect_attach_isles(struct Map_info *, const struct bound_box *);
+int Vect_attach_centroids(struct Map_info *, const struct bound_box *);
/* GEOS support */
#ifdef HAVE_GEOS
Modified: grass/trunk/lib/gis/Makefile
===================================================================
--- grass/trunk/lib/gis/Makefile 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/gis/Makefile 2009-07-31 11:46:59 UTC (rev 38552)
@@ -3,7 +3,7 @@
LIB_NAME = $(GIS_LIBNAME)
EXTRA_LIBS = $(DATETIMELIB) $(PTHREADLIBPATH) $(PTHREADLIB) \
- $(INTLLIB) $(MATHLIB) $(ZLIBLIBPATH) $(ZLIB)
+ $(INTLLIB) $(MATHLIB) $(ZLIBLIBPATH) $(ZLIB) $(GDALLIBS)
EXTRA_INC = $(ZLIBINCPATH) $(PTHREADINCPATH)
DATASRC = ellipse.table datum.table datumtransform.table FIPS.code state27 state83 projections
Modified: grass/trunk/lib/gis/find_file.c
===================================================================
--- grass/trunk/lib/gis/find_file.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/gis/find_file.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -16,6 +16,7 @@
#include <string.h>
#include <unistd.h>
#include <grass/gis.h>
+#include <grass/vect/dig_defines.h>
#include <grass/glocale.h>
static const char *find_file(
@@ -50,7 +51,7 @@
*/
if (G_legal_filename(pname) == -1)
return NULL;
-
+
if (pmapset && *pmapset && G_legal_filename(pmapset) == -1)
return NULL;
Modified: grass/trunk/lib/gis/find_vect.c
===================================================================
--- grass/trunk/lib/gis/find_vect.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/gis/find_vect.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,78 +1,116 @@
-/*
- **********************************************************************
- * char *
- * G_find_vector (name, mapset)
- * char *name file name to look for
- * char *mapset mapset to search. if mapset is ""
- * will search in mapset search list
- *
- * searches for a vector map from the mapset search list
- * or in a specified mapset.
- * returns the mapset name where the vector map was found.
- *
- * NOTE: If the user specifies a fully qualified vector map which exists,
- * then <i>G_find_vector()</i> modifies <b>name</b> by removing the
- * "@<i>mapset</i>" part.
- *
- * returns:
- * char * pointer to a string with name of mapset
- * where vector map was found, or NULL if not found
- * note:
- * rejects all names that begin with .
- *
- * if name is of the form nnn in ppp then
- * name = nnn and mapset = ppp
- **********************************************************************/
+/*!
+ \file gis/find_vect.c
+
+ \brief GIS library - Find a vector map
+
+ (C) 2001-2009 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 Original author CERL
+*/
+
+#include <string.h>
+
+#include <grass/config.h>
#include <grass/gis.h>
#include <grass/vect/dig_defines.h>
+#include <grass/glocale.h>
+#ifdef HAVE_OGR
+#include <ogr_api.h>
+#endif
-/* \brief searches for a vector map
- *
- * searches for a vector map from the mapset search list
- * or in a specified mapset.
- * returns the mapset name where the vector map was found.
- *
- * returns:
- * char * pointer to a string with name of mapset
- * where vector map was found, or NULL if not found
- * NOTES:
- * If the user specifies a fully qualified vector map which exists,
- * then <i>G_find_vector()</i> modifies <b>name</b> by removing the
- * "@<i>mapset</i>" part.
- *
- * Rejects all names that begin with "."
- *
- * If name is of the form nnn in ppp then
- * name = nnn and mapset = ppp
- *
- * \param name
- * \param mapset
- * \return char *
- *
- */
+static const char *find_ogr(const char *, const char *);
+
+/*!
+ \brief Finds a vector map
+
+ Searches for a vector map from the mapset search list or in a
+ specified mapset. Returns the mapset name where the vector map was
+ found.
+
+ NOTES:
+ If the user specifies a fully qualified vector map which exists,
+ then G_find_vector() modifies <i>name</i> by removing the
+ "@<i>mapset</i>" part.
+
+ Rejects all names that begin with "."
+
+ \param name vector map name
+ \param mapset mapset name or "" for search path
+
+ \return pointer to a string with name of mapset where vector map was found
+ \return NULL if not found
+*/
const char *G_find_vector(char *name, const char *mapset)
{
- return G_find_file(GRASS_VECT_DIRECTORY, name, mapset);
+ return G_find_file(GV_DIRECTORY, name, mapset);
}
-
-
/*!
- * \brief find a vector map (look but don't touch)
+ * \brief Find a vector map (look but don't touch)
*
* The same as G_find_vector() but doesn't remove the "@<i>mapset</i>"
- * qualification from <b>name</b>, if present.
+ * qualification from <i>name</i>, if present.
*
* Returns NULL if the map wasn't found, or the mapset the vector was
* found in if it was.
*
- * \param name
- * \param mapset
- * \return char *
+ * \param name vector map name
+ * \param mapset mapset name where to search
+ *
+ * \return pointer to buffer containing mapset name
+ * \return NULL when vector map not found
*/
const char *G_find_vector2(const char *name, const char *mapset)
{
- return G_find_file2(GRASS_VECT_DIRECTORY, name, mapset);
+ const char *ogr_mapset;
+
+ /* check OGR mapset first */
+ ogr_mapset = find_ogr(name, mapset);
+ if (ogr_mapset)
+ return ogr_mapset;
+
+ return G_find_file2(GV_DIRECTORY, name, mapset);
}
+
+const char *find_ogr(const char *name, const char *mapset)
+{
+ const char *pname, *pmapset;
+ char xname[GNAME_MAX], xmapset[GMAPSET_MAX];
+
+ if(G__name_is_fully_qualified(name, xname, xmapset)) {
+ pname = xname;
+ pmapset = xmapset;
+ }
+ else {
+ pname = name;
+ pmapset = mapset;
+ }
+
+ if(pmapset && strcmp(pmapset, "OGR") == 0) {
+ /* unique mapset "OGR", check OGR datasource instead */
+#ifdef HAVE_OGR
+ OGRDataSourceH Ogr_ds;
+
+ G_debug(1, "OGR mapset detected");
+
+ OGRRegisterAll();
+
+ /* datasource handle */
+ Ogr_ds = OGROpen(pname, FALSE, NULL);
+ if (Ogr_ds == NULL)
+ G_fatal_error(_("Unable to open OGR data source '%s'"),
+ pname);
+
+ return "OGR";
+#else
+ G_fatal_error(_("Unique OGR mapset detected, OGR support is missing"));
+#endif
+ }
+
+ /* OGR mapset not detected */
+ return NULL;
+}
Modified: grass/trunk/lib/gis/legal_name.c
===================================================================
--- grass/trunk/lib/gis/legal_name.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/gis/legal_name.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,17 +1,14 @@
-
-/**
- * \file legal_name.c
+/*!
+ * \file gis/legal_name.c
*
* \brief GIS Library - Functions to handle file name legality.
*
- * (C) 2001-2008 by the GRASS Development Team
+ * (C) 2001-2009 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 GRASS GIS Development Team
- *
- * \date 1999-2006
+ * \author Original author CERL
*/
#include <stdio.h>
@@ -20,51 +17,51 @@
#include <grass/glocale.h>
-/**
+/*!
* \brief Check for legal database file name.
*
- * Legal file names will <b>not</b> begin with '.' or NULL and must
- * not contain the characters, ' ' (space), '/', '"'. '\'' (single
+ * Legal file names will <b>not</b> begin with '.' or NULL and must
+ * not contain the characters, ' ' (space), '/', '"'. '\'' (single
* quote), '@', ',', '=', '*', and all other non-alphanumeric
* characters within.
*
- * \param[in] s file name to check
+ * \param s file name to check
+ *
* \return 1 success
* \return -1 failure
*/
-
int G_legal_filename(const char *s)
{
+ const char *name = s;
+
if (*s == '.' || *s == 0) {
- fprintf(stderr, _("Illegal filename. Cannot be '.' or 'NULL'\n"));
+ G_warning(_("Illegal filename <%s>. Cannot be '.' or 'NULL'."), name);
return -1;
}
for (; *s; s++)
if (*s == '/' || *s == '"' || *s == '\'' || *s <= ' ' ||
*s == '@' || *s == ',' || *s == '=' || *s == '*' || *s > 0176) {
- fprintf(stderr,
- _("Illegal filename. Character <%c> not allowed.\n"), *s);
+ G_warning(_("Illegal filename <%s>. Character <%c> not allowed.\n"), name, *s);
return -1;
}
-
+
return 1;
}
-
-/**
+/*!
* \brief Check input and output file names.
*
- * Check: 1) output is legal map name, 2) if can find input map, and 3)
- * if input was found in current mapset, check if input != output.
+ * Check: 1) output is legal map name, 2) if can find input map, and
+ * 3) if input was found in current mapset, check if input != output.
*
- * \param[in] input name
- * \param[out] output name
- * \param[in] error error type: GR_FATAL_EXIT, GR_FATAL_PRINT, GR_FATAL_RETURN
+ * \param input input map name
+ * \param output output map name
+ * \param error error type: GR_FATAL_EXIT, GR_FATAL_PRINT, GR_FATAL_RETURN
+ *
* \return 0 OK
* \return 1 error
*/
-
int G_check_input_output_name(const char *input, const char *output,
int error)
{
Modified: grass/trunk/lib/gis/open.c
===================================================================
--- grass/trunk/lib/gis/open.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/gis/open.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -229,7 +229,7 @@
fd = G__open(element, name, mapset, 0);
if (fd < 0)
- return (FILE *) 0;
+ return (FILE *) NULL;
return fdopen(fd, "r");
}
Modified: grass/trunk/lib/gis/zero.c
===================================================================
--- grass/trunk/lib/gis/zero.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/gis/zero.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,31 +1,25 @@
-
-/**
- * \file zero.c
+/*!
+ * \file gis/zero.c
*
* \brief GIS Library - Zeroing functions.
*
- * (C) 2001-2008 by the GRASS Development Team
+ * (C) 2001-2009 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 GRASS GIS Development Team
- *
- * \date 1999-2008
+ * \author Original author CERL
*/
#include <string.h>
#include <grass/gis.h>
-
-/**
+/*!
* \brief Zero out a buffer, <b>buf</b>, of length <b>i</b>.
*
- * \param[in,out] buf
- * \param[in] i number of bytes to be zeroed
- * \return
+ * \param[out] buf
+ * \param i number of bytes to be zeroed
*/
-
void G_zero(void *buf, int i)
{
memset(buf, 0, i);
Modified: grass/trunk/lib/nviz/nvizlib.dox
===================================================================
--- grass/trunk/lib/nviz/nvizlib.dox 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/nviz/nvizlib.dox 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,9 +1,7 @@
/*! \page nvizlib GRASS Nviz Library
-by GRASS Development Team
+by GRASS Development Team (http://grass.osgeo.org)
-http://grass.osgeo.org
-
\section nvizintro Introduction to Nviz Library
This library is build on \ref ogsflib and serves as the interface for
@@ -101,4 +99,8 @@
- Nviz_new_render_window()
+\section authors Authors
+
+ Martin Landa <landa.martin gmail.com>
+
*/
Modified: grass/trunk/lib/sites/sites.c
===================================================================
--- grass/trunk/lib/sites/sites.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/sites/sites.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -40,7 +40,7 @@
static int site_att_cmp(const void *pa, const void *pb)
{
- const SITE_ATT *a = pa, *b = pb;
+ const struct site_att *a = pa, *b = pb;
return a->cat - b->cat;
}
@@ -57,7 +57,7 @@
int i, type, cat;
static struct line_pnts *Points = NULL;
static struct line_cats *Cats = NULL;
- SITE_ATT *sa;
+ struct site_att *sa;
if (Points == NULL)
Points = Vect_new_line_struct();
@@ -89,8 +89,8 @@
/* find att */
if (Map->n_site_att > 0) {
- sa = (SITE_ATT *) bsearch((void *)&cat, (void *)Map->site_att,
- Map->n_site_att, sizeof(SITE_ATT),
+ sa = (struct site_att *) bsearch((void *)&cat, (void *)Map->site_att,
+ Map->n_site_att, sizeof(struct site_att),
site_att_cmp);
if (sa == NULL) {
@@ -283,7 +283,7 @@
struct Map_info *Map;
struct field_info *fi;
int more, nrows, row, ncols, col, ndbl, nstr, adbl, astr, ctype;
- SITE_ATT *sa;
+ struct site_att *sa;
dbDriver *driver;
dbString stmt;
@@ -332,7 +332,7 @@
nrows = db_get_num_rows(&cursor);
G_debug(1, "%d rows selected from vector attribute table", nrows);
- Map->site_att = (SITE_ATT *) malloc(nrows * sizeof(SITE_ATT));
+ Map->site_att = (struct site_att *) malloc(nrows * sizeof(struct site_att));
Map->n_site_att = nrows;
table = db_get_cursor_table(&cursor);
@@ -411,7 +411,7 @@
db_close_database_shutdown_driver(driver);
/* sort attributes */
- qsort((void *)Map->site_att, Map->n_site_att, sizeof(SITE_ATT),
+ qsort((void *)Map->site_att, Map->n_site_att, sizeof(struct site_att),
site_att_cmp);
return Map;
@@ -1149,12 +1149,12 @@
*/
/*
- Returns a pointer to the SITE_ATT in Map_info *ptr and with category cat
+ Returns a pointer to the struct site_att in Map_info *ptr and with category cat
*/
-SITE_ATT *G_sites_get_atts(struct Map_info * Map, int *cat)
+struct site_att *G_sites_get_atts(struct Map_info * Map, int *cat)
{
- return (SITE_ATT *) bsearch((void *)cat, (void *)Map->site_att,
- Map->n_site_att, sizeof(SITE_ATT),
+ return (struct site_att *) bsearch((void *)cat, (void *)Map->site_att,
+ Map->n_site_att, sizeof(struct site_att),
site_att_cmp);
}
Modified: grass/trunk/lib/vector/Vlib/area.c
===================================================================
--- grass/trunk/lib/vector/Vlib/area.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/area.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -38,7 +38,7 @@
{
int i, line, aline, dir;
const struct Plus_head *Plus;
- P_AREA *Area;
+ struct P_area *Area;
static int first_time = 1;
static struct line_pnts *Points;
@@ -100,7 +100,7 @@
{
int i, line, aline, dir;
const struct Plus_head *Plus;
- P_ISLE *Isle;
+ struct P_isle *Isle;
static int first_time = 1;
static struct line_pnts *Points;
@@ -153,7 +153,7 @@
int Vect_get_area_centroid(const struct Map_info *Map, int area)
{
const struct Plus_head *Plus;
- P_AREA *Area;
+ struct P_area *Area;
G_debug(3, "Vect_get_area_centroid(): area = %d", area);
@@ -180,7 +180,7 @@
{
int i, line;
const struct Plus_head *Plus;
- P_AREA *Area;
+ struct P_area *Area;
G_debug(3, "Vect_get_area_boundaries(): area = %d", area);
@@ -214,7 +214,7 @@
{
int i, line;
const struct Plus_head *Plus;
- P_ISLE *Isle;
+ struct P_isle *Isle;
G_debug(3, "Vect_get_isle_boundaries(): isle = %d", isle);
@@ -246,7 +246,7 @@
int Vect_get_area_num_isles(const struct Map_info *Map, int area)
{
const struct Plus_head *Plus;
- P_AREA *Area;
+ struct P_area *Area;
G_debug(3, "Vect_get_area_num_isles(): area = %d", area);
@@ -275,7 +275,7 @@
int Vect_get_area_isle(const struct Map_info *Map, int area, int isle)
{
const struct Plus_head *Plus;
- P_AREA *Area;
+ struct P_area *Area;
G_debug(3, "Vect_get_area_isle(): area = %d isle = %d", area, isle);
@@ -302,7 +302,7 @@
int Vect_get_isle_area(const struct Map_info *Map, int isle)
{
const struct Plus_head *Plus;
- P_ISLE *Isle;
+ struct P_isle *Isle;
G_debug(3, "Vect_get_isle_area(): isle = %d", isle);
@@ -345,7 +345,7 @@
{
int i, isle;
const struct Plus_head *Plus;
- P_AREA *Area;
+ struct P_area *Area;
int poly;
Plus = &(Map->plus);
@@ -379,7 +379,7 @@
double Vect_get_area_area(const struct Map_info *Map, int area)
{
const struct Plus_head *Plus;
- P_AREA *Area;
+ struct P_area *Area;
struct line_pnts *Points;
double size;
int i;
Modified: grass/trunk/lib/vector/Vlib/array.c
===================================================================
--- grass/trunk/lib/vector/Vlib/array.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/array.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -29,22 +29,22 @@
/*!
- \brief Create new VARRAY and allocate space for given number of items.
+ \brief Create new struct varray and allocate space for given number of items.
Space allocated is 'size + 1' so that lines are accessed by line id.
Array values are set to 0.
\param size size of array
- \return pointer to new VARRAY
+ \return pointer to new struct varray
\return NULL if failed
*/
-VARRAY *Vect_new_varray(int size)
+struct varray *Vect_new_varray(int size)
{
- VARRAY *p;
+ struct varray *p;
- p = (VARRAY *) G_malloc(sizeof(VARRAY));
+ p = (struct varray *) G_malloc(sizeof(struct varray));
if (p == NULL)
return NULL;
@@ -83,7 +83,7 @@
int
Vect_set_varray_from_cat_string(const struct Map_info *Map, int field,
const char *cstring, int type, int value,
- VARRAY * varray)
+ struct varray * varray)
{
int ret;
struct cat_list *Clist;
@@ -130,7 +130,7 @@
int
Vect_set_varray_from_cat_list(const struct Map_info *Map, int field,
struct cat_list *clist, int type, int value,
- VARRAY * varray)
+ struct varray * varray)
{
int i, n, centr, cat;
int ni = 0; /* number of items set */
@@ -249,7 +249,7 @@
*/
int
Vect_set_varray_from_db(const struct Map_info *Map, int field, const char *where,
- int type, int value, VARRAY * varray)
+ int type, int value, struct varray * varray)
{
int i, n, c, centr, cat, *cats;
int ncats;
Modified: grass/trunk/lib/vector/Vlib/box.c
===================================================================
--- grass/trunk/lib/vector/Vlib/box.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/box.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -29,7 +29,7 @@
\return 1 point is in box
\return 0 point is not in box
*/
-int Vect_point_in_box(double x, double y, double z, const BOUND_BOX * Box)
+int Vect_point_in_box(double x, double y, double z, const struct bound_box * Box)
{
if (x >= Box->W && x <= Box->E &&
@@ -49,7 +49,7 @@
\return 1 boxes overlap
\return 0 boxes do not overlap
*/
-int Vect_box_overlap(const BOUND_BOX * A, const BOUND_BOX * B)
+int Vect_box_overlap(const struct bound_box * A, const struct bound_box * B)
{
if (A->E < B->W || A->W > B->E ||
@@ -68,7 +68,7 @@
\return 1
*/
-int Vect_box_copy(BOUND_BOX * A, const BOUND_BOX * B)
+int Vect_box_copy(struct bound_box * A, const struct bound_box * B)
{
A->N = B->N;
@@ -89,7 +89,7 @@
\return 1
*/
-int Vect_box_extend(BOUND_BOX * A, const BOUND_BOX * B)
+int Vect_box_extend(struct bound_box * A, const struct bound_box * B)
{
if (B->N > A->N)
@@ -134,7 +134,7 @@
*/
int
-Vect_box_clip(double *x, double *y, double *c_x, double *c_y, const BOUND_BOX * Box)
+Vect_box_clip(double *x, double *y, double *c_x, double *c_y, const struct bound_box * Box)
{
int mod;
@@ -204,10 +204,10 @@
\return 1 on success
\return 0 line is dead
*/
-int Vect_get_line_box(const struct Map_info *Map, int line, BOUND_BOX * Box)
+int Vect_get_line_box(const struct Map_info *Map, int line, struct bound_box * Box)
{
const struct Plus_head *Plus;
- P_LINE *Line;
+ struct P_line *Line;
Plus = &(Map->plus);
Line = Plus->Line[line];
@@ -243,10 +243,10 @@
\return 1 on success
\return 0 area is dead
*/
-int Vect_get_area_box(const struct Map_info *Map, int area, BOUND_BOX * Box)
+int Vect_get_area_box(const struct Map_info *Map, int area, struct bound_box * Box)
{
const struct Plus_head *Plus;
- P_AREA *Area;
+ struct P_area *Area;
Plus = &(Map->plus);
Area = Plus->Area[area];
@@ -282,10 +282,10 @@
\return 1 on success
\return 0 isle is dead
*/
-int Vect_get_isle_box(const struct Map_info *Map, int isle, BOUND_BOX * Box)
+int Vect_get_isle_box(const struct Map_info *Map, int isle, struct bound_box * Box)
{
const struct Plus_head *Plus;
- P_ISLE *Isle;
+ struct P_isle *Isle;
Plus = &(Map->plus);
Isle = Plus->Isle[isle];
@@ -320,7 +320,7 @@
\return 1 on success
\return 0 on error
*/
-int Vect_get_map_box(const struct Map_info *Map, BOUND_BOX * Box)
+int Vect_get_map_box(const struct Map_info *Map, struct bound_box * Box)
{
const struct Plus_head *Plus;
@@ -346,7 +346,7 @@
\return 1 on success
\return 0 on error
*/
-int Vect_region_box(const struct Cell_head *Window, BOUND_BOX * Box)
+int Vect_region_box(const struct Cell_head *Window, struct bound_box * Box)
{
Box->N = Window->north;
Modified: grass/trunk/lib/vector/Vlib/break_lines.c
===================================================================
--- grass/trunk/lib/vector/Vlib/break_lines.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/break_lines.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -71,7 +71,7 @@
int j, k, l, ret, atype, btype, aline, bline, found, iline, nlines;
int naxlines, nbxlines, nx;
double *xx = NULL, *yx = NULL, *zx = NULL;
- BOUND_BOX ABox, BBox;
+ struct bound_box ABox, BBox;
struct ilist *List;
int nbreaks;
int touch1_n = 0, touch1_s = 0, touch1_e = 0, touch1_w = 0; /* other vertices except node1 touching box */
Modified: grass/trunk/lib/vector/Vlib/build.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/build.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -171,7 +171,7 @@
if (plus->built >= GV_BUILD_AREAS) {
int line, nlines, area, nareas, err_boundaries, err_centr_out,
err_centr_dupl, err_nocentr;
- P_LINE *Line;
+ struct P_line *Line;
struct Plus_head *Plus;
/* Count errors (it does not take much time comparing to build process) */
@@ -243,14 +243,14 @@
{
struct Plus_head *plus;
char fname[GPATH_MAX], buf[GPATH_MAX];
- GVFILE fp;
+ struct gvfile fp;
G_debug(1, "Vect_save_topo()");
plus = &(Map->plus);
/* write out all the accumulated info to the plus file */
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
G__file_name(fname, buf, GV_TOPO_ELEMENT, Map->mapset);
G_debug(1, "Open topo: %s", fname);
dig_file_init(&fp);
@@ -285,11 +285,11 @@
int Vect_topo_dump(const struct Map_info *Map, FILE * out)
{
int i, j, line, isle;
- P_NODE *Node;
- P_LINE *Line;
- P_AREA *Area;
- P_ISLE *Isle;
- BOUND_BOX box;
+ struct P_node *Node;
+ struct P_line *Line;
+ struct P_area *Area;
+ struct P_isle *Isle;
+ struct bound_box box;
const struct Plus_head *plus;
plus = &(Map->plus);
@@ -417,11 +417,11 @@
{
int i, total, done;
struct Plus_head *plus;
- BOUND_BOX box;
- P_LINE *Line;
- P_NODE *Node;
- P_AREA *Area;
- P_ISLE *Isle;
+ struct bound_box box;
+ struct P_line *Line;
+ struct P_node *Node;
+ struct P_area *Area;
+ struct P_isle *Isle;
G_debug(3, "Vect_build_sidx_from_topo()");
@@ -532,7 +532,7 @@
if (Map->plus.Spidx_new == 1) {
/* write out rtrees to sidx file */
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
G__file_name(fname, buf, GV_SIDX_ELEMENT, Map->mapset);
G_debug(1, "Open sidx: %s", fname);
dig_file_init(&(Map->plus.spidx_fp));
Modified: grass/trunk/lib/vector/Vlib/build_nat.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build_nat.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/build_nat.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -40,7 +40,7 @@
static int first = 1;
off_t offset;
struct Plus_head *plus;
- P_LINE *BLine;
+ struct P_line *BLine;
static struct line_pnts *Points, *APoints;
plus_t *lines;
double area_size;
@@ -135,12 +135,12 @@
int j, line, node, sel_area, first, area, poly;
static int first_call = 1;
const struct Plus_head *plus;
- P_LINE *Line;
- P_NODE *Node;
- P_ISLE *Isle;
- P_AREA *Area;
+ struct P_line *Line;
+ struct P_node *Node;
+ struct P_isle *Isle;
+ struct P_area *Area;
double size, cur_size;
- BOUND_BOX box, abox;
+ struct bound_box box, abox;
static struct ilist *List;
static struct line_pnts *APoints;
@@ -269,7 +269,7 @@
int Vect_attach_isle(struct Map_info *Map, int isle)
{
int sel_area;
- P_ISLE *Isle;
+ struct P_isle *Isle;
struct Plus_head *plus;
/* Note!: If topology is not clean and areas overlap, one island may fall to more areas
@@ -303,7 +303,7 @@
\return 0
*/
-int Vect_attach_isles(struct Map_info *Map, const BOUND_BOX * box)
+int Vect_attach_isles(struct Map_info *Map, const struct bound_box * box)
{
int i, isle;
static int first = 1;
@@ -337,13 +337,13 @@
\return 0
*/
-int Vect_attach_centroids(struct Map_info *Map, const BOUND_BOX * box)
+int Vect_attach_centroids(struct Map_info *Map, const struct bound_box * box)
{
int i, sel_area, centr;
static int first = 1;
static struct ilist *List;
- P_AREA *Area;
- P_LINE *Line;
+ struct P_area *Area;
+ struct P_line *Line;
struct Plus_head *plus;
G_debug(3, "Vect_attach_centroids ()");
@@ -443,9 +443,9 @@
int side, line, area;
struct line_pnts *Points, *APoints;
struct line_cats *Cats;
- P_LINE *Line;
- P_AREA *Area;
- BOUND_BOX box;
+ struct P_line *Line;
+ struct P_area *Area;
+ struct bound_box box;
struct ilist *List;
G_debug(3, "Vect_build_nat() build = %d", build);
Modified: grass/trunk/lib/vector/Vlib/build_ogr.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build_ogr.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/build_ogr.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -113,7 +113,7 @@
int line;
struct Plus_head *plus;
long offset;
- BOUND_BOX box;
+ struct bound_box box;
plus = &(Map->plus);
@@ -159,8 +159,8 @@
int lines[1];
static struct line_pnts **Points = NULL;
static int alloc_points = 0;
- BOUND_BOX box;
- P_LINE *Line;
+ struct bound_box box;
+ struct P_line *Line;
double area_size, x, y;
int eType, nRings, iPart, nParts, nPoints;
OGRGeometryH hGeom2, hRing;
@@ -254,7 +254,7 @@
outer_area = area;
}
else { /* inner ring */
- P_ISLE *Isle;
+ struct P_isle *Isle;
Isle = plus->Isle[isle];
Isle->area = outer_area;
@@ -273,7 +273,7 @@
outer_area);
}
else {
- P_AREA *Area;
+ struct P_area *Area;
G_debug(4, " Centroid: %f, %f", x, y);
Vect_reset_line(Points[0]);
Modified: grass/trunk/lib/vector/Vlib/cindex.c
===================================================================
--- grass/trunk/lib/vector/Vlib/cindex.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/cindex.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -444,14 +444,14 @@
{
struct Plus_head *plus;
char fname[1024], buf[1024];
- GVFILE fp;
+ struct gvfile fp;
G_debug(2, "Vect_cidx_save()");
check_status(Map);
plus = &(Map->plus);
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
G__file_name(fname, buf, GV_CIDX_ELEMENT, Map->mapset);
G_debug(2, "Open cidx: %s", fname);
dig_file_init(&fp);
@@ -477,8 +477,8 @@
/*!
\brief Read category index from file if exists
- \param Map vector map
- \param head_only Read only header
+ \param Map pointer to Map_info structure
+ \param head_only read only header
\return 0 on success
\return 1 if file does not exist
@@ -488,7 +488,7 @@
{
int ret;
char buf[500], file_path[2000];
- GVFILE fp;
+ struct gvfile fp;
struct Plus_head *Plus;
struct stat info;
@@ -497,7 +497,7 @@
Plus = &(Map->plus);
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
G__file_name(file_path, buf, GV_CIDX_ELEMENT, Map->mapset);
if (stat(file_path, &info) != 0) /* does not exist */
Modified: grass/trunk/lib/vector/Vlib/clean_nodes.c
===================================================================
--- grass/trunk/lib/vector/Vlib/clean_nodes.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/clean_nodes.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -66,7 +66,7 @@
G_debug(3, "nlines = %d", nlines);
for (i = 0; i < nlines; i++) {
- P_LINE *Line;
+ struct P_line *Line;
int line2;
float angle2;
Modified: grass/trunk/lib/vector/Vlib/close.c
===================================================================
--- grass/trunk/lib/vector/Vlib/close.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/close.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -74,7 +74,7 @@
struct stat info;
/* Delete old support files if available */
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
G__file_name(file_path, buf, GV_TOPO_ELEMENT, G_mapset());
if (stat(file_path, &info) == 0) /* file exists? */
Modified: grass/trunk/lib/vector/Vlib/close_ogr.c
===================================================================
--- grass/trunk/lib/vector/Vlib/close_ogr.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/close_ogr.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -71,7 +71,7 @@
char fname[1000], elem[1000];
char buf[5];
long length = 9;
- GVFILE fp;
+ struct gvfile fp;
struct Port_info port;
G_debug(3, "V2_close_ogr()");
@@ -81,7 +81,7 @@
if (strcmp(Map->mapset, G_mapset()) == 0 && Map->support_updated &&
Map->plus.built == GV_BUILD_ALL) {
- sprintf(elem, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
+ sprintf(elem, "%s/%s", GV_DIRECTORY, Map->name);
G__file_name(fname, elem, "fidx", Map->mapset);
G_debug(4, "Open fidx: %s", fname);
dig_file_init(&fp);
Modified: grass/trunk/lib/vector/Vlib/constraint.c
===================================================================
--- grass/trunk/lib/vector/Vlib/constraint.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/constraint.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -75,7 +75,7 @@
\return 0
*/
-int Vect_get_constraint_box(const struct Map_info *Map, BOUND_BOX * Box)
+int Vect_get_constraint_box(const struct Map_info *Map, struct bound_box * Box)
{
Box->N = Map->Constraint_N;
Box->S = Map->Constraint_S;
Modified: grass/trunk/lib/vector/Vlib/dgraph.h
===================================================================
--- grass/trunk/lib/vector/Vlib/dgraph.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/dgraph.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,5 +1,5 @@
-#ifndef GRASS_DGRAPH_H
-#define GRASS_DGRAPH_H
+#ifndef GRASS_DdglGraph_s_H
+#define GRASS_DdglGraph_s_H
/* pg comes from "planar graph" */
/* every edge is directed. Nevertheless, we can visit it on both sides */
Modified: grass/trunk/lib/vector/Vlib/error.c
===================================================================
--- grass/trunk/lib/vector/Vlib/error.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/error.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -41,7 +41,7 @@
/*!
\brief Get behaviour for fatal error
- \param
+ \todo Remove or move to GIS Library?
\return GV_FATAL_EXIT(default): print error message and exit,
\return GV_FATAL_PRINT: print error message and return error,
Modified: grass/trunk/lib/vector/Vlib/find.c
===================================================================
--- grass/trunk/lib/vector/Vlib/find.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/find.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -40,7 +40,7 @@
double ux, double uy, double uz, double maxdist, int with_z)
{
int i, nnodes, node;
- BOUND_BOX box;
+ struct bound_box box;
struct ilist *NList;
double x, y, z;
double cur_dist, dist;
@@ -155,7 +155,7 @@
static struct line_pnts *Points;
static int first_time = 1;
const struct Plus_head *Plus;
- BOUND_BOX box;
+ struct bound_box box;
struct ilist *List;
G_debug(3, "Vect_find_line_list() for %f %f %f type = %d maxdist = %f",
@@ -248,7 +248,7 @@
{
int i, ret, area;
static int first = 1;
- BOUND_BOX box;
+ struct bound_box box;
static struct ilist *List;
G_debug(3, "Vect_find_area() x = %f y = %f", x, y);
@@ -294,7 +294,7 @@
{
int i, ret, island, current, current_size, size;
static int first = 1;
- BOUND_BOX box;
+ struct bound_box box;
static struct ilist *List;
static struct line_pnts *Points;
Modified: grass/trunk/lib/vector/Vlib/geos.c
===================================================================
--- grass/trunk/lib/vector/Vlib/geos.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/geos.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,5 +1,5 @@
/*!
- \file geos.c
+ \file lib/vector/Vlib/geos.c
\brief Vector library - GEOS support
@@ -46,7 +46,7 @@
*/
GEOSGeometry *Vect_read_line_geos(struct Map_info *Map, int line, int *type)
{
- P_LINE *Line;
+ struct P_line *Line;
G_debug(3, "Vect_read_line_geos(): line = %d", line);
@@ -246,7 +246,7 @@
GEOSCoordSequence *V2_read_line_geos(struct Map_info *Map, int line)
{
int ftype;
- P_LINE *Line;
+ struct P_line *Line;
G_debug(3, "V2_read_line_geos(): line = %d", line);
@@ -373,7 +373,7 @@
GEOSCoordSeq_setZ(pseq, i, z[i]);
}
- G_debug(3, " off = %ld", dig_ftell(&(Map->dig_fp)));
+ G_debug(3, " off = %ld", (long) dig_ftell(&(Map->dig_fp)));
G_free((void *) x);
G_free((void *) y);
@@ -400,7 +400,7 @@
GEOSCoordSequence *Vect_get_area_points_geos(struct Map_info *Map, int area)
{
struct Plus_head *Plus;
- P_AREA *Area;
+ struct P_area *Area;
G_debug(3, "Vect_get_area_points_geos(): area = %d", area);
@@ -431,7 +431,7 @@
GEOSCoordSequence *Vect_get_isle_points_geos(struct Map_info *Map, int isle)
{
struct Plus_head *Plus;
- P_ISLE *Isle;
+ struct P_isle *Isle;
G_debug(3, "Vect_get_isle_points_geos(): isle = %d", isle);
Modified: grass/trunk/lib/vector/Vlib/graph.c
===================================================================
--- grass/trunk/lib/vector/Vlib/graph.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/graph.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -5,7 +5,7 @@
Higher level functions for reading/writing/manipulating vectors.
- \todo Vect_graph_free ( GRAPH *graph )
+ \todo Vect_graph_free ( dglGraph_s *graph )
(C) 2001-2009 by the GRASS Development Team
@@ -70,7 +70,7 @@
\return void
*/
-void Vect_graph_init(GRAPH * graph, int nodes_costs)
+void Vect_graph_init(dglGraph_s * graph, int nodes_costs)
{
dglInt32_t opaqueset[16] =
{ 360000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
@@ -96,7 +96,7 @@
\return void
*/
-void Vect_graph_build(GRAPH * graph)
+void Vect_graph_build(dglGraph_s * graph)
{
int ret;
@@ -123,7 +123,7 @@
\return void
*/
void
-Vect_graph_add_edge(GRAPH * graph, int from, int to, double costs, int id)
+Vect_graph_add_edge(dglGraph_s * graph, int from, int to, double costs, int id)
{
int ret;
dglInt32_t dglcosts;
@@ -153,7 +153,7 @@
\return void
*/
-void Vect_graph_set_node_costs(GRAPH * graph, int node, double costs)
+void Vect_graph_set_node_costs(dglGraph_s * graph, int node, double costs)
{
dglInt32_t dglcosts;
@@ -183,7 +183,7 @@
\return -1 destination unreachable
*/
int
-Vect_graph_shortest_path(GRAPH * graph, int from, int to, struct ilist *List,
+Vect_graph_shortest_path(dglGraph_s * graph, int from, int to, struct ilist *List,
double *cost)
{
int i, line, *pclip, cArc, nRet;
Modified: grass/trunk/lib/vector/Vlib/header.c
===================================================================
--- grass/trunk/lib/vector/Vlib/header.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/header.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -77,21 +77,21 @@
\param Map vector map
- \return GRASS_OK on success
- \return GRASS_ERR on error
+ \return 0 on success
+ \return -1 on error
*/
int Vect__write_head(const struct Map_info *Map)
{
char buf[GPATH_MAX];
FILE *head_fp;
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
- head_fp = G_fopen_new(buf, GRASS_VECT_HEAD_ELEMENT);
+ head_fp = G_fopen_new(buf, GV_HEAD_ELEMENT);
if (head_fp == NULL) {
G_warning(_("Unable to open header file of vector <%s>"),
Vect_get_full_name(Map));
- return (GRASS_ERR);
+ return (-1);
}
fprintf(head_fp, "ORGANIZATION: %s\n", Vect_get_organization(Map));
@@ -105,16 +105,16 @@
fprintf(head_fp, "MAP THRESH: %f\n", Vect_get_thresh(Map));
fclose(head_fp);
- return (GRASS_OK);
+ return (0);
}
/*!
- \brief Reads head information from text file (GRASS_VECT_HEAD_ELEMENT).
+ \brief Reads head information from text file (GV_HEAD_ELEMENT).
- \param Map vector map
+ \param Map pointer to Map_info structure
- \return GRASS_OK on success
- \return GRASS_ERR on error
+ \return 0 on success
+ \return -1 on error
*/
int Vect__read_head(struct Map_info *Map)
{
@@ -134,12 +134,12 @@
Vect_set_thresh(Map, 0.);
G_debug(1, "Vect__read_head(): vector = %s@%s", Map->name, Map->mapset);
- sprintf(buff, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
- head_fp = G_fopen_old(buff, GRASS_VECT_HEAD_ELEMENT, Map->mapset);
+ sprintf(buff, "%s/%s", GV_DIRECTORY, Map->name);
+ head_fp = G_fopen_old(buff, GV_HEAD_ELEMENT, Map->mapset);
if (head_fp == NULL) {
G_warning(_("Unable to open header file of vector <%s>"),
Vect_get_full_name(Map));
- return (GRASS_ERR);
+ return (-1);
}
while (G_getl2(buff, 2000, head_fp)) {
@@ -185,7 +185,7 @@
}
fclose(head_fp);
- return (GRASS_OK);
+ return (0);
}
/*!
Modified: grass/trunk/lib/vector/Vlib/hist.c
===================================================================
--- grass/trunk/lib/vector/Vlib/hist.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/hist.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -22,7 +22,7 @@
/*!
\brief Write command info to history file
- \param Map vector map
+ \param Map pointer to Map_info structure
\return 0 on success
\return -1 error
@@ -52,7 +52,7 @@
/*!
\brief Write string to history file
- \param Map vector map
+ \param Map pointer to Map_info structure
\param str string to write
\return the number of characters printed
Modified: grass/trunk/lib/vector/Vlib/init_head.c
===================================================================
--- grass/trunk/lib/vector/Vlib/init_head.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/init_head.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,8 +1,8 @@
/*!
- \file init_head.c
+ \file vector/Vlib/init_head.c
- \brief Vector library - init header of vector map
-
+ \brief Vector library - init header of vector maps
+
Higher level functions for reading/writing/manipulating vectors.
Initialize Head structure. To make sure that we are not writing out
@@ -15,6 +15,7 @@
\author Original author CERL, probably Dave Gerdes or Mike Higgins.
\author Update to GRASS 5.7 Radim Blazek and David D. Gray.
+ \author Various updates by Martin Landa <landa.martin gmail.com>, 2009
*/
#include <grass/config.h>
@@ -23,40 +24,49 @@
#include <grass/vector.h>
/*!
- \brief Initialize head structure
+ \brief Initialize Map_info head structure (dig_head)
- \param Map vector map
-
- \return 0
+ \param[in,out] Map pointer to Map_info structure
*/
-int Vect__init_head(struct Map_info *Map)
+void Vect__init_head(struct Map_info *Map)
{
char buf[64];
+ /* organization */
Map->head.organization = NULL;
Vect_set_organization(Map, "");
+
+ /* date */
Map->head.date = NULL;
Vect_set_date(Map, "");
+
+ /* user name */
Map->head.your_name = NULL;
sprintf(buf, "%s", G_whoami());
Vect_set_person(Map, buf);
+
+ /* map name */
Map->head.map_name = NULL;
Vect_set_map_name(Map, "");
+
+ /* source date */
Map->head.source_date = NULL;
sprintf(buf, "%s", G_date());
Vect_set_map_date(Map, buf);
+
+ /* comments */
Map->head.line_3 = NULL;
Vect_set_comment(Map, "");
+ /* scale, zone, threshold */
Vect_set_scale(Map, 1);
Vect_set_zone(Map, 0);
Vect_set_thresh(Map, 0.0);
+ /* support variables */
Map->plus.Spidx_built = 0;
Map->plus.release_support = 0;
Map->plus.update_cidx = 0;
-
- return 0;
}
/*!
Modified: grass/trunk/lib/vector/Vlib/level_two.c
===================================================================
--- grass/trunk/lib/vector/Vlib/level_two.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/level_two.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -181,7 +181,7 @@
Vect_get_node_coor(const struct Map_info *map, int num, double *x, double *y,
double *z)
{
- P_NODE *Node;
+ struct P_node *Node;
Node = map->plus.Node[num];
*x = Node->x;
Modified: grass/trunk/lib/vector/Vlib/line.c
===================================================================
--- grass/trunk/lib/vector/Vlib/line.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/line.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -762,7 +762,7 @@
\return 0
*/
-int Vect_line_box(const struct line_pnts *Points, BOUND_BOX * Box)
+int Vect_line_box(const struct line_pnts *Points, struct bound_box * Box)
{
dig_line_box(Points, Box);
return 0;
Modified: grass/trunk/lib/vector/Vlib/map.c
===================================================================
--- grass/trunk/lib/vector/Vlib/map.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/map.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -161,8 +161,8 @@
struct field_info *Fi, *Fin;
char old_path[GPATH_MAX], new_path[GPATH_MAX], buf[GPATH_MAX];
struct stat info;
- const char *files[] = { GRASS_VECT_FRMT_ELEMENT, GRASS_VECT_COOR_ELEMENT,
- GRASS_VECT_HEAD_ELEMENT, GRASS_VECT_HIST_ELEMENT,
+ const char *files[] = { GV_FRMT_ELEMENT, GV_COOR_ELEMENT,
+ GV_HEAD_ELEMENT, GV_HIST_ELEMENT,
GV_TOPO_ELEMENT, GV_SIDX_ELEMENT, GV_CIDX_ELEMENT,
NULL
};
@@ -200,16 +200,16 @@
}
/* Copy the directory */
- G__make_mapset_element(GRASS_VECT_DIRECTORY);
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, out);
+ G__make_mapset_element(GV_DIRECTORY);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, out);
G__make_mapset_element(buf);
i = 0;
while (files[i]) {
sprintf(buf, "%s/%s", in, files[i]);
- G__file_name(old_path, GRASS_VECT_DIRECTORY, buf, mapset);
+ G__file_name(old_path, GV_DIRECTORY, buf, mapset);
sprintf(buf, "%s/%s", out, files[i]);
- G__file_name(new_path, GRASS_VECT_DIRECTORY, buf, G_mapset());
+ G__file_name(new_path, GV_DIRECTORY, buf, G_mapset());
if (stat(old_path, &info) == 0) { /* file exists? */
G_debug(2, "copy %s to %s", old_path, new_path);
@@ -221,8 +221,8 @@
i++;
}
- G__file_name(old_path, GRASS_VECT_DIRECTORY, in, mapset);
- G__file_name(new_path, GRASS_VECT_DIRECTORY, out, G_mapset());
+ G__file_name(old_path, GV_DIRECTORY, in, mapset);
+ G__file_name(new_path, GV_DIRECTORY, out, G_mapset());
/* Open input */
Vect_set_open_level(1);
@@ -331,7 +331,7 @@
}
/* Move the directory */
- ret = G_rename(GRASS_VECT_DIRECTORY, in, out);
+ ret = G_rename(GV_DIRECTORY, in, out);
if (ret == 0) {
G_warning(_("Vector map <%s> not found"), in);
@@ -462,7 +462,7 @@
}
sprintf(buf, "%s/%s/%s/%s/%s/%s", G_gisdbase(), G_location(),
- G_mapset(), GRASS_VECT_DIRECTORY, map, GRASS_VECT_DBLN_ELEMENT);
+ G_mapset(), GV_DIRECTORY, map, GV_DBLN_ELEMENT);
G_debug(1, "dbln file: %s", buf);
Modified: grass/trunk/lib/vector/Vlib/merge_lines.c
===================================================================
--- grass/trunk/lib/vector/Vlib/merge_lines.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/merge_lines.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -51,7 +51,7 @@
struct ilist *List;
struct line_pnts *MPoints, *Points;
struct line_cats *MCats, *Cats;
- P_LINE *Line;
+ struct P_line *Line;
if ((type & GV_BOUNDARY) && (type & GV_LINE)) {
G_warning
Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/open.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,5 +1,5 @@
/*!
- * \file open.c
+ * \file vector/Vlib/open.c
*
* \brief Vector library - Open vector map
*
@@ -70,20 +70,20 @@
/*!
- * \brief Predetermine level at which a map will be opened for
+ * \brief Predetermine level at which a vector map will be opened for
* reading.
*
* If it can't open that level, the open will fail. The specified
- * level must be set before any call to open. The default is to try
- * to open the highest level possible, and keep stepping down until
+ * level must be set before any call to open. The default is to try to
+ * open the highest level possible, and keep stepping down until
* success.
*
- * NOTE!! This should only be used to set when you wish to force
- * a lower level open. If you require a higher level, then just
- * check the return to verify the level instead of forcing it.
- * This is because future releases will have higher levels which
- * will be downward compatible and which your programs should
- * support by default.
+ * NOTE: This should only be used to set when you wish to force a
+ * lower level open. If you require a higher level, then just check
+ * the return to verify the level instead of forcing it. This is
+ * because future releases will have higher levels which will be
+ * downward compatible and which your programs should support by
+ * default.
*
* \param level vector (topo) level
*
@@ -104,7 +104,6 @@
return 0;
}
-
/*!
* \brief Open old vector for reading.
*
@@ -128,11 +127,15 @@
FILE *fp;
int level, level_request, ferror;
int format, ret;
+ int ogr_mapset;
const char *fmapset;
- G_debug(1, "Vect_open_old(): name = %s mapset= %s update = %d", name,
+ G_debug(1, "Vect__open_old(): name = %s mapset= %s update = %d", name,
mapset, update);
+ /* zero Map_info structure */
+ G_zero(Map, sizeof(struct Map_info));
+
/* TODO: Open header for update ('dbln') */
ferror = Vect_get_fatal_error();
@@ -140,19 +143,31 @@
level_request = Open_level;
Open_level = 0;
+
+ /* initialize Map->head */
Vect__init_head(Map);
+ /* initialize Map->plus */
dig_init_plus(&(Map->plus));
+ ogr_mapset = 0;
if (G__name_is_fully_qualified(name, xname, xmapset)) {
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, xname);
- sprintf(buf2, "%s@%s", GRASS_VECT_COOR_ELEMENT, xmapset);
-
+ if (strcmp(xmapset, "OGR") == 0) {
+ /* unique OGR mapset detected */
+ G_debug(1, "OGR mapset detected");
+ ogr_mapset = 1;
+ Map->fInfo.ogr.dsn = xname;
+ Map->fInfo.ogr.layer_name = NULL; /* no layer to be open */
+ }
+ else {
+ sprintf(buf, "%s/%s", GV_DIRECTORY, xname);
+ sprintf(buf2, "%s@%s", GV_COOR_ELEMENT, xmapset);
+ }
Map->name = G_store(xname);
Map->mapset = G_store(xmapset);
}
else {
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, name);
- sprintf(buf2, "%s", GRASS_VECT_COOR_ELEMENT);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, name);
+ sprintf(buf2, "%s", GV_COOR_ELEMENT);
Map->name = G_store(name);
if (mapset)
@@ -172,7 +187,7 @@
Map->location = G_store(G_location());
Map->gisdbase = G_store(G_gisdbase());
-
+
if (update && (0 != strcmp(Map->mapset, G_mapset()))) {
G_warning(_("Vector map which is not in the current mapset cannot be opened for update"));
return -1;
@@ -182,32 +197,36 @@
G_debug(1, "Map mapset: %s", Map->mapset);
/* Read vector format information */
- format = 0;
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
- G_debug(1, "open format file: '%s/%s/%s'", Map->mapset, buf,
- GRASS_VECT_FRMT_ELEMENT);
- fp = G_fopen_old(buf, GRASS_VECT_FRMT_ELEMENT, Map->mapset);
- if (fp == NULL) {
- G_debug(1, "Vector format: %d (native)", format);
- format = GV_FORMAT_NATIVE;
+ if (ogr_mapset) {
+ format = GV_FORMAT_OGR;
}
else {
- format = dig_read_frmt_ascii(fp, &(Map->fInfo));
- fclose(fp);
-
- G_debug(1, "Vector format: %d (non-native)", format);
- if (format < 0) {
- sprintf(errmsg, _("Unable to open vector map <%s>"),
- Vect_get_full_name(Map));
- fatal_error(ferror, errmsg);
- return -1;
+ format = 0;
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
+ G_debug(1, "open format file: '%s/%s/%s'", Map->mapset, buf,
+ GV_FRMT_ELEMENT);
+ fp = G_fopen_old(buf, GV_FRMT_ELEMENT, Map->mapset);
+ if (fp == NULL) {
+ G_debug(1, "Vector format: %d (native)", format);
+ format = GV_FORMAT_NATIVE;
}
+ else {
+ format = dig_read_frmt_ascii(fp, &(Map->fInfo));
+ fclose(fp);
+
+ G_debug(1, "Vector format: %d (non-native)", format);
+ if (format < 0) {
+ sprintf(errmsg, _("Unable to open vector map <%s>"),
+ Vect_get_full_name(Map));
+ fatal_error(ferror, errmsg);
+ return -1;
+ }
+ }
}
-
Map->format = format;
-
+
/* Read vector head */
- if (Vect__read_head(Map) != GRASS_OK) {
+ if (!ogr_mapset && Vect__read_head(Map) != 0) {
sprintf(errmsg,
_("Unable to open vector map <%s> on level %d. "
"Try to rebuild vector topology by v.build."),
@@ -215,7 +234,7 @@
G_warning(_("Unable to read head file of vector <%s>"),
Vect_get_full_name(Map));
}
-
+
G_debug(1, "Level request = %d", level_request);
/* There are only 2 possible open levels, 1 and 2. Try first to open 'support' files
@@ -279,12 +298,19 @@
}
#endif
if (level_request == 2 && level < 2) {
- sprintf(errmsg,
- _("Unable to open vector map <%s> on level %d. "
- "Try to rebuild vector topology by v.build."),
- Vect_get_full_name(Map), level_request);
- fatal_error(ferror, errmsg);
- return -1;
+ if (ogr_mapset) {
+ G_warning(_("Topology level (2) is not supported when reading "
+ "OGR layers directly. For topology level "
+ "is required link to OGR layer via v.external command."));
+ }
+ else {
+ sprintf(errmsg,
+ _("Unable to open vector map <%s> on level %d. "
+ "Try to rebuild vector topology by v.build."),
+ Vect_get_full_name(Map), level_request);
+ fatal_error(ferror, errmsg);
+ return -1;
+ }
}
}
else {
@@ -348,10 +374,10 @@
Vect_read_dblinks(Map);
/* Open history file */
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
if (update) { /* native only */
- Map->hist_fp = G_fopen_modify(buf, GRASS_VECT_HIST_ELEMENT);
+ Map->hist_fp = G_fopen_modify(buf, GV_HIST_ELEMENT);
if (Map->hist_fp == NULL) {
sprintf(errmsg,
_("Unable to open history file for vector map <%s>"),
@@ -367,7 +393,7 @@
else {
if (Map->format == GV_FORMAT_NATIVE || Map->format == GV_FORMAT_OGR) {
Map->hist_fp =
- G_fopen_old(buf, GRASS_VECT_HIST_ELEMENT, Map->mapset);
+ G_fopen_old(buf, GV_HIST_ELEMENT, Map->mapset);
/* If NULL (does not exist) then Vect_hist_read() handle that */
}
else {
@@ -384,7 +410,7 @@
char file_path[2000];
struct stat info;
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, name);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, name);
G__file_name(file_path, buf, GV_TOPO_ELEMENT, G_mapset());
if (stat(file_path, &info) == 0) /* file exists? */
@@ -458,20 +484,19 @@
}
/*!
- * \brief Reads only info about vector from headers of 'head', 'dbln',
- * 'topo' and 'cidx' file.
+ * \brief Reads only info about vector map from headers of 'head',
+ * 'dbln', 'topo' and 'cidx' file.
*
* In case of error, the functions respect fatal error settings.
*
- * \param[out] Map vector map
+ * \param[out] Map pointer to Map_info structure
* \param name name of vector map to read
* \param mapset mapset name
*
* \return level of openness [1, 2, (3)]
* \return -1 on error
*/
-int
-Vect_open_old_head(struct Map_info *Map, const char *name, const char *mapset)
+int Vect_open_old_head(struct Map_info *Map, const char *name, const char *mapset)
{
return (Vect__open_old(Map, name, mapset, 0, 1));
}
@@ -513,9 +538,9 @@
/*!
* \brief Open new vector for reading/writing
*
- * \param[out] Map vector map
+ * \param[in,out] Map pointer to Map_info structure
* \param name name of vector map
- * \param with_z 2D/3D vector map
+ * \param with_z non-zero value for 3D vector data
*
* \return 1 on success
* \return -1 on error
@@ -576,8 +601,8 @@
}
/* Open history file */
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
- Map->hist_fp = G_fopen_new(buf, GRASS_VECT_HIST_ELEMENT);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
+ Map->hist_fp = G_fopen_new(buf, GV_HIST_ELEMENT);
if (Map->hist_fp == NULL) {
sprintf(errmsg, _("Unable to open history file for vector map <%s>"),
Vect_get_full_name(Map));
@@ -612,8 +637,8 @@
/*!
* \brief Update Coor_info structure
*
- * \param Map vector map
- * \param[out] Info Coor_info structure
+ * \param Map pointer to Map_info structure
+ * \param[out] Info pointer to Coor_info structure
*
* \return 1 on success
* \return 0 on error
@@ -625,8 +650,8 @@
switch (Map->format) {
case GV_FORMAT_NATIVE:
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
- G__file_name(path, buf, GRASS_VECT_COOR_ELEMENT, Map->mapset);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
+ G__file_name(path, buf, GV_COOR_ELEMENT, Map->mapset);
G_debug(1, "get coor info: %s", path);
if (0 != stat(path, &stat_buf)) {
G_warning(_("Unable to stat file <%s>"), path);
@@ -692,7 +717,7 @@
/*!
* \brief Open topo file
*
- * \param[in,out] Map vector map
+ * \param[in,out] Map pointer to Map_info structure
* \param head_only open only head
*
* \return 0 on success
@@ -703,7 +728,7 @@
{
int err, ret;
char buf[500], file_path[2000];
- GVFILE fp;
+ struct gvfile fp;
struct Coor_info CInfo;
struct Plus_head *Plus;
struct stat info;
@@ -713,7 +738,7 @@
Plus = &(Map->plus);
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
G__file_name(file_path, buf, GV_TOPO_ELEMENT, Map->mapset);
if (stat(file_path, &info) != 0) /* does not exist */
@@ -773,9 +798,9 @@
}
/*!
- * \brief Open spatial index file
+ * \brief Open spatial index file ('sidx')
*
- * \param[in,out] Map vector map
+ * \param[in,out] Map pointer to Map_info
* \param mode 0 old, 1 update, 2 new
*
* \return 0 on success
@@ -783,7 +808,7 @@
*/
int Vect_open_sidx(struct Map_info *Map, int mode)
{
- char buf[500], spidxbuf[500], file_path[2000];
+ char buf[500], file_path[2000];
int err;
struct Coor_info CInfo;
struct Plus_head *Plus;
@@ -793,7 +818,7 @@
Map->mapset, mode == 0 ? "old" : (mode == 1 ? "update" : "new"));
if (Map->plus.Spidx_built == 1) {
- G_warning("spatial index already opened");
+ G_warning("Spatial index already opened");
return 0;
}
@@ -802,7 +827,7 @@
dig_file_init(&(Map->plus.spidx_fp));
if (mode < 2) {
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
G__file_name(file_path, buf, GV_SIDX_ELEMENT, Map->mapset);
if (stat(file_path, &info) != 0) /* does not exist */
Modified: grass/trunk/lib/vector/Vlib/open_nat.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open_nat.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/open_nat.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -26,7 +26,7 @@
static char name_buf[GPATH_MAX];
static int check_coor(struct Map_info *Map);
-/**
+/*!
\brief Open existing vector map
Map->name and Map->mapset must be set before.
@@ -45,13 +45,13 @@
G_debug(1, "V1_open_old_nat(): name = %s mapset = %s", Map->name,
Map->mapset);
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
dig_file_init(&(Map->dig_fp));
if (update)
- Map->dig_fp.file = G_fopen_modify(buf, GRASS_VECT_COOR_ELEMENT);
+ Map->dig_fp.file = G_fopen_modify(buf, GV_COOR_ELEMENT);
else
Map->dig_fp.file =
- G_fopen_old(buf, GRASS_VECT_COOR_ELEMENT, Map->mapset);
+ G_fopen_old(buf, GV_COOR_ELEMENT, Map->mapset);
if (Map->dig_fp.file == NULL) {
G_warning(_("Unable to open coor file for vector map <%s>"), Map->name);
@@ -77,14 +77,13 @@
return 0;
}
-/**
- \brief Open/Create new vector map.
+/*!
+ \brief Open/Create new vector map (level 1)
- \param[out] Map pointer to vector map
+ \param[out] Map pointer to Map_info structure
\param name map name
\param with_z 2D or 3D (unused?)
-
\return 0 success
\return -1 error
*/
@@ -95,7 +94,7 @@
G_debug(1, "V1_open_new_nat(): name = %s", name);
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, name);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, name);
/* Set the 'coor' file version */
Map->head.Version_Major = GV_COOR_VER_MAJOR;
@@ -105,13 +104,13 @@
/* TODO open better */
dig_file_init(&(Map->dig_fp));
- Map->dig_fp.file = G_fopen_new(buf, GRASS_VECT_COOR_ELEMENT);
+ Map->dig_fp.file = G_fopen_new(buf, GV_COOR_ELEMENT);
if (Map->dig_fp.file == NULL)
return (-1);
fclose(Map->dig_fp.file);
dig_file_init(&(Map->dig_fp));
- Map->dig_fp.file = G_fopen_modify(buf, GRASS_VECT_COOR_ELEMENT);
+ Map->dig_fp.file = G_fopen_modify(buf, GV_COOR_ELEMENT);
if (Map->dig_fp.file == NULL)
return (-1);
@@ -120,7 +119,7 @@
if (stat(name_buf, &info) == 0) /* file exists? */
unlink(name_buf);
- G__file_name(name_buf, buf, GRASS_VECT_COOR_ELEMENT, G_mapset());
+ G__file_name(name_buf, buf, GV_COOR_ELEMENT, G_mapset());
Map->head.size = 0;
Map->head.head_size = GV_COOR_HEAD_SIZE + 4;
Modified: grass/trunk/lib/vector/Vlib/open_ogr.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open_ogr.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/open_ogr.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -27,7 +27,7 @@
#ifdef HAVE_OGR
#include <ogr_api.h>
-/**
+/*!
\brief Open existing vector map
Map->name and Map->mapset must be set before.
@@ -100,10 +100,10 @@
return (0);
}
-/**
+/*!
\brief Open OGR specific level 2 files (feature index)
- \param[out] Map pointer to vector map
+ \param[out] Map pointer to Map_info structure
\return 0 success
\return -1 error
@@ -113,15 +113,15 @@
char elem[GPATH_MAX];
char buf[5]; /* used for format version */
long length;
- GVFILE fp;
+ struct gvfile fp;
struct Port_info port;
int Version_Major, Version_Minor, Back_Major, Back_Minor, byte_order;
G_debug(3, "V2_open_old_ogr()");
- sprintf(elem, "%s/%s", GRASS_VECT_DIRECTORY, Map->name);
+ sprintf(elem, "%s/%s", GV_DIRECTORY, Map->name);
dig_file_init(&fp);
- fp.file = G_fopen_old(elem, "fidx", Map->mapset);
+ fp.file = G_fopen_old(elem, GV_FIDX_ELEMENT, Map->mapset);
if (fp.file == NULL) {
G_warning(_("Unable to open fidx file for vector map <%s@%s>"),
Map->name, Map->mapset);
Modified: grass/trunk/lib/vector/Vlib/poly.c
===================================================================
--- grass/trunk/lib/vector/Vlib/poly.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/poly.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -370,7 +370,7 @@
int area,
double cent_x, double cent_y)
{
- P_AREA *Area;
+ struct P_area *Area;
static struct line_pnts *TPoints;
static int first_time = 1;
int isle;
@@ -698,8 +698,8 @@
int i, line;
static struct line_pnts *Points;
const struct Plus_head *Plus;
- P_LINE *Line;
- P_AREA *Area;
+ struct P_line *Line;
+ struct P_area *Area;
G_debug(3, "Vect_point_in_area_outer_ring(): x = %f y = %f area = %d", X,
Y, area);
@@ -762,8 +762,8 @@
int i, line;
static struct line_pnts *Points;
const struct Plus_head *Plus;
- P_LINE *Line;
- P_ISLE *Isle;
+ struct P_line *Line;
+ struct P_isle *Isle;
G_debug(3, "Vect_point_in_island(): x = %f y = %f isle = %d", X, Y, isle);
Modified: grass/trunk/lib/vector/Vlib/read_nat.c
===================================================================
--- grass/trunk/lib/vector/Vlib/read_nat.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/read_nat.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -68,7 +68,7 @@
{
int itype;
off_t offset;
- BOUND_BOX lbox, mbox;
+ struct bound_box lbox, mbox;
G_debug(3, "V1_read_next_line_nat()");
@@ -122,7 +122,7 @@
V2_read_line_nat(struct Map_info *Map,
struct line_pnts *line_p, struct line_cats *line_c, int line)
{
- P_LINE *Line;
+ struct P_line *Line;
G_debug(3, "V2_read_line_nat(): line = %d", line);
@@ -153,8 +153,8 @@
struct line_pnts *line_p, struct line_cats *line_c)
{
register int line;
- register P_LINE *Line;
- BOUND_BOX lbox, mbox;
+ register struct P_line *Line;
+ struct bound_box lbox, mbox;
G_debug(3, "V2_read_next_line_nat()");
Modified: grass/trunk/lib/vector/Vlib/read_ogr.c
===================================================================
--- grass/trunk/lib/vector/Vlib/read_ogr.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/read_ogr.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -141,7 +141,7 @@
struct line_cats *line_c)
{
int itype;
- BOUND_BOX lbox, mbox;
+ struct bound_box lbox, mbox;
OGRFeatureH hFeature;
OGRGeometryH hGeom;
@@ -325,8 +325,8 @@
int node;
int offset;
long FID;
- P_LINE *Line;
- P_NODE *Node;
+ struct P_line *Line;
+ struct P_node *Node;
OGRGeometryH hGeom;
G_debug(4, "V2_read_line_ogr() line = %d", line);
Modified: grass/trunk/lib/vector/Vlib/remove_duplicates.c
===================================================================
--- grass/trunk/lib/vector/Vlib/remove_duplicates.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/remove_duplicates.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -39,7 +39,7 @@
struct line_cats *ACats, *BCats, *Cats;
int i, j, c, atype, btype, bline;
int nlines, nbcats_orig;
- BOUND_BOX ABox;
+ struct bound_box ABox;
struct ilist *List;
int ndupl;
Modified: grass/trunk/lib/vector/Vlib/select.c
===================================================================
--- grass/trunk/lib/vector/Vlib/select.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/select.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -30,7 +30,7 @@
\return void
*/
-void Vect_spatial_index_init(SPATIAL_INDEX * si, int with_z)
+void Vect_spatial_index_init(struct spatial_index * si, int with_z)
{
G_debug(1, "Vect_spatial_index_init()");
@@ -46,7 +46,7 @@
\return void
*/
-void Vect_spatial_index_destroy(SPATIAL_INDEX * si)
+void Vect_spatial_index_destroy(struct spatial_index * si)
{
G_debug(1, "Vect_spatial_index_destroy()");
@@ -62,8 +62,8 @@
\return void
*/
-void Vect_spatial_index_add_item(SPATIAL_INDEX * si, int id,
- const BOUND_BOX * box)
+void Vect_spatial_index_add_item(struct spatial_index * si, int id,
+ const struct bound_box * box)
{
struct Rect rect;
@@ -86,8 +86,8 @@
\return void
*/
-void Vect_spatial_index_del_item(SPATIAL_INDEX * si, int id,
- const BOUND_BOX * box)
+void Vect_spatial_index_del_item(struct spatial_index * si, int id,
+ const struct bound_box * box)
{
int ret;
struct Rect rect;
@@ -125,7 +125,7 @@
\return number of selected items
*/
int
-Vect_spatial_index_select(const SPATIAL_INDEX * si, const BOUND_BOX * box,
+Vect_spatial_index_select(const struct spatial_index * si, const struct bound_box * box,
struct ilist *list)
{
struct Rect rect;
Modified: grass/trunk/lib/vector/Vlib/sindex.c
===================================================================
--- grass/trunk/lib/vector/Vlib/sindex.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/sindex.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -32,12 +32,12 @@
\return number of lines
*/
int
-Vect_select_lines_by_box(struct Map_info *Map, const BOUND_BOX * Box,
+Vect_select_lines_by_box(struct Map_info *Map, const struct bound_box * Box,
int type, struct ilist *list)
{
int i, line, nlines;
struct Plus_head *plus;
- P_LINE *Line;
+ struct P_line *Line;
static struct ilist *LocList = NULL;
G_debug(3, "Vect_select_lines_by_box()");
@@ -86,7 +86,7 @@
\return number of areas
*/
int
-Vect_select_areas_by_box(struct Map_info *Map, const BOUND_BOX * Box,
+Vect_select_areas_by_box(struct Map_info *Map, const struct bound_box * Box,
struct ilist *list)
{
int i;
@@ -137,7 +137,7 @@
\return number of isles
*/
int
-Vect_select_isles_by_box(struct Map_info *Map, const BOUND_BOX * Box,
+Vect_select_isles_by_box(struct Map_info *Map, const struct bound_box * Box,
struct ilist *list)
{
G_debug(3, "Vect_select_isles_by_box()");
@@ -165,7 +165,7 @@
\return number of nodes
*/
int
-Vect_select_nodes_by_box(struct Map_info *Map, const BOUND_BOX * Box,
+Vect_select_nodes_by_box(struct Map_info *Map, const struct bound_box * Box,
struct ilist *list)
{
struct Plus_head *plus;
@@ -209,7 +209,7 @@
struct ilist *List)
{
int i;
- BOUND_BOX box;
+ struct bound_box box;
static struct line_pnts *LPoints = NULL;
static struct ilist *LocList = NULL;
Modified: grass/trunk/lib/vector/Vlib/tin.c
===================================================================
--- grass/trunk/lib/vector/Vlib/tin.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/tin.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -34,7 +34,7 @@
{
int i, area, n_points;
struct Plus_head *Plus;
- P_AREA *Area;
+ struct P_area *Area;
static struct line_pnts *Points;
static int first_time = 1;
double *x, *y, *z;
Modified: grass/trunk/lib/vector/Vlib/write_nat.c
===================================================================
--- grass/trunk/lib/vector/Vlib/write_nat.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/Vlib/write_nat.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -39,7 +39,7 @@
static void delete_area_cats_from_cidx(struct Map_info *Map, int area)
{
int i;
- P_AREA *Area;
+ struct P_area *Area;
static struct line_cats *Cats = NULL;
G_debug(3, "delete_area_cats_from_cidx() area = %d", area);
@@ -72,7 +72,7 @@
static void add_area_cats_to_cidx(struct Map_info *Map, int area)
{
int i;
- P_AREA *Area;
+ struct P_area *Area;
static struct line_cats *Cats = NULL;
G_debug(3, "add_area_cats_to_cidx() area = %d", area);
@@ -134,11 +134,11 @@
int type, node, next_line, area, side, sel_area, new_area[2];
struct Plus_head *plus;
- P_LINE *Line, *NLine;
- P_NODE *Node;
- P_AREA *Area;
+ struct P_line *Line, *NLine;
+ struct P_node *Node;
+ struct P_area *Area;
- BOUND_BOX box, abox;
+ struct bound_box box, abox;
plus = &(Map->plus);
Line = plus->Line[line];
@@ -342,7 +342,7 @@
int line;
off_t offset;
struct Plus_head *plus;
- BOUND_BOX box;
+ struct bound_box box;
line = 0;
@@ -491,7 +491,7 @@
int i, n_points;
char rhead, nc;
short field;
- GVFILE *dig_fp;
+ struct gvfile *dig_fp;
dig_set_cur_port(&(Map->head.port));
dig_fp = &(Map->dig_fp);
@@ -583,7 +583,7 @@
int V1_delete_line_nat(struct Map_info *Map, off_t offset)
{
char rhead;
- GVFILE *dig_fp;
+ struct gvfile *dig_fp;
G_debug(3, "V1_delete_line_nat(), offset = %lu", (unsigned long) offset);
@@ -623,10 +623,10 @@
int V2_delete_line_nat(struct Map_info *Map, int line)
{
int ret, i, side, type = 0, first = 0, next_line, area;
- P_LINE *Line = NULL;
- P_AREA *Area;
+ struct P_line *Line = NULL;
+ struct P_area *Area;
struct Plus_head *plus;
- BOUND_BOX box, abox;
+ struct bound_box box, abox;
int adjacent[4], n_adjacent = 0;
static struct line_cats *Cats = NULL;
@@ -822,7 +822,7 @@
int V1_restore_line_nat(struct Map_info *Map, off_t offset)
{
char rhead;
- GVFILE *dig_fp;
+ struct gvfile *dig_fp;
G_debug(3, "V1_restore_line_nat(), offset = %lu", (unsigned long) offset);
@@ -865,9 +865,9 @@
int V2_restore_line_nat(struct Map_info *Map, int line, off_t offset)
{
int i, ret, type;
- P_LINE *Line;
+ struct P_line *Line;
struct Plus_head *plus;
- BOUND_BOX box;
+ struct bound_box box;
static struct line_pnts *points = NULL;
static struct line_cats *cats = NULL;
Modified: grass/trunk/lib/vector/dglib/graph.h
===================================================================
--- grass/trunk/lib/vector/dglib/graph.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/dglib/graph.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -20,8 +20,8 @@
* best view tabstop=4
*/
-#ifndef _DGL_GRAPH_H_
-#define _DGL_GRAPH_H_
+#ifndef _DGL_dglGraph_s_H_
+#define _DGL_dglGraph_s_H_
#ifdef DGL_STATS
#include <time.h>
Modified: grass/trunk/lib/vector/dglib/graph_v1.h
===================================================================
--- grass/trunk/lib/vector/dglib/graph_v1.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/dglib/graph_v1.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -20,8 +20,8 @@
* best view tabstop=4
*/
-#ifndef _DGL_GRAPH_V1_H_
-#define _DGL_GRAPH_V1_H_
+#ifndef _DGL_dglGraph_s_V1_H_
+#define _DGL_dglGraph_s_V1_H_
#ifdef DGL_STATS
#include <time.h>
Modified: grass/trunk/lib/vector/dglib/graph_v2.h
===================================================================
--- grass/trunk/lib/vector/dglib/graph_v2.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/dglib/graph_v2.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -20,8 +20,8 @@
* best view tabstop=4
*/
-#ifndef _DGL_GRAPH_V2_H_
-#define _DGL_GRAPH_V2_H_
+#ifndef _DGL_dglGraph_s_V2_H_
+#define _DGL_dglGraph_s_V2_H_
#ifdef DGL_STATS
#include <time.h>
Modified: grass/trunk/lib/vector/diglib/box.c
===================================================================
--- grass/trunk/lib/vector/diglib/box.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/box.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -22,7 +22,7 @@
* dig_line_box ()
* set box to points extent
*/
-int dig_line_box(const struct line_pnts *Points, BOUND_BOX * Box)
+int dig_line_box(const struct line_pnts *Points, struct bound_box * Box)
{
int i;
@@ -67,7 +67,7 @@
* dig_box_copy ()
* Copy B to A.
*/
-int dig_box_copy(BOUND_BOX * A, BOUND_BOX * B)
+int dig_box_copy(struct bound_box * A, struct bound_box * B)
{
A->N = B->N;
@@ -84,7 +84,7 @@
* dig_box_extend ()
* Extend A by B.
*/
-int dig_box_extend(BOUND_BOX * A, BOUND_BOX * B)
+int dig_box_extend(struct bound_box * A, struct bound_box * B)
{
if (B->N > A->N)
Modified: grass/trunk/lib/vector/diglib/cindex.c
===================================================================
--- grass/trunk/lib/vector/diglib/cindex.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/cindex.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -20,12 +20,13 @@
#include <grass/gis.h>
#include <grass/vector.h>
-/*
- * dig_cidx_init ()
- * initit cat index
+/*!
+ * \brief Initialize Plus_head structure (cidx)
*
- * returns 1 OK
- * 0 on error
+ * \param Plus pointer to Plus_head structure
+ *
+ * \return 1 OK
+ * \return 0 on error
*/
int dig_cidx_init(struct Plus_head *Plus)
{
Modified: grass/trunk/lib/vector/diglib/cindex_rw.c
===================================================================
--- grass/trunk/lib/vector/diglib/cindex_rw.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/cindex_rw.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -21,7 +21,7 @@
#include <grass/gis.h>
#include <grass/vector.h>
-int dig_write_cidx_head(GVFILE * fp, struct Plus_head *plus)
+int dig_write_cidx_head(struct gvfile * fp, struct Plus_head *plus)
{
int i;
unsigned char buf[5];
@@ -110,8 +110,16 @@
return (0);
}
-/* return: 0 OK, -1 error */
-int dig_read_cidx_head(GVFILE * fp, struct Plus_head *plus)
+/*!
+ \brief Read header of cidx file
+
+ \param fp pointer to gvfile structure
+ \param plus pointer to Plus_head strcuture
+
+ \return 0 OK
+ \return -1 error
+*/
+int dig_read_cidx_head(struct gvfile * fp, struct Plus_head *plus)
{
unsigned char buf[5];
int i, byte_order;
@@ -232,7 +240,7 @@
}
/* Write spatial index */
-int dig_write_cidx(GVFILE * fp, struct Plus_head *plus)
+int dig_write_cidx(struct gvfile * fp, struct Plus_head *plus)
{
int i;
@@ -266,11 +274,17 @@
return 0;
}
-/* Read spatial index file
- * returns 0 - OK
- * 1 - error
- */
-int dig_read_cidx(GVFILE * fp, struct Plus_head *plus, int head_only)
+/*!
+ \brief Read spatial index file
+
+ \param fp pointer to gvfile structure
+ \param[in,out] plus pointer to Plus_head structure
+ \param head_only non-zero to read only head
+
+ \return 0 OK
+ \return 1 error
+*/
+int dig_read_cidx(struct gvfile * fp, struct Plus_head *plus, int head_only)
{
int i;
Modified: grass/trunk/lib/vector/diglib/file.c
===================================================================
--- grass/trunk/lib/vector/diglib/file.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/file.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -29,13 +29,13 @@
#include <grass/glocale.h>
/*!
- \brief Get GVFILE position.
+ \brief Get struct gvfile position.
- \param file pointer to GVFILE structure
+ \param file pointer to struct gvfile structure
\return current file position
*/
-off_t dig_ftell(GVFILE *file)
+off_t dig_ftell(struct gvfile *file)
{
if (file->loaded) /* using memory */
return (file->current - file->start);
@@ -44,7 +44,7 @@
}
/*!
- \brief Set GVFILE position.
+ \brief Set struct gvfile position.
Start positions:
@@ -52,14 +52,14 @@
- SEEK_CUR (current position)
- SEEK_END (end)
- \param file pointer to GVFILE structure
+ \param file pointer to struct gvfile structure
\param offset offset position
\param whence start position
\return 0 OK
\return -1 error
*/
-int dig_fseek(GVFILE * file, off_t offset, int whence)
+int dig_fseek(struct gvfile * file, off_t offset, int whence)
{
if (file->loaded) { /* using memory */
switch (whence) {
@@ -82,11 +82,11 @@
}
/*!
- \brief Rewind GVFILE position.
+ \brief Rewind file position.
- \param file pointer to GVFILE structure
+ \param file pointer to gvfile structure
*/
-void dig_rewind(GVFILE * file)
+void dig_rewind(struct gvfile * file)
{
if (file->loaded) { /* using memory */
file->current = file->start;
@@ -97,13 +97,13 @@
}
/*!
- \brief Flush GVFILE.
+ \brief Flush struct gvfile.
- \param file pointer to GVFILE structure
+ \param file pointer to struct gvfile structure
\return 0
*/
-int dig_fflush(GVFILE * file)
+int dig_fflush(struct gvfile * file)
{
if (file->loaded) { /* using memory */
return 0;
@@ -114,16 +114,16 @@
}
/*!
- \brief Read GVFILE.
+ \brief Read struct gvfile.
\param[out] ptr data buffer
\param size buffer size
\param nmemb number of members
- \param file pointer to GVFILE structure
+ \param file pointer to struct gvfile structure
\return number of read members
*/
-size_t dig_fread(void *ptr, size_t size, size_t nmemb, GVFILE *file)
+size_t dig_fread(void *ptr, size_t size, size_t nmemb, struct gvfile *file)
{
long tot;
size_t cnt;
@@ -146,16 +146,16 @@
}
/*!
- \brief Write GVFILE.
+ \brief Write struct gvfile.
\param ptr data buffer
\param size buffer size
\param nmemb number of members
- \param[out] file pointer to GVFILE structure
+ \param[out] file pointer to struct gvfile structure
\return number of items written
*/
-size_t dig_fwrite(const void *ptr, size_t size, size_t nmemb, GVFILE *file)
+size_t dig_fwrite(const void *ptr, size_t size, size_t nmemb, struct gvfile *file)
{
if (file->loaded) { /* using memory */
G_fatal_error(_("Writing to file loaded to memory not supported"));
@@ -165,11 +165,11 @@
}
/*!
- \brief Initialize GVFILE.
+ \brief Initialize gvfile strcuture
- \param[out] file pointer to GVFILE structure
+ \param[in,out] file pointer to gvfile structure
*/
-void dig_file_init(GVFILE *file)
+void dig_file_init(struct gvfile *file)
{
file->file = NULL;
file->start = NULL;
@@ -181,17 +181,17 @@
}
/*!
- \brief Load opened GVFILE to memory.
+ \brief Load opened struct gvfile to memory.
Warning: position in file is set to the beginning.
- \param file pointer to GVFILE structure
+ \param file pointer to struct gvfile structure
\return 1 loaded
\return 0 not loaded
\return -1 error
*/
-int dig_file_load(GVFILE * file)
+int dig_file_load(struct gvfile * file)
{
int ret, mode, load;
const char *cmode;
@@ -266,11 +266,11 @@
}
/*!
- \brief Free GVFILE.
+ \brief Free struct gvfile.
- \param file pointer to GVFILE structure
+ \param file pointer to struct gvfile structure
*/
-void dig_file_free(GVFILE * file)
+void dig_file_free(struct gvfile * file)
{
if (file->loaded) {
G_free(file->start);
Modified: grass/trunk/lib/vector/diglib/frmt.c
===================================================================
--- grass/trunk/lib/vector/diglib/frmt.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/frmt.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -20,11 +20,15 @@
#include <grass/vector.h>
#include <grass/gis.h>
-/* Read vector format.
- *
- * Returns: format number
- * -1 on error
- */
+/*!
+ \brief Read external vector format file
+
+ \param dascii format file (frmt)
+ \param[out] finfo pointer to Format_info structure
+
+ \return format code
+ \return -1 on error
+*/
int dig_read_frmt_ascii(FILE * dascii, struct Format_info *finfo)
{
char buff[20001], buf1[1024];
Modified: grass/trunk/lib/vector/diglib/inside.c
===================================================================
--- grass/trunk/lib/vector/diglib/inside.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/inside.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -30,7 +30,7 @@
return (a + b * Y);
}
-int dig_in_area_bbox(P_AREA * Area, double x, double y)
+int dig_in_area_bbox(struct P_area * Area, double x, double y)
{
#ifdef GDEBUG
G_debug(3, "BBOX: (x,y) (%lf, %lf)\n", x, y);
Modified: grass/trunk/lib/vector/diglib/plus.c
===================================================================
--- grass/trunk/lib/vector/diglib/plus.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/plus.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -24,7 +24,7 @@
#include <grass/glocale.h>
/*!
- * \brief Init head structure
+ * \brief Initialize Plus_head structure
*
* \param[in,out] Plus pointer to Plus_head structure
*
@@ -109,7 +109,7 @@
void dig_free_plus_nodes(struct Plus_head *Plus)
{
int i;
- P_NODE *Node;
+ struct P_node *Node;
G_debug(2, "dig_free_plus_nodes()");
@@ -137,7 +137,7 @@
void dig_free_plus_lines(struct Plus_head *Plus)
{
int i;
- P_LINE *Line;
+ struct P_line *Line;
G_debug(2, "dig_free_plus_lines()");
@@ -173,7 +173,7 @@
void dig_free_plus_areas(struct Plus_head *Plus)
{
int i;
- P_AREA *Area;
+ struct P_area *Area;
G_debug(2, "dig_free_plus_areas()");
@@ -201,7 +201,7 @@
void dig_free_plus_isles(struct Plus_head *Plus)
{
int i;
- P_ISLE *Isle;
+ struct P_isle *Isle;
G_debug(2, "dig_free_plus_isles()");
@@ -250,7 +250,7 @@
* \return 1 on success
* \return 0 on error
*/
-int dig_load_plus(struct Plus_head *Plus, GVFILE * plus, int head_only)
+int dig_load_plus(struct Plus_head *Plus, struct gvfile * plus, int head_only)
{
int i;
@@ -325,7 +325,7 @@
* \return 0 on success
* \return -1 on error
*/
-int dig_write_plus_file(GVFILE * fp_plus, struct Plus_head *Plus)
+int dig_write_plus_file(struct gvfile * fp_plus, struct Plus_head *Plus)
{
dig_set_cur_port(&(Plus->port));
@@ -375,7 +375,7 @@
* \return 0 on success
* \return -1 on error
*/
-int dig_write_nodes(GVFILE * plus, struct Plus_head *Plus)
+int dig_write_nodes(struct gvfile * plus, struct Plus_head *Plus)
{
int i;
@@ -399,7 +399,7 @@
* \return 0 on success
* \return -1 on error
*/
-int dig_write_lines(GVFILE * plus, struct Plus_head *Plus)
+int dig_write_lines(struct gvfile * plus, struct Plus_head *Plus)
{
int i;
@@ -424,7 +424,7 @@
* \return 0 on success
* \return -1 on error
*/
-int dig_write_areas(GVFILE * plus, struct Plus_head *Plus)
+int dig_write_areas(struct gvfile * plus, struct Plus_head *Plus)
{
int i;
@@ -449,7 +449,7 @@
* \return 0 on success
* \return -1 on error
*/
-int dig_write_isles(GVFILE * plus, struct Plus_head *Plus)
+int dig_write_isles(struct gvfile * plus, struct Plus_head *Plus)
{
int i;
Modified: grass/trunk/lib/vector/diglib/plus_area.c
===================================================================
--- grass/trunk/lib/vector/diglib/plus_area.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/plus_area.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -56,7 +56,7 @@
char *p;
static int array_size; /* 0 on startup */
int n_lines;
- P_LINE *Line;
+ struct P_line *Line;
int node;
const char *dstr;
int debug_level;
@@ -175,9 +175,9 @@
{
register int i;
register int area, line;
- P_AREA *Area;
- P_LINE *Line;
- BOUND_BOX box, abox;
+ struct P_area *Area;
+ struct P_line *Line;
+ struct bound_box box, abox;
G_debug(3, "dig_add_area():");
/* First look if we have space in array of pointers to areas
@@ -254,7 +254,7 @@
int dig_area_add_isle(struct Plus_head *plus, int area, int isle)
{
int i;
- P_AREA *Area;
+ struct P_area *Area;
G_debug(3, "dig_area_add_isle(): area = %d isle = %d", area, isle);
@@ -291,7 +291,7 @@
int dig_area_del_isle(struct Plus_head *plus, int area, int isle)
{
int i, mv;
- P_AREA *Area;
+ struct P_area *Area;
G_debug(3, "dig_area_del_isle(): area = %d isle = %d", area, isle);
@@ -344,9 +344,9 @@
int i, line;
/* int isle, area_out; */
- P_AREA *Area;
- P_LINE *Line;
- P_ISLE *Isle;
+ struct P_area *Area;
+ struct P_line *Line;
+ struct P_isle *Isle;
G_debug(3, "dig_del_area() area = %d", area);
Area = plus->Area[area];
@@ -440,9 +440,9 @@
*
* \return 1
*/
-int dig_area_set_box(struct Plus_head *plus, plus_t area, BOUND_BOX * Box)
+int dig_area_set_box(struct Plus_head *plus, plus_t area, struct bound_box * Box)
{
- P_AREA *Area;
+ struct P_area *Area;
Area = plus->Area[area];
@@ -480,8 +480,8 @@
int current;
int line;
plus_t node;
- P_NODE *Node;
- P_LINE *Line;
+ struct P_node *Node;
+ struct P_line *Line;
const char *dstr;
int debug_level;
@@ -582,7 +582,7 @@
int next, prev;
float angle1, angle2;
plus_t node;
- P_LINE *Line;
+ struct P_line *Line;
G_debug(3, "dig_node_angle_check: line = %d, type = %d", line, type);
@@ -637,9 +637,9 @@
{
register int i;
register int isle, line;
- P_ISLE *Isle;
- P_LINE *Line;
- BOUND_BOX box, abox;
+ struct P_isle *Isle;
+ struct P_line *Line;
+ struct bound_box box, abox;
G_debug(3, "dig_add_isle():");
/* First look if we have space in array of pointers to isles
@@ -719,9 +719,9 @@
*
* \return 1
*/
-int dig_isle_set_box(struct Plus_head *plus, plus_t isle, BOUND_BOX * Box)
+int dig_isle_set_box(struct Plus_head *plus, plus_t isle, struct bound_box * Box)
{
- P_ISLE *Isle;
+ struct P_isle *Isle;
Isle = plus->Isle[isle];
@@ -748,8 +748,8 @@
int dig_del_isle(struct Plus_head *plus, int isle)
{
int i, line;
- P_LINE *Line;
- P_ISLE *Isle;
+ struct P_line *Line;
+ struct P_isle *Isle;
G_debug(3, "dig_del_isle() isle = %d", isle);
Isle = plus->Isle[isle];
Modified: grass/trunk/lib/vector/diglib/plus_line.c
===================================================================
--- grass/trunk/lib/vector/diglib/plus_line.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/plus_line.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -23,8 +23,8 @@
off_t offset)
{
int node, lp;
- P_LINE *line;
- BOUND_BOX box;
+ struct P_line *line;
+ struct bound_box box;
plus->Line[lineid] = dig_alloc_line();
line = plus->Line[lineid];
@@ -185,8 +185,8 @@
int dig_del_line(struct Plus_head *plus, int line)
{
int i, mv;
- P_LINE *Line;
- P_NODE *Node;
+ struct P_line *Line;
+ struct P_node *Node;
G_debug(3, "dig_del_line() line = %d", line);
@@ -266,7 +266,7 @@
*/
plus_t dig_line_get_area(struct Plus_head * plus, plus_t line, int side)
{
- P_LINE *Line;
+ struct P_line *Line;
Line = plus->Line[line];
if (side == GV_LEFT) {
@@ -299,7 +299,7 @@
int
dig_line_set_area(struct Plus_head *plus, plus_t line, int side, plus_t area)
{
- P_LINE *Line;
+ struct P_line *Line;
Line = plus->Line[line];
if (side == GV_LEFT) {
@@ -321,9 +321,9 @@
*
* \return 1
*/
-int dig_line_set_box(struct Plus_head *plus, plus_t line, BOUND_BOX * Box)
+int dig_line_set_box(struct Plus_head *plus, plus_t line, struct bound_box * Box)
{
- P_LINE *Line;
+ struct P_line *Line;
Line = plus->Line[line];
@@ -346,9 +346,9 @@
*
* \return 1
*/
-int dig_line_get_box(struct Plus_head *plus, plus_t line, BOUND_BOX * Box)
+int dig_line_get_box(struct Plus_head *plus, plus_t line, struct bound_box * Box)
{
- P_LINE *Line;
+ struct P_line *Line;
Line = plus->Line[line];
Modified: grass/trunk/lib/vector/diglib/plus_node.c
===================================================================
--- grass/trunk/lib/vector/diglib/plus_node.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/plus_node.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -46,7 +46,7 @@
register int i, j, nlines;
float angle;
int ret;
- P_NODE *node;
+ struct P_node *node;
G_debug(3, "dig_node_add_line(): node = %d line = %d", nodeid, lineid);
@@ -107,7 +107,7 @@
int dig_add_node(struct Plus_head *plus, double x, double y, double z)
{
int nnum;
- P_NODE *node;
+ struct P_node *node;
/* First look if we have space in array of pointers to nodes
* and reallocate if necessary */
@@ -155,7 +155,7 @@
register int have_match;
int winner;
double least_dist, dist;
- P_NODE *node;
+ struct P_node *node;
first_time = 1;
have_match = 0;
@@ -203,7 +203,7 @@
float dig_node_line_angle(struct Plus_head *plus, int nodeid, int lineid)
{
int i, nlines;
- P_NODE *node;
+ struct P_node *node;
G_debug(3, "dig_node_line_angle: node = %d line = %d", nodeid, lineid);
Modified: grass/trunk/lib/vector/diglib/plus_struct.c
===================================================================
--- grass/trunk/lib/vector/diglib/plus_struct.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/plus_struct.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -48,10 +48,10 @@
* plus_t is changed to a type that is larger than an int.
*/
-int dig_Rd_P_node(struct Plus_head *Plus, int n, GVFILE * fp)
+int dig_Rd_P_node(struct Plus_head *Plus, int n, struct gvfile * fp)
{
int cnt, n_edges;
- P_NODE *ptr;
+ struct P_node *ptr;
G_debug(3, "dig_Rd_P_node()");
@@ -102,10 +102,10 @@
return (0);
}
-int dig_Wr_P_node(struct Plus_head *Plus, int n, GVFILE * fp)
+int dig_Wr_P_node(struct Plus_head *Plus, int n, struct gvfile * fp)
{
int i, n_edges = 0;
- P_NODE *ptr;
+ struct P_node *ptr;
G_debug(3, "dig_Wr_P_node()");
ptr = Plus->Node[n];
@@ -147,12 +147,12 @@
return (0);
}
-int dig_Rd_P_line(struct Plus_head *Plus, int n, GVFILE * fp)
+int dig_Rd_P_line(struct Plus_head *Plus, int n, struct gvfile * fp)
{
int n_edges, vol;
char tp;
- P_LINE *ptr;
- P_NODE *Node;
+ struct P_line *ptr;
+ struct P_node *Node;
G_debug(3, "dig_Rd_P_line()");
@@ -251,11 +251,11 @@
return (0);
}
-int dig_Wr_P_line(struct Plus_head *Plus, int n, GVFILE * fp)
+int dig_Wr_P_line(struct Plus_head *Plus, int n, struct gvfile * fp)
{
int n_edges = 0, vol = 0;
char ch;
- P_LINE *ptr;
+ struct P_line *ptr;
G_debug(4, "dig_Wr_P_line() line = %d", n);
@@ -339,10 +339,10 @@
return (0);
}
-int dig_Rd_P_area(struct Plus_head *Plus, int n, GVFILE * fp)
+int dig_Rd_P_area(struct Plus_head *Plus, int n, struct gvfile * fp)
{
int cnt;
- P_AREA *ptr;
+ struct P_area *ptr;
#ifdef GDEBUG
G_debug(3, "dig_Rd_P_area(): n = %d", n);
@@ -408,10 +408,10 @@
return (0);
}
-int dig_Wr_P_area(struct Plus_head *Plus, int n, GVFILE * fp)
+int dig_Wr_P_area(struct Plus_head *Plus, int n, struct gvfile * fp)
{
int i;
- P_AREA *ptr;
+ struct P_area *ptr;
ptr = Plus->Area[n];
@@ -462,10 +462,10 @@
return (0);
}
-int dig_Rd_P_isle(struct Plus_head *Plus, int n, GVFILE * fp)
+int dig_Rd_P_isle(struct Plus_head *Plus, int n, struct gvfile * fp)
{
int cnt;
- P_ISLE *ptr;
+ struct P_isle *ptr;
#ifdef GDEBUG
G_debug(3, "dig_Rd_P_isle()");
@@ -520,10 +520,10 @@
return (0);
}
-int dig_Wr_P_isle(struct Plus_head *Plus, int n, GVFILE * fp)
+int dig_Wr_P_isle(struct Plus_head *Plus, int n, struct gvfile * fp)
{
int i;
- P_ISLE *ptr;
+ struct P_isle *ptr;
ptr = Plus->Isle[n];
@@ -566,11 +566,16 @@
return (0);
}
-/*
- \return -1 error
- \return 0 OK
- */
-int dig_Rd_Plus_head(GVFILE * fp, struct Plus_head *ptr)
+/*!
+ \brief Read Plus_head from file
+
+ \param fp pointer to gvfile structure
+ \param[in,out] ptr pointer to Plus_head structure
+
+ \return -1 error
+ \return 0 OK
+*/
+int dig_Rd_Plus_head(struct gvfile * fp, struct Plus_head *ptr)
{
unsigned char buf[5];
int byte_order;
@@ -614,6 +619,7 @@
ptr->Version_Major, ptr->Version_Minor);
}
+ /* init Port_info structure and set as default */
dig_init_portable(&(ptr->port), byte_order);
dig_set_cur_port(&(ptr->port));
@@ -714,7 +720,7 @@
return (0);
}
-int dig_Wr_Plus_head(GVFILE * fp, struct Plus_head *ptr)
+int dig_Wr_Plus_head(struct gvfile * fp, struct Plus_head *ptr)
{
unsigned char buf[10];
long length = 142;
Modified: grass/trunk/lib/vector/diglib/port_init.c
===================================================================
--- grass/trunk/lib/vector/diglib/port_init.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/port_init.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -178,7 +178,7 @@
}
/*!
- \brief Initialize structures
+ \brief Initialize Port_info structures
*/
void port_init(void)
{
Modified: grass/trunk/lib/vector/diglib/portable.c
===================================================================
--- grass/trunk/lib/vector/diglib/portable.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/portable.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -73,12 +73,12 @@
\param[out] buf data buffer
\param cnt number of members
- \param fp pointer to GVFILE
+ \param fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
-int dig__fread_port_D(double *buf, size_t cnt, GVFILE * fp)
+int dig__fread_port_D(double *buf, size_t cnt, struct gvfile * fp)
{
unsigned int i, j;
int ret;
@@ -117,12 +117,12 @@
\param[out] buf data buffer
\param cnt number of members
- \param fp pointer to GVFILE
+ \param fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
-int dig__fread_port_F(float *buf, size_t cnt, GVFILE * fp)
+int dig__fread_port_F(float *buf, size_t cnt, struct gvfile * fp)
{
unsigned int i, j;
int ret;
@@ -161,12 +161,12 @@
\param[out] buf data buffer
\param cnt number of members
- \param fp pointer to GVFILE
+ \param fp pointer to struct gvfile
\param port_off_t_size offset
\return 0 error
\return 1 OK
*/
-int dig__fread_port_O(off_t *buf, size_t cnt, GVFILE * fp, size_t port_off_t_size)
+int dig__fread_port_O(off_t *buf, size_t cnt, struct gvfile * fp, size_t port_off_t_size)
{
unsigned int i, j;
int ret;
@@ -256,12 +256,12 @@
\param[out] buf data buffer
\param cnt number of members
- \param fp pointer to GVFILE
+ \param fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
-int dig__fread_port_L(long *buf, size_t cnt, GVFILE * fp)
+int dig__fread_port_L(long *buf, size_t cnt, struct gvfile * fp)
{
unsigned int i, j;
int ret;
@@ -341,12 +341,12 @@
\param[out] buf data buffer
\param cnt number of members
- \param fp pointer to GVFILE
+ \param fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
-int dig__fread_port_I(int *buf, size_t cnt, GVFILE * fp)
+int dig__fread_port_I(int *buf, size_t cnt, struct gvfile * fp)
{
unsigned int i, j;
int ret;
@@ -426,12 +426,12 @@
\param[out] buf data buffer
\param cnt number of members
- \param fp pointer to GVFILE
+ \param fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
-int dig__fread_port_S(short *buf, size_t cnt, GVFILE * fp)
+int dig__fread_port_S(short *buf, size_t cnt, struct gvfile * fp)
{
unsigned int i, j;
int ret;
@@ -511,12 +511,12 @@
\param[out] buf data buffer
\param cnt number of members
- \param fp pointer to GVFILE
+ \param fp pointer to gvfile structure
\return 0 error
\return 1 OK
*/
-int dig__fread_port_C(char *buf, size_t cnt, GVFILE * fp)
+int dig__fread_port_C(char *buf, size_t cnt, struct gvfile * fp)
{
int ret;
@@ -537,12 +537,12 @@
\param[out] buf data buffer
\param cnt number of members
- \param fp pointer to GVFILE
+ \param fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
-int dig__fread_port_P(plus_t * buf, size_t cnt, GVFILE * fp)
+int dig__fread_port_P(plus_t * buf, size_t cnt, struct gvfile * fp)
{
int *ibuf;
@@ -559,13 +559,13 @@
\param buf data buffer
\param cnt number of members
- \param[in,out] fp pointer to GVFILE
+ \param[in,out] fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
int dig__fwrite_port_D(const double *buf,
- size_t cnt, GVFILE * fp)
+ size_t cnt, struct gvfile * fp)
{
unsigned int i, j;
unsigned char *c1, *c2;
@@ -598,13 +598,13 @@
\param buf data buffer
\param cnt number of members
- \param[in,out] fp pointer to GVFILE
+ \param[in,out] fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
int dig__fwrite_port_F(const float *buf,
- size_t cnt, GVFILE * fp)
+ size_t cnt, struct gvfile * fp)
{
unsigned int i, j;
unsigned char *c1, *c2;
@@ -637,13 +637,13 @@
\param buf data buffer
\param cnt number of members
- \param[in,out] fp pointer to GVFILE
+ \param[in,out] fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
int dig__fwrite_port_O(const off_t *buf,
- size_t cnt, GVFILE * fp, size_t port_off_t_size)
+ size_t cnt, struct gvfile * fp, size_t port_off_t_size)
{
unsigned int i, j;
unsigned char *c1, *c2;
@@ -703,13 +703,13 @@
\param buf data buffer
\param cnt number of members
- \param[in,out] fp pointer to GVFILE
+ \param[in,out] fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
int dig__fwrite_port_L(const long *buf,
- size_t cnt, GVFILE * fp)
+ size_t cnt, struct gvfile * fp)
{
unsigned int i, j;
unsigned char *c1, *c2;
@@ -759,13 +759,13 @@
\param buf data buffer
\param cnt number of members
- \param[in,out] fp pointer to GVFILE
+ \param[in,out] fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
int dig__fwrite_port_I(const int *buf,
- size_t cnt, GVFILE * fp)
+ size_t cnt, struct gvfile * fp)
{
unsigned int i, j;
unsigned char *c1, *c2;
@@ -815,13 +815,13 @@
\param buf data buffer
\param cnt number of members
- \param[in,out] fp pointer to GVFILE
+ \param[in,out] fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
int dig__fwrite_port_S(const short *buf,
- size_t cnt, GVFILE * fp)
+ size_t cnt, struct gvfile * fp)
{
unsigned int i, j;
unsigned char *c1, *c2;
@@ -872,13 +872,13 @@
\param buf data buffer
\param cnt number of members
- \param[in,out] fp pointer to GVFILE
+ \param[in,out] fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
int dig__fwrite_port_P(const plus_t * buf,
- size_t cnt, GVFILE * fp)
+ size_t cnt, struct gvfile * fp)
{
return (dig__fwrite_port_I((int *)buf, cnt, fp));
}
@@ -891,13 +891,13 @@
\param buf data buffer
\param cnt number of members
- \param[in,out] fp pointer to GVFILE
+ \param[in,out] fp pointer to struct gvfile
\return 0 error
\return 1 OK
*/
int dig__fwrite_port_C(const char *buf,
- size_t cnt, GVFILE * fp)
+ size_t cnt, struct gvfile * fp)
{
if (dig_fwrite(buf, PORT_CHAR, cnt, fp) == cnt)
return 1;
@@ -906,9 +906,9 @@
}
/*!
- \brief Set portable info structure to byte order of file
+ \brief Set Port_info structure to byte order of file
- \param port pointer to Port_info
+ \param port pointer to Port_info structure
\param byte_order ENDIAN_BIG or ENDIAN_LITTLE
*/
void dig_init_portable(struct Port_info *port, int byte_order)
@@ -1001,9 +1001,9 @@
}
/*!
- \brief set current portable info
+ \brief Set current Port_info structure
- \param port pointer to Port_info
+ \param port pointer to Port_info structure
\return 0
*/
Modified: grass/trunk/lib/vector/diglib/spindex.c
===================================================================
--- grass/trunk/lib/vector/diglib/spindex.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/spindex.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -182,7 +182,7 @@
\return 0
*/
-int dig_spidx_add_line(struct Plus_head *Plus, int line, BOUND_BOX * box)
+int dig_spidx_add_line(struct Plus_head *Plus, int line, struct bound_box * box)
{
struct Rect rect;
@@ -208,7 +208,7 @@
\return 0
*/
-int dig_spidx_add_area(struct Plus_head *Plus, int area, BOUND_BOX * box)
+int dig_spidx_add_area(struct Plus_head *Plus, int area, struct bound_box * box)
{
struct Rect rect;
@@ -235,7 +235,7 @@
\return 0
*/
-int dig_spidx_add_isle(struct Plus_head *Plus, int isle, BOUND_BOX * box)
+int dig_spidx_add_isle(struct Plus_head *Plus, int isle, struct bound_box * box)
{
struct Rect rect;
@@ -265,7 +265,7 @@
int dig_spidx_del_node(struct Plus_head *Plus, int node)
{
int ret;
- P_NODE *Node;
+ struct P_node *Node;
struct Rect rect;
G_debug(3, "dig_spidx_del_node(): node = %d", node);
@@ -299,7 +299,7 @@
*/
int dig_spidx_del_line(struct Plus_head *Plus, int line)
{
- P_LINE *Line;
+ struct P_line *Line;
struct Rect rect;
int ret;
@@ -340,7 +340,7 @@
int dig_spidx_del_area(struct Plus_head *Plus, int area)
{
int ret;
- P_AREA *Area;
+ struct P_area *Area;
struct Rect rect;
G_debug(3, "dig_spidx_del_area(): area = %d", area);
@@ -379,7 +379,7 @@
int dig_spidx_del_isle(struct Plus_head *Plus, int isle)
{
int ret;
- P_ISLE *Isle;
+ struct P_isle *Isle;
struct Rect rect;
G_debug(3, "dig_spidx_del_isle(): isle = %d", isle);
@@ -419,7 +419,7 @@
\return -1 on error
*/
int
-dig_select_nodes(struct Plus_head *Plus, const BOUND_BOX * box,
+dig_select_nodes(struct Plus_head *Plus, const struct bound_box * box,
struct ilist *list)
{
struct Rect rect;
@@ -495,7 +495,7 @@
\return number of selected lines
*/
int
-dig_select_lines(struct Plus_head *Plus, const BOUND_BOX * box,
+dig_select_lines(struct Plus_head *Plus, const struct bound_box * box,
struct ilist *list)
{
struct Rect rect;
@@ -529,7 +529,7 @@
\return number of selected areas
*/
int
-dig_select_areas(struct Plus_head *Plus, const BOUND_BOX * box,
+dig_select_areas(struct Plus_head *Plus, const struct bound_box * box,
struct ilist *list)
{
struct Rect rect;
@@ -563,7 +563,7 @@
\return number of selected isles
*/
int
-dig_select_isles(struct Plus_head *Plus, const BOUND_BOX * box,
+dig_select_isles(struct Plus_head *Plus, const struct bound_box * box,
struct ilist *list)
{
struct Rect rect;
Modified: grass/trunk/lib/vector/diglib/spindex_rw.c
===================================================================
--- grass/trunk/lib/vector/diglib/spindex_rw.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/spindex_rw.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -42,13 +42,13 @@
/*!
\brief Write spatial index to the file
- \param[in,out] fp pointer to GVFILE
+ \param[in,out] fp pointer to struct gvfile
\param ptr pointer to Plus_head structure
\return 0 on success
\return -1 on error
*/
-int dig_Wr_spidx_head(GVFILE * fp, struct Plus_head *ptr)
+int dig_Wr_spidx_head(struct gvfile * fp, struct Plus_head *ptr)
{
unsigned char buf[6];
long length = 81; /* header length in bytes */
@@ -252,13 +252,13 @@
/*!
\brief Read spatial index to the file
- \param fp pointer to GVFILE
+ \param fp pointer to struct gvfile
\param[in,out] ptr pointer to Plus_head structure
\return 0 on success
\return -1 on error
*/
-int dig_Rd_spidx_head(GVFILE * fp, struct Plus_head *ptr)
+int dig_Rd_spidx_head(struct gvfile * fp, struct Plus_head *ptr)
{
unsigned char buf[6];
int byte_order;
@@ -574,16 +574,16 @@
\brief Write RTree body from memory to sidx file
Must be called when new or updated vector is closed
- \param[out] fp pointer to GVFILE
- \param startpos offset to GVFILE where to start writing out
+ \param[out] fp pointer to struct gvfile
+ \param startpos offset to struct gvfile where to start writing out
\param t pointer to RTree
- \param off_t_size size of off_t used to write GVFILE
+ \param off_t_size size of off_t used to write struct gvfile
\return -1 on error
\return offset to root node on success
*/
-static off_t rtree_write_to_sidx(GVFILE * fp, off_t startpos,
+static off_t rtree_write_to_sidx(struct gvfile * fp, off_t startpos,
struct RTree *t, int off_t_size)
{
off_t nextfreepos = startpos;
@@ -666,16 +666,16 @@
\brief Load RTree body from sidx file to memory
Must be called when old vector is opened in update mode
- \param fp pointer to GVFILE
+ \param fp pointer to struct gvfile
\param rootpos position of root node in file
\param t pointer to RTree
- \param off_t_size size of off_t used to read GVFILE
+ \param off_t_size size of off_t used to read struct gvfile
\return -1 on error
\return pointer to root node on success
*/
-struct Node *rtree_load_from_sidx(GVFILE * fp, off_t rootpos,
+struct Node *rtree_load_from_sidx(struct gvfile * fp, off_t rootpos,
struct RTree *t, int off_t_size)
{
struct Node *newnode = NULL;
@@ -773,12 +773,12 @@
/*!
\brief Write spatial index to the file
- \param[out] fp pointer to GVFILE
+ \param[out] fp pointer to struct gvfile
\param Plus pointer to Plus_head structure
\return 0
*/
-int dig_Wr_spidx(GVFILE * fp, struct Plus_head *Plus)
+int dig_Wr_spidx(struct gvfile * fp, struct Plus_head *Plus)
{
G_debug(1, "dig_Wr_spidx()");
@@ -823,12 +823,12 @@
\brief Read spatial index from spidx file
Only needed when old vector is opened in update mode
- \param fp pointer to GVFILE
+ \param fp pointer to struct gvfile
\param[in,out] Plus pointer to Plus_head structure
\return 0
*/
-int dig_Rd_spidx(GVFILE * fp, struct Plus_head *Plus)
+int dig_Rd_spidx(struct gvfile * fp, struct Plus_head *Plus)
{
G_debug(1, "dig_read_spindx()");
Modified: grass/trunk/lib/vector/diglib/struct_alloc.c
===================================================================
--- grass/trunk/lib/vector/diglib/struct_alloc.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/struct_alloc.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -37,11 +37,11 @@
*/
/* allocate new node structure */
-P_NODE *dig_alloc_node()
+struct P_node *dig_alloc_node()
{
- P_NODE *Node;
+ struct P_node *Node;
- Node = (P_NODE *) G_malloc(sizeof(P_NODE));
+ Node = (struct P_node *) G_malloc(sizeof(struct P_node));
if (Node == NULL)
return NULL;
@@ -54,7 +54,7 @@
}
/* free node structure */
-void dig_free_node(P_NODE *Node)
+void dig_free_node(struct P_node *Node)
{
if (Node->alloc_lines > 0) {
G_free(Node->lines);
@@ -71,7 +71,7 @@
** Returns 0 ok or -1 on error
*/
-int dig_node_alloc_line(P_NODE * node, int add)
+int dig_node_alloc_line(struct P_node * node, int add)
{
int num;
char *p;
@@ -107,22 +107,22 @@
char *p;
size = Plus->alloc_nodes + 1 + add;
- p = G_realloc(Plus->Node, size * sizeof(P_NODE *));
+ p = G_realloc(Plus->Node, size * sizeof(struct P_node *));
if (p == NULL)
return -1;
- Plus->Node = (P_NODE **) p;
+ Plus->Node = (struct P_node **) p;
Plus->alloc_nodes = size - 1;
return (0);
}
/* allocate new line structure */
-P_LINE *dig_alloc_line()
+struct P_line *dig_alloc_line()
{
- P_LINE *Line;
+ struct P_line *Line;
- Line = (P_LINE *) G_malloc(sizeof(P_LINE));
+ Line = (struct P_line *) G_malloc(sizeof(struct P_line));
if (Line == NULL)
return NULL;
@@ -130,7 +130,7 @@
}
/* free line structure */
-void dig_free_line(P_LINE *Line)
+void dig_free_line(struct P_line *Line)
{
G_free(Line);
}
@@ -147,11 +147,11 @@
char *p;
size = Plus->alloc_lines + 1 + add;
- p = G_realloc(Plus->Line, size * sizeof(P_LINE *));
+ p = G_realloc(Plus->Line, size * sizeof(struct P_line *));
if (p == NULL)
return -1;
- Plus->Line = (P_LINE **) p;
+ Plus->Line = (struct P_line **) p;
Plus->alloc_lines = size - 1;
return (0);
@@ -169,11 +169,11 @@
char *p;
size = Plus->alloc_areas + 1 + add;
- p = G_realloc(Plus->Area, size * sizeof(P_AREA *));
+ p = G_realloc(Plus->Area, size * sizeof(struct P_area *));
if (p == NULL)
return -1;
- Plus->Area = (P_AREA **) p;
+ Plus->Area = (struct P_area **) p;
Plus->alloc_areas = size - 1;
return (0);
@@ -192,22 +192,22 @@
G_debug(3, "dig_alloc_isle():");
size = Plus->alloc_isles + 1 + add;
- p = G_realloc(Plus->Isle, size * sizeof(P_ISLE *));
+ p = G_realloc(Plus->Isle, size * sizeof(struct P_isle *));
if (p == NULL)
return -1;
- Plus->Isle = (P_ISLE **) p;
+ Plus->Isle = (struct P_isle **) p;
Plus->alloc_isles = size - 1;
return (0);
}
/* allocate new area structure */
-P_AREA *dig_alloc_area()
+struct P_area *dig_alloc_area()
{
- P_AREA *Area;
+ struct P_area *Area;
- Area = (P_AREA *) G_malloc(sizeof(P_AREA));
+ Area = (struct P_area *) G_malloc(sizeof(struct P_area));
if (Area == NULL)
return NULL;
@@ -225,7 +225,7 @@
}
/* free area structure */
-void dig_free_area(P_AREA *Area)
+void dig_free_area(struct P_area *Area)
{
if (Area->alloc_lines > 0)
free(Area->lines);
@@ -237,11 +237,11 @@
}
/* alloc new isle structure */
-P_ISLE *dig_alloc_isle()
+struct P_isle *dig_alloc_isle()
{
- P_ISLE *Isle;
+ struct P_isle *Isle;
- Isle = (P_ISLE *) G_malloc(sizeof(P_ISLE));
+ Isle = (struct P_isle *) G_malloc(sizeof(struct P_isle));
if (Isle == NULL)
return NULL;
@@ -255,7 +255,7 @@
}
/* free isle structure */
-void dig_free_isle(P_ISLE *Isle)
+void dig_free_isle(struct P_isle *Isle)
{
if (Isle->alloc_lines > 0)
G_free(Isle->lines);
@@ -337,7 +337,7 @@
**
** Returns 0 ok or -1 on error
*/
-int dig_area_alloc_line(P_AREA * area, int add)
+int dig_area_alloc_line(struct P_area * area, int add)
{
int num;
char *p;
@@ -359,7 +359,7 @@
**
** Returns 0 ok or -1 on error
*/
-int dig_area_alloc_isle(P_AREA * area, int add)
+int dig_area_alloc_isle(struct P_area * area, int add)
{
int num;
char *p;
@@ -382,7 +382,7 @@
** Returns 0 ok or -1 on error
*/
-int dig_isle_alloc_line(P_ISLE * isle, int add)
+int dig_isle_alloc_line(struct P_isle * isle, int add)
{
int num;
char *p;
Modified: grass/trunk/lib/vector/diglib/test.c
===================================================================
--- grass/trunk/lib/vector/diglib/test.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/lib/vector/diglib/test.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -34,7 +34,7 @@
int err;
int byte_order;
struct Port_info port;
- GVFILE fp;
+ struct gvfile fp;
int port_off_t;
double db, td[] = { -(PORT_DOUBLE_MAX), -(D_TEST), -(PORT_DOUBLE_MIN),
Modified: grass/trunk/ps/ps.map/ps_vareas.c
===================================================================
--- grass/trunk/ps/ps.map/ps_vareas.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/ps/ps.map/ps_vareas.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -133,8 +133,8 @@
double llx, lly, urx, ury, sc;
char pat[50];
struct line_cats *Cats;
- BOUND_BOX box;
- VARRAY *Varray = NULL;
+ struct bound_box box;
+ struct varray *Varray = NULL;
PSCOLOR color;
int centroid;
Modified: grass/trunk/ps/ps.map/ps_vlines.c
===================================================================
--- grass/trunk/ps/ps.map/ps_vlines.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/ps/ps.map/ps_vlines.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -23,7 +23,7 @@
int i, k, np, line, cat, nlines, ret;
double *xarray, *yarray, tol = 0.1, width;
struct line_cats *Cats;
- VARRAY *Varray = NULL;
+ struct varray *Varray = NULL;
/* rgbcol */
dbCatValArray cvarr_rgb;
Modified: grass/trunk/ps/ps.map/ps_vpoints.c
===================================================================
--- grass/trunk/ps/ps.map/ps_vpoints.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/ps/ps.map/ps_vpoints.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -29,7 +29,7 @@
double llx, lly, urx, ury;
int x_int, y_int, eps_exist;
SYMBOL *Symb;
- VARRAY *Varray = NULL;
+ struct varray *Varray = NULL;
/* Attributes if sizecol is used */
dbCatValArray cvarr_size;
Modified: grass/trunk/raster/r.region/main.c
===================================================================
--- grass/trunk/raster/r.region/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/raster/r.region/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -203,7 +203,7 @@
if ((name = parm.vect->answer)) { /* vect= */
struct Map_info Map;
- BOUND_BOX box;
+ struct bound_box box;
Vect_set_open_level(1);
if (Vect_open_old(&Map, name, "") != 1)
Modified: grass/trunk/vector/lidar/lidarlib/PolimiFunct.h
===================================================================
--- grass/trunk/vector/lidar/lidarlib/PolimiFunct.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/lidarlib/PolimiFunct.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -98,8 +98,8 @@
void P_zero_dim(struct Reg_dimens * /**/);
int P_set_regions(struct Cell_head *, /**/
- BOUND_BOX *, /**/
- BOUND_BOX *, /**/ struct Reg_dimens, /**/ int /**/);
+ struct bound_box *, /**/
+ struct bound_box *, /**/ struct Reg_dimens, /**/ int /**/);
int P_get_orlo(int, /**/ struct Reg_dimens *, /**/ double, /**/ double /**/);
@@ -115,8 +115,8 @@
void
P_Sparse_Points(struct Map_info *, /**/
struct Cell_head *, /**/
- BOUND_BOX, /**/
- BOUND_BOX, /**/
+ struct bound_box, /**/
+ struct bound_box, /**/
double **, /**/
double *, /**/
int *, /**/
@@ -131,8 +131,8 @@
dbDriver *, /**/ double, /**/ char * /**/);
double **P_Regular_Points(struct Cell_head *, /**/
- BOUND_BOX, /**/
- BOUND_BOX, /**/
+ struct bound_box, /**/
+ struct bound_box, /**/
double **, /**/
double *, /**/
double, /**/
Modified: grass/trunk/vector/lidar/lidarlib/raster.c
===================================================================
--- grass/trunk/vector/lidar/lidarlib/raster.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/lidarlib/raster.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -13,7 +13,7 @@
/*------------------------------------------------------------------------------------------------*/
void
P_Sparse_Points(struct Map_info *Out, struct Cell_head *Elaboration,
- BOUND_BOX General, BOUND_BOX Overlap, double **obs,
+ struct bound_box General, struct bound_box Overlap, double **obs,
double *param, int *line_num, double pe, double pn,
double overlap, int nsplx, int nsply, int num_points,
int bilin, struct line_cats *categories, dbDriver * driver,
@@ -200,8 +200,8 @@
/*------------------------------------------------------------------------------------------------*/
-double **P_Regular_Points(struct Cell_head *Elaboration, BOUND_BOX General,
- BOUND_BOX Overlap, double **matrix, double *param,
+double **P_Regular_Points(struct Cell_head *Elaboration, struct bound_box General,
+ struct bound_box Overlap, double **matrix, double *param,
double passoN, double passoE, double overlap,
double mean, int nsplx, int nsply, int nrows,
int ncols, int bilin)
Modified: grass/trunk/vector/lidar/lidarlib/zones.c
===================================================================
--- grass/trunk/vector/lidar/lidarlib/zones.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/lidarlib/zones.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -24,8 +24,8 @@
/*----------------------------------------------------------------------------------------*/
int
-P_set_regions(struct Cell_head *Elaboration, BOUND_BOX * General,
- BOUND_BOX * Overlap, struct Reg_dimens dim, int type)
+P_set_regions(struct Cell_head *Elaboration, struct bound_box * General,
+ struct bound_box * Overlap, struct Reg_dimens dim, int type)
{
/* Set the Elaborationoration region limits-> Also set the limits of the orlo and overlapping regions->
* Returns 0 on success; -1 on failure*/
@@ -126,7 +126,7 @@
{
int i, mean_count = 0;
double mean = 0.0;
- BOUND_BOX mean_box;
+ struct bound_box mean_box;
Vect_region_box(Elaboration, &mean_box);
mean_box.W -= CONTOUR;
@@ -158,7 +158,7 @@
struct Point *obs;
struct line_pnts *points;
struct line_cats *categories;
- BOUND_BOX elaboration_box;
+ struct bound_box elaboration_box;
pippo = dim_vect;
obs = (struct Point *)G_calloc(pippo, sizeof(struct Point));
Modified: grass/trunk/vector/lidar/v.lidar.correction/correction.c
===================================================================
--- grass/trunk/vector/lidar/v.lidar.correction/correction.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/v.lidar.correction/correction.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -30,7 +30,7 @@
void
P_Sparse_Correction(struct Map_info *In, struct Map_info *Out,
struct Map_info *Terrain, struct Cell_head *Elaboration,
- BOUND_BOX General, BOUND_BOX Overlap, double **obs,
+ struct bound_box General, struct bound_box Overlap, double **obs,
double *param, int *line_num, double passoN,
double passoE, double overlap, double HighThresh,
double LowThresh, int nsplx, int nsply, int num_points,
@@ -302,7 +302,7 @@
struct Point *obs;
struct line_pnts *points;
struct line_cats *categories;
- BOUND_BOX elaboration_box;
+ struct bound_box elaboration_box;
pippo = dim_vect;
Modified: grass/trunk/vector/lidar/v.lidar.correction/correction.h
===================================================================
--- grass/trunk/vector/lidar/v.lidar.correction/correction.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/v.lidar.correction/correction.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -12,8 +12,8 @@
struct Map_info *, /**/
struct Map_info *, /**/
struct Cell_head *, /**/
- BOUND_BOX, /**/
- BOUND_BOX, /**/
+ struct bound_box, /**/
+ struct bound_box, /**/
double **, /**/
double *, /**/
int *, /**/
Modified: grass/trunk/vector/lidar/v.lidar.correction/main.c
===================================================================
--- grass/trunk/vector/lidar/v.lidar.correction/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/v.lidar.correction/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -54,7 +54,7 @@
struct Cell_head elaboration_reg, original_reg;
struct Reg_dimens dims;
- BOUND_BOX general_box, overlap_box;
+ struct bound_box general_box, overlap_box;
struct Point *observ;
Modified: grass/trunk/vector/lidar/v.lidar.edgedetection/edgedetection.c
===================================================================
--- grass/trunk/vector/lidar/v.lidar.edgedetection/edgedetection.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/v.lidar.edgedetection/edgedetection.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -33,7 +33,7 @@
#include <grass/dbmi.h>
/* #include <grass/PolimiFunct.h> */
#include "edgedetection.h"
-int edge_detection(struct Cell_head elaboration_reg, BOUND_BOX Overlap_Box,
+int edge_detection(struct Cell_head elaboration_reg, struct bound_box Overlap_Box,
double *parBilin, double obsX, double obsY,
double *partial, double alpha, double residual,
double gradHigh, double gradLow)
@@ -171,7 +171,7 @@
}
void classification(struct Map_info *Out, struct Cell_head Elaboration,
- BOUND_BOX General, BOUND_BOX Overlap, double **obs,
+ struct bound_box General, struct bound_box Overlap, double **obs,
double *parBilin, double *parBicub, double mean,
double alpha, double gradHigh, double gradLow,
double overlap, int *line_num, int num_points,
Modified: grass/trunk/vector/lidar/v.lidar.edgedetection/edgedetection.h
===================================================================
--- grass/trunk/vector/lidar/v.lidar.edgedetection/edgedetection.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/v.lidar.edgedetection/edgedetection.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -31,7 +31,7 @@
/*---------------------------------------------------------------------------------------*/
int edge_detection(struct Cell_head, /**/
- BOUND_BOX, /**/
+ struct bound_box, /**/
double *, /**/
double, /**/
double, /**/
@@ -43,8 +43,8 @@
void classification(struct Map_info *, /**/
struct Cell_head, /**/
- BOUND_BOX, /**/
- BOUND_BOX, /**/
+ struct bound_box, /**/
+ struct bound_box, /**/
double **, /**/
double *, /**/
double *, /**/
Modified: grass/trunk/vector/lidar/v.lidar.edgedetection/main.c
===================================================================
--- grass/trunk/vector/lidar/v.lidar.edgedetection/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/v.lidar.edgedetection/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -62,7 +62,7 @@
struct Cell_head elaboration_reg, original_reg;
struct Reg_dimens dims;
- BOUND_BOX general_box, overlap_box;
+ struct bound_box general_box, overlap_box;
struct Point *observ;
Modified: grass/trunk/vector/lidar/v.lidar.growing/main.c
===================================================================
--- grass/trunk/vector/lidar/v.lidar.growing/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/v.lidar.growing/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -206,7 +206,7 @@
last_column = FALSE;
while (last_column == FALSE) { /* For each strip of LATO columns */
- BOUND_BOX elaboration_box;
+ struct bound_box elaboration_box;
elaboration_reg.west = elaboration_reg.east;
if (elaboration_reg.west < original_reg.west) /* First column */
Modified: grass/trunk/vector/lidar/v.outlier/main.c
===================================================================
--- grass/trunk/vector/lidar/v.outlier/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/v.outlier/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -56,7 +56,7 @@
struct Cell_head elaboration_reg, original_reg;
struct Reg_dimens dims;
- BOUND_BOX general_box, overlap_box;
+ struct bound_box general_box, overlap_box;
struct Point *observ;
Modified: grass/trunk/vector/lidar/v.outlier/outlier.c
===================================================================
--- grass/trunk/vector/lidar/v.outlier/outlier.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/v.outlier/outlier.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -10,7 +10,7 @@
void P_Outlier(struct Map_info *Out, struct Map_info *Outlier,
struct Map_info *Qgis, struct Cell_head Elaboration,
- BOUND_BOX General, BOUND_BOX Overlap, double **obs,
+ struct bound_box General, struct bound_box Overlap, double **obs,
double *parBilin, double mean, double overlap, int *line_num,
int num_points, dbDriver * driver)
{
Modified: grass/trunk/vector/lidar/v.outlier/outlier.h
===================================================================
--- grass/trunk/vector/lidar/v.outlier/outlier.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/v.outlier/outlier.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -12,8 +12,8 @@
struct Map_info *, /**/
struct Map_info *, /**/
struct Cell_head, /**/
- BOUND_BOX, /**/
- BOUND_BOX, /**/
+ struct bound_box, /**/
+ struct bound_box, /**/
double **, /**/
double *, /**/
double, /**/ double, /**/ int *, /**/ int, /**/ dbDriver * /**/);
Modified: grass/trunk/vector/lidar/v.surf.bspline/main.c
===================================================================
--- grass/trunk/vector/lidar/v.surf.bspline/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/lidar/v.surf.bspline/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -65,7 +65,7 @@
struct Reg_dimens dims;
struct Cell_head elaboration_reg, original_reg;
- BOUND_BOX general_box, overlap_box;
+ struct bound_box general_box, overlap_box;
struct Point *observ;
struct line_pnts *points;
Modified: grass/trunk/vector/v.clean/prune.c
===================================================================
--- grass/trunk/vector/v.clean/prune.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.clean/prune.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -41,7 +41,7 @@
int norig;
struct line_pnts *Points, *TPoints, *BPoints, *Points_orig;
struct line_cats *Cats;
- BOUND_BOX box;
+ struct bound_box box;
struct ilist *List;
Points = Vect_new_line_struct();
Modified: grass/trunk/vector/v.convert/read.c
===================================================================
--- grass/trunk/vector/v.convert/read.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.convert/read.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -7,7 +7,7 @@
#include "conv.h"
#include "local_proto.h"
-int read_line(GVFILE *, struct line_pnts *);
+int read_line(struct gvfile *, struct line_pnts *);
/* read old 3.0 or 4.0 dig file into array
returns number of elements read into array
@@ -26,7 +26,7 @@
double dbuf;
int ibuf;
long lbuf;
- GVFILE gvf;
+ struct gvfile gvf;
dig_file_init(&gvf);
gvf.file = Digin;
@@ -204,7 +204,7 @@
/* read_line() reads element from file
returns element type
*/
-int read_line(GVFILE * Gvf, struct line_pnts *nline)
+int read_line(struct gvfile * Gvf, struct line_pnts *nline)
{
int n_points;
long itype;
Modified: grass/trunk/vector/v.db.select/main.c
===================================================================
--- grass/trunk/vector/v.db.select/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.db.select/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -44,7 +44,7 @@
char query[1024];
struct ilist *list_lines;
- BOUND_BOX *min_box, *line_box;
+ struct bound_box *min_box, *line_box;
int i, line, area, init_box, cat;
module = G_define_module();
@@ -101,10 +101,10 @@
field = atoi(field_opt->answer);
if (r_flag->answer) {
- min_box = (BOUND_BOX *) G_malloc(sizeof(BOUND_BOX));
- G_zero((void *)min_box, sizeof(BOUND_BOX));
+ min_box = (struct bound_box *) G_malloc(sizeof(struct bound_box));
+ G_zero((void *)min_box, sizeof(struct bound_box));
- line_box = (BOUND_BOX *) G_malloc(sizeof(BOUND_BOX));
+ line_box = (struct bound_box *) G_malloc(sizeof(struct bound_box));
list_lines = Vect_new_list();
}
else {
Modified: grass/trunk/vector/v.delaunay/defs.h
===================================================================
--- grass/trunk/vector/v.delaunay/defs.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.delaunay/defs.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -4,8 +4,8 @@
#ifdef MAIN
struct Cell_head Window;
-BOUND_BOX Box;
+struct bound_box Box;
#else
extern struct Cell_head Window;
-extern BOUND_BOX Box;
+extern struct bound_box Box;
#endif
Modified: grass/trunk/vector/v.delaunay/in_out.c
===================================================================
--- grass/trunk/vector/v.delaunay/in_out.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.delaunay/in_out.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -161,7 +161,7 @@
/* returns number of sites read */
int read_sites(int mode3d, int complete_map, struct Map_info map_in,
- BOUND_BOX Box)
+ struct bound_box Box)
{
int nlines, line, allocated, nsites;
struct line_pnts *Points;
Modified: grass/trunk/vector/v.delaunay/in_out.h
===================================================================
--- grass/trunk/vector/v.delaunay/in_out.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.delaunay/in_out.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -2,7 +2,7 @@
#define IN_OUT_H
int read_sites(int mode3d, int complete_map, struct Map_info map_in,
- BOUND_BOX Box);
+ struct bound_box Box);
void output_edges(struct vertex *sites_sorted[], unsigned int n, int mode3d,
int Type, struct Map_info map_out);
void output_triangles(struct vertex *sites_sorted[], unsigned int n,
Modified: grass/trunk/vector/v.delaunay/main.c
===================================================================
--- grass/trunk/vector/v.delaunay/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.delaunay/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -36,7 +36,7 @@
const char *mapset;
struct Map_info map_in, map_out;
struct Cell_head Window;
- BOUND_BOX Box;
+ struct bound_box Box;
struct GModule *module;
struct Flag *reg_flag, *line_flag;
struct Option *in_opt, *out_opt;
Modified: grass/trunk/vector/v.distance/main.c
===================================================================
--- grass/trunk/vector/v.distance/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.distance/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -100,7 +100,7 @@
int update_ok, update_err, update_exist, update_notexist, update_dupl,
update_notfound;
struct ilist *List;
- BOUND_BOX box;
+ struct bound_box box;
dbCatValArray cvarr;
dbColumn *column;
@@ -322,7 +322,7 @@
/* TODO: add maxdist = -1 to Vect_select_ !!! */
/* Calc maxdist */
if (max < 0) {
- BOUND_BOX fbox, tbox;
+ struct bound_box fbox, tbox;
double dx, dy, dz;
Vect_get_map_box(&From, &fbox);
Modified: grass/trunk/vector/v.edit/select.c
===================================================================
--- grass/trunk/vector/v.edit/select.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.edit/select.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -340,7 +340,7 @@
int type, double x1, double y1, double x2, double y2,
struct ilist *List)
{
- BOUND_BOX bbox;
+ struct bound_box bbox;
struct ilist *List_tmp;
Modified: grass/trunk/vector/v.external/main.c
===================================================================
--- grass/trunk/vector/v.external/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.external/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -140,8 +140,8 @@
}
/* Create frmt */
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, options.output->answer);
- fd = G_fopen_new(buf, GRASS_VECT_FRMT_ELEMENT);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, options.output->answer);
+ fd = G_fopen_new(buf, GV_FRMT_ELEMENT);
if (fd == NULL) {
Vect_delete(options.output->answer);
G_fatal_error("Unable to open file '%s'", buf);
Modified: grass/trunk/vector/v.generalize/displacement.c
===================================================================
--- grass/trunk/vector/v.generalize/displacement.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.generalize/displacement.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -32,7 +32,7 @@
int snakes_displacement(struct Map_info *In, struct Map_info *Out,
double threshold, double alpha, double beta,
double gama, double delta, int iterations,
- VARRAY * varray)
+ struct varray * varray)
{
int n_points;
Modified: grass/trunk/vector/v.generalize/main.c
===================================================================
--- grass/trunk/vector/v.generalize/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.generalize/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -66,7 +66,7 @@
int n_areas, n_lines;
double x, y;
int simplification, mask_type;
- VARRAY *varray;
+ struct varray *varray;
char *s;
int left, right;
Modified: grass/trunk/vector/v.generalize/network.c
===================================================================
--- grass/trunk/vector/v.generalize/network.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.generalize/network.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -28,9 +28,9 @@
int **edge; /* edge for each vertex */
int *degree; /* degree of vertices */
int vertices;
-} NGRAPH;
+} NdglGraph_s;
-void graph_free(NGRAPH * g)
+void graph_free(NdglGraph_s * g)
{
int i;
@@ -44,7 +44,7 @@
return;
}
-int graph_init(NGRAPH * g, int vertices)
+int graph_init(NdglGraph_s * g, int vertices)
{
g->edge = NULL;
g->degree = NULL;
@@ -76,7 +76,7 @@
int i;
int output = 0;
dglGraph_s *gr;
- NGRAPH g;
+ NdglGraph_s g;
int nnodes;
struct line_pnts *Points;
struct line_cats *Cats;
Modified: grass/trunk/vector/v.generalize/operators.h
===================================================================
--- grass/trunk/vector/v.generalize/operators.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.generalize/operators.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -29,4 +29,4 @@
int snakes_displacement(struct Map_info *In, struct Map_info *Out,
double threshold, double alpha, double beta,
double gama, double delta, int iterations,
- VARRAY * varray);
+ struct varray * varray);
Modified: grass/trunk/vector/v.hull/main.c
===================================================================
--- grass/trunk/vector/v.hull/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.hull/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -167,7 +167,7 @@
int pointIdx = 0;
struct line_pnts *sites;
struct line_cats *cats;
- BOUND_BOX box;
+ struct bound_box box;
int cat, type;
sites = Vect_new_line_struct();
Modified: grass/trunk/vector/v.in.dxf/dxf_to_vect.c
===================================================================
--- grass/trunk/vector/v.in.dxf/dxf_to_vect.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.in.dxf/dxf_to_vect.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -10,7 +10,7 @@
static void make_head(struct Map_info *);
-static BOUND_BOX ext, dxf_ext;
+static struct bound_box ext, dxf_ext;
/* returns 1 on success, otherwise 0 */
int dxf_to_vect(struct dxf_file *dxf, struct Map_info *Map)
Modified: grass/trunk/vector/v.in.ogr/geom.c
===================================================================
--- grass/trunk/vector/v.in.ogr/geom.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.in.ogr/geom.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -29,7 +29,7 @@
/* Add categories to centroids inside polygon */
int
-centroid(OGRGeometryH hGeom, CENTR * Centr, SPATIAL_INDEX * Sindex, int field,
+centroid(OGRGeometryH hGeom, CENTR * Centr, struct spatial_index * Sindex, int field,
int cat, double min_area, int type)
{
int i, valid_isles, j, np, nr, ret;
@@ -41,7 +41,7 @@
OGRGeometryH hRing;
double size;
static struct ilist *List;
- BOUND_BOX box;
+ struct bound_box box;
G_debug(3, "centroid() cat = %d", cat);
Modified: grass/trunk/vector/v.in.ogr/main.c
===================================================================
--- grass/trunk/vector/v.in.ogr/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.in.ogr/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -42,7 +42,7 @@
int geom(OGRGeometryH hGeom, struct Map_info *Map, int field, int cat,
double min_area, int type, int mk_centr);
-int centroid(OGRGeometryH hGeom, CENTR * Centr, SPATIAL_INDEX * Sindex,
+int centroid(OGRGeometryH hGeom, CENTR * Centr, struct spatial_index * Sindex,
int field, int cat, double min_area, int type);
int main(int argc, char *argv[])
@@ -928,9 +928,9 @@
Vect_get_num_primitives(&Tmp, GV_BOUNDARY) > 0) {
int ret, centr, ncentr, otype, n_overlaps, n_nocat;
CENTR *Centr;
- SPATIAL_INDEX si;
+ struct spatial_index si;
double x, y, total_area, overlap_area, nocat_area;
- BOUND_BOX box;
+ struct bound_box box;
struct line_pnts *Points;
int nmodif;
Modified: grass/trunk/vector/v.info/main.c
===================================================================
--- grass/trunk/vector/v.info/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.info/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -45,8 +45,7 @@
struct Option *in_opt, *fieldopt;
struct Flag *histf, *columns, *gflag, *tflag, *mflag;
struct Map_info Map;
- BOUND_BOX box;
- const char *mapset;
+ struct bound_box box;
char line[200], buf[1001];
int i;
int with_z;
@@ -101,12 +100,7 @@
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
- /* open input vector */
- if ((mapset = G_find_vector2(in_opt->answer, "")) == NULL) {
- G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
- }
-
- Vect_set_open_level(2);
+ Vect_set_open_level(2); /* topology required */
Vect_open_old_head(&Map, in_opt->answer, "");
with_z = Vect_is_3d(&Map);
@@ -230,9 +224,9 @@
}
else {
divider('+');
- sprintf(line, _("Layer: %s"), in_opt->answer);
+ sprintf(line, _("Layer: %s"), Vect_get_name(&Map));
printline(line);
- sprintf(line, _("Mapset: %s"), mapset);
+ sprintf(line, _("Mapset: %s"), Vect_get_mapset(&Map));
printline(line);
sprintf(line, _("Location: %s"), G_location());
printline(line);
Modified: grass/trunk/vector/v.kcv/main.c
===================================================================
--- grass/trunk/vector/v.kcv/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.kcv/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -62,7 +62,7 @@
struct GModule *module;
struct Option *in_opt, *out_opt, *col_opt, *npart_opt;
struct Flag *drand48_flag, *q_flag;
- BOUND_BOX box;
+ struct bound_box box;
double maxdist;
/* Attributes */
Modified: grass/trunk/vector/v.kernel/main.c
===================================================================
--- grass/trunk/vector/v.kernel/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.kernel/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -503,7 +503,7 @@
int nn, kk, nalines, aline;
double dist;
struct line_pnts *APoints, *BPoints;
- BOUND_BOX box;
+ struct bound_box box;
struct ilist *List;
APoints = Vect_new_line_struct();
@@ -582,7 +582,7 @@
int i;
double dist;
static struct line_pnts *Points = NULL;
- BOUND_BOX box;
+ struct bound_box box;
static struct ilist *List = NULL;
if (!Points)
@@ -639,7 +639,7 @@
double dist;
/* spatial index handling, borrowed from lib/vector/Vlib/find.c */
- BOUND_BOX box;
+ struct bound_box box;
static struct ilist *NList = NULL;
static struct line_pnts *Points = NULL;
Modified: grass/trunk/vector/v.label.sa/labels.c
===================================================================
--- grass/trunk/vector/v.label.sa/labels.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.label.sa/labels.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -5,7 +5,7 @@
*/
#include "labels.h"
static int label_skyline(FT_Face face, const char *charset, label_t * label);
-static struct line_pnts *box_trans_rot(BOUND_BOX * bb, label_point_t * p,
+static struct line_pnts *box_trans_rot(struct bound_box * bb, label_point_t * p,
double angle);
static void label_point_candidates(label_t * label);
static void label_line_candidates(label_t * label);
@@ -18,7 +18,7 @@
static double min_dist_2_lines(struct line_pnts *skyline,
struct line_pnts *swathline,
label_point_t * p);
-static int box_overlap(BOUND_BOX * a, BOUND_BOX * b);
+static int box_overlap(struct bound_box * a, struct bound_box * b);
static int box_overlap2(struct line_pnts *a, struct line_pnts *b);
/**
@@ -805,7 +805,7 @@
* @return A lint_pnts structure containing the rotated and translated
* bounding box as a polygon.
*/
-static struct line_pnts *box_trans_rot(BOUND_BOX * bb, label_point_t * p,
+static struct line_pnts *box_trans_rot(struct bound_box * bb, label_point_t * p,
double angle)
{
struct line_pnts *Points;
@@ -1157,7 +1157,7 @@
if ((labels[i].candidates[j].rotation == 0) &&
(labels[k].candidates[l].rotation == 0)) {
- BOUND_BOX a, b;
+ struct bound_box a, b;
a.N =
labels[i].bb.N + labels[i].candidates[j].point.y;
@@ -1230,7 +1230,7 @@
* @param b Bounding box B
* @return REtruns 1 if the two boxes overlap 0 if not.
*/
-static int box_overlap(BOUND_BOX * a, BOUND_BOX * b)
+static int box_overlap(struct bound_box * a, struct bound_box * b)
{
int vert = 0, hori = 0;
Modified: grass/trunk/vector/v.label.sa/labels.h
===================================================================
--- grass/trunk/vector/v.label.sa/labels.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.label.sa/labels.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -46,7 +46,7 @@
struct line_pnts *skyline; /**< The skyline of the text, as an offest
* from the label point */
- BOUND_BOX bb;
+ struct bound_box bb;
double size;
double current_score; /**< The current score of the label. */
Modified: grass/trunk/vector/v.neighbors/main.c
===================================================================
--- grass/trunk/vector/v.neighbors/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.neighbors/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -38,7 +38,7 @@
double radius;
struct ilist *List;
struct Cell_head region;
- BOUND_BOX box;
+ struct bound_box box;
struct line_pnts *Points;
struct line_cats *Cats;
Modified: grass/trunk/vector/v.normal/main.c
===================================================================
--- grass/trunk/vector/v.normal/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.normal/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -63,7 +63,7 @@
int line, nlines, npoints;
struct line_pnts *Points;
struct line_cats *Cats;
- BOUND_BOX box;
+ struct bound_box box;
/* Attributes */
int nrecords;
Modified: grass/trunk/vector/v.out.dxf/main.c
===================================================================
--- grass/trunk/vector/v.out.dxf/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.out.dxf/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -93,7 +93,7 @@
double do_limits(struct Map_info *Map)
{
double textsize;
- BOUND_BOX box;
+ struct bound_box box;
Vect_get_map_box(Map, &box);
Modified: grass/trunk/vector/v.out.svg/main.c
===================================================================
--- grass/trunk/vector/v.out.svg/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.out.svg/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -50,7 +50,7 @@
*field_opt;
struct GModule *module;
struct Map_info In;
- BOUND_BOX box;
+ struct bound_box box;
/* vector */
struct line_pnts *Points;
Modified: grass/trunk/vector/v.patch/main.c
===================================================================
--- grass/trunk/vector/v.patch/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.patch/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -506,7 +506,7 @@
}
if (BBoxMap) { /* inspired by v.in.region */
- BOUND_BOX box;
+ struct bound_box box;
double diff_long, mid_long;
static int cat;
Modified: grass/trunk/vector/v.select/main.c
===================================================================
--- grass/trunk/vector/v.select/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.select/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -141,7 +141,7 @@
G_message(_("Processing features..."));
for (aline = 1; aline <= nalines; aline++) {
- BOUND_BOX abox;
+ struct bound_box abox;
G_debug(3, "aline = %d", aline);
G_percent(aline, nalines, 2); /* must be before any continue */
@@ -272,7 +272,7 @@
naareas = Vect_get_num_areas(&(In[0]));
for (aarea = 1; aarea <= naareas; aarea++) {
- BOUND_BOX abox;
+ struct bound_box abox;
G_percent(aarea, naareas, 2); /* must be before any continue */
Modified: grass/trunk/vector/v.support/main.c
===================================================================
--- grass/trunk/vector/v.support/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.support/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -177,8 +177,8 @@
char buf[2000]; /* derived from Vect_hist_command() */
/* Open history file for modification */
- sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map.name);
- Map.hist_fp = G_fopen_modify(buf, GRASS_VECT_HIST_ELEMENT);
+ sprintf(buf, "%s/%s", GV_DIRECTORY, Map.name);
+ Map.hist_fp = G_fopen_modify(buf, GV_HIST_ELEMENT);
if (Map.hist_fp == NULL) {
G_warning(_("Unable to open history file for vector map <%s>"),
Vect_get_full_name(&Map));
Modified: grass/trunk/vector/v.to.3d/main.c
===================================================================
--- grass/trunk/vector/v.to.3d/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.to.3d/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -27,7 +27,7 @@
struct GModule *module;
struct opts opt;
struct Map_info In, Out;
- BOUND_BOX box;
+ struct bound_box box;
int field, type;
int ret;
Modified: grass/trunk/vector/v.transform/main.c
===================================================================
--- grass/trunk/vector/v.transform/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.transform/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -66,7 +66,7 @@
char mon[4], date[40], buf[1000];
struct Map_info Old, New;
int day, yr;
- BOUND_BOX box;
+ struct bound_box box;
double ztozero;
double trans_params[7]; // xshift, ..., xscale, ..., zrot
Modified: grass/trunk/vector/v.voronoi/defs.h
===================================================================
--- grass/trunk/vector/v.voronoi/defs.h 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.voronoi/defs.h 2009-07-31 11:46:59 UTC (rev 38552)
@@ -1,6 +1,6 @@
extern struct Cell_head Window;
-extern BOUND_BOX Box;
+extern struct bound_box Box;
extern struct Map_info In, Out;
extern int Type;
extern int All;
Modified: grass/trunk/vector/v.voronoi/sw_main.c
===================================================================
--- grass/trunk/vector/v.voronoi/sw_main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.voronoi/sw_main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -27,7 +27,7 @@
int PQmin;
struct Cell_head Window;
-BOUND_BOX Box;
+struct bound_box Box;
struct Map_info In, Out;
int Type;
int All;
Modified: grass/trunk/vector/v.what.rast/main.c
===================================================================
--- grass/trunk/vector/v.what.rast/main.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/vector/v.what.rast/main.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -66,7 +66,7 @@
int outside_cnt; /* points outside region */
int nocat_cnt; /* points inside region but without category */
int dupl_cnt; /* duplicate categories */
- BOUND_BOX box;
+ struct bound_box box;
int *catexst, *cex;
struct field_info *Fi;
Modified: grass/trunk/visualization/nviz/src/site_attr_commands.c
===================================================================
--- grass/trunk/visualization/nviz/src/site_attr_commands.c 2009-07-31 11:43:54 UTC (rev 38551)
+++ grass/trunk/visualization/nviz/src/site_attr_commands.c 2009-07-31 11:46:59 UTC (rev 38552)
@@ -244,7 +244,7 @@
float *mr, float *mg, float *mb);
/* better move to ../../../include/P_site.h */
-SITE_ATT *G_sites_get_atts(struct Map_info *ptr, int *cat);
+struct site_att *G_sites_get_atts(struct Map_info *ptr, int *cat);
/*******************************************************************************/
@@ -395,7 +395,7 @@
int *ndx;
int ncols, i, index;
char buf[9182];
- SITE_ATT *sa;
+ struct site_att *sa;
if (argc != 3)
return (TCL_ERROR);
@@ -447,7 +447,7 @@
int *ndx;
int ncols, i, index;
char buf[9182];
- SITE_ATT *sa;
+ struct site_att *sa;
if (argc != 3)
return (TCL_ERROR);
@@ -500,7 +500,7 @@
int *ndx;
int ncols, i, cat;
char buf[9182];
- SITE_ATT *sa;
+ struct site_att *sa;
if (argc != 3)
return (TCL_ERROR);
@@ -511,7 +511,7 @@
ncols = G_sites_get_fields(Map, &cnames, &ctypes, &ndx);
- if ((sa = (SITE_ATT *) G_sites_get_atts(Map, &cat)) == NULL)
+ if ((sa = (struct site_att *) G_sites_get_atts(Map, &cat)) == NULL)
return (TCL_ERROR);
for (i = 0; i < ncols; i++) {
@@ -740,7 +740,7 @@
{
struct Map_info *Map;
geopoint *gpt;
- SITE_ATT *sa;
+ struct site_att *sa;
int *ctypes;
char **cnames;
int *ndx;
@@ -769,7 +769,7 @@
}
else if (ctypes[index] == 'd') {
if ((sa =
- (SITE_ATT *) G_sites_get_atts(Map, &(gpt->cat))) == NULL)
+ (struct site_att *) G_sites_get_atts(Map, &(gpt->cat))) == NULL)
continue;
else
gpt->color[nattr] =
@@ -778,7 +778,7 @@
}
else {
if ((sa =
- (SITE_ATT *) G_sites_get_atts(Map, &(gpt->cat))) == NULL)
+ (struct site_att *) G_sites_get_atts(Map, &(gpt->cat))) == NULL)
continue;
else
gpt->color[nattr] =
@@ -811,7 +811,7 @@
{
struct Map_info *Map;
geopoint *gpt;
- SITE_ATT *sa;
+ struct site_att *sa;
int *ctypes;
char **cnames;
int *ndx;
@@ -837,7 +837,7 @@
}
else if (ctypes[index] == 'd') {
if ((sa =
- (SITE_ATT *) G_sites_get_atts(Map, &(gpt->cat))) == NULL)
+ (struct site_att *) G_sites_get_atts(Map, &(gpt->cat))) == NULL)
continue;
else
gpt->size[nattr] =
@@ -845,7 +845,7 @@
}
else {
if ((sa =
- (SITE_ATT *) G_sites_get_atts(Map, &(gpt->cat))) == NULL)
+ (struct site_att *) G_sites_get_atts(Map, &(gpt->cat))) == NULL)
continue;
else
gpt->size[nattr] =
More information about the grass-commit
mailing list