[GRASS-SVN] r62336 - in grass/branches/releasebranch_7_0: . imagery/i.segment include include/defs lib/lidar lib/python/pygrass/docs lib/python/pygrass/raster lib/segment lib/vector/Vlib raster/r.cost raster/r.flow raster/r.resamp.bspline raster/r.spreadpath raster/r.stream.channel raster/r.stream.distance raster/r.stream.extract raster/r.stream.order raster/r.stream.segment raster/r.stream.snap raster/r.stream.stats raster/r.walk raster/r.watershed/seg vector/v.surf.bspline
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Oct 22 00:37:07 PDT 2014
Author: neteler
Date: 2014-10-22 00:37:07 -0700 (Wed, 22 Oct 2014)
New Revision: 62336
Modified:
grass/branches/releasebranch_7_0/
grass/branches/releasebranch_7_0/imagery/i.segment/create_isegs.c
grass/branches/releasebranch_7_0/imagery/i.segment/open_files.c
grass/branches/releasebranch_7_0/imagery/i.segment/write_output.c
grass/branches/releasebranch_7_0/include/defs/segment.h
grass/branches/releasebranch_7_0/include/segment.h
grass/branches/releasebranch_7_0/lib/lidar/raster.c
grass/branches/releasebranch_7_0/lib/lidar/zones.c
grass/branches/releasebranch_7_0/lib/python/pygrass/docs/raster.rst
grass/branches/releasebranch_7_0/lib/python/pygrass/raster/__init__.py
grass/branches/releasebranch_7_0/lib/python/pygrass/raster/segment.py
grass/branches/releasebranch_7_0/lib/segment/address.c
grass/branches/releasebranch_7_0/lib/segment/close.c
grass/branches/releasebranch_7_0/lib/segment/flush.c
grass/branches/releasebranch_7_0/lib/segment/format.c
grass/branches/releasebranch_7_0/lib/segment/get.c
grass/branches/releasebranch_7_0/lib/segment/get_row.c
grass/branches/releasebranch_7_0/lib/segment/init.c
grass/branches/releasebranch_7_0/lib/segment/local_proto.h
grass/branches/releasebranch_7_0/lib/segment/open.c
grass/branches/releasebranch_7_0/lib/segment/pagein.c
grass/branches/releasebranch_7_0/lib/segment/pageout.c
grass/branches/releasebranch_7_0/lib/segment/put.c
grass/branches/releasebranch_7_0/lib/segment/put_row.c
grass/branches/releasebranch_7_0/lib/segment/release.c
grass/branches/releasebranch_7_0/lib/segment/seek.c
grass/branches/releasebranch_7_0/lib/segment/segmentlib.dox
grass/branches/releasebranch_7_0/lib/segment/setup.c
grass/branches/releasebranch_7_0/lib/vector/Vlib/open.c
grass/branches/releasebranch_7_0/raster/r.cost/main.c
grass/branches/releasebranch_7_0/raster/r.flow/io.c
grass/branches/releasebranch_7_0/raster/r.flow/mem.c
grass/branches/releasebranch_7_0/raster/r.flow/mem.h
grass/branches/releasebranch_7_0/raster/r.resamp.bspline/main.c
grass/branches/releasebranch_7_0/raster/r.resamp.bspline/resamp.c
grass/branches/releasebranch_7_0/raster/r.spreadpath/drawline.c
grass/branches/releasebranch_7_0/raster/r.spreadpath/main.c
grass/branches/releasebranch_7_0/raster/r.spreadpath/path_finder.c
grass/branches/releasebranch_7_0/raster/r.stream.channel/io.c
grass/branches/releasebranch_7_0/raster/r.stream.channel/stream_topology.c
grass/branches/releasebranch_7_0/raster/r.stream.channel/stream_write.c
grass/branches/releasebranch_7_0/raster/r.stream.distance/distance_calc.c
grass/branches/releasebranch_7_0/raster/r.stream.distance/distance_init.c
grass/branches/releasebranch_7_0/raster/r.stream.distance/io.c
grass/branches/releasebranch_7_0/raster/r.stream.extract/bseg.c
grass/branches/releasebranch_7_0/raster/r.stream.extract/cseg.c
grass/branches/releasebranch_7_0/raster/r.stream.extract/dseg.c
grass/branches/releasebranch_7_0/raster/r.stream.extract/seg.c
grass/branches/releasebranch_7_0/raster/r.stream.order/io.c
grass/branches/releasebranch_7_0/raster/r.stream.order/stream_raster_close.c
grass/branches/releasebranch_7_0/raster/r.stream.order/stream_topology.c
grass/branches/releasebranch_7_0/raster/r.stream.order/stream_vector.c
grass/branches/releasebranch_7_0/raster/r.stream.segment/io.c
grass/branches/releasebranch_7_0/raster/r.stream.segment/stream_topology.c
grass/branches/releasebranch_7_0/raster/r.stream.snap/io.c
grass/branches/releasebranch_7_0/raster/r.stream.snap/points_io.c
grass/branches/releasebranch_7_0/raster/r.stream.snap/snap.c
grass/branches/releasebranch_7_0/raster/r.stream.stats/io.c
grass/branches/releasebranch_7_0/raster/r.stream.stats/stats_prepare.c
grass/branches/releasebranch_7_0/raster/r.walk/main.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_close.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_get.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_open.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_put.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_close.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_get.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_open.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_put.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_read.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_write.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_close.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_get.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_open.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_put.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_read.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_write.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_close.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_get.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_open.c
grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_put.c
grass/branches/releasebranch_7_0/vector/v.surf.bspline/main.c
grass/branches/releasebranch_7_0/vector/v.surf.bspline/resamp.c
Log:
libsegment: function prefixes change from segment_ to Segment_ (trunk r62324, trac #2422)
Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Deleted: svn:mergeinfo
- /grass/trunk:61280,62141,62144,62269,62271,62276,62288,62300,62305,62310,62325,62328-62329,62331
Modified: grass/branches/releasebranch_7_0/imagery/i.segment/create_isegs.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.segment/create_isegs.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/imagery/i.segment/create_isegs.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -143,13 +143,13 @@
for (row = 0; row < globals->nrows; row++) {
for (col = 0; col < globals->ncols; col++) {
FLAG_SET(globals->null_flag, row, col);
- segment_get(&globals->bounds_seg, &bounds_val,
+ Segment_get(&globals->bounds_seg, &bounds_val,
row, col);
if (!Rast_is_c_null_value(&bounds_val)
&& bounds_val == current_bound) {
- segment_get(&globals->rid_seg, &rid, row, col);
+ Segment_get(&globals->rid_seg, &rid, row, col);
if (!Rast_is_c_null_value(&rid)) {
have_bound = 1;
@@ -178,7 +178,7 @@
flag_clear_all(globals->null_flag);
for (row = 0; row < globals->nrows; row++) {
for (col = 0; col < globals->ncols; col++) {
- segment_get(&globals->rid_seg, &rid, row, col);
+ Segment_get(&globals->rid_seg, &rid, row, col);
if (Rast_is_c_null_value(&rid))
FLAG_SET(globals->null_flag, row, col);
}
@@ -284,7 +284,7 @@
Ri.col = col;
/* get Ri's segment ID */
- segment_get(&globals->rid_seg, (void *)&Ri.id, Ri.row, Ri.col);
+ Segment_get(&globals->rid_seg, (void *)&Ri.id, Ri.row, Ri.col);
if (Ri.id < 0)
continue;
@@ -567,7 +567,7 @@
Ri.col = col;
/* get segment id */
- segment_get(&globals->rid_seg, (void *) &Ri.id, row, col);
+ Segment_get(&globals->rid_seg, (void *) &Ri.id, row, col);
if (Ri.id < 0)
continue;
@@ -731,7 +731,7 @@
rbtree_insert(no_check_tree, &ngbr_rc);
/* get neighbor ID */
- segment_get(&globals->rid_seg,
+ Segment_get(&globals->rid_seg,
(void *) &(globals->ns.id),
ngbr_rc.row, ngbr_rc.col);
@@ -867,8 +867,8 @@
}
/* similarity / distance between two points based on their input raster values */
-/* assumes first point values already saved in files->bands_seg - only run segment_get once for that value... */
-/* TODO: segment_get already happened for a[] values in the main function. Could remove a[] from these parameters */
+/* assumes first point values already saved in files->bands_seg - only run Segment_get once for that value... */
+/* TODO: Segment_get already happened for a[] values in the main function. Could remove a[] from these parameters */
double calculate_euclidean_similarity(struct ngbr_stats *Ri,
struct ngbr_stats *Rk,
struct globals *globals)
@@ -1076,7 +1076,7 @@
rs->count, globals->min_reg_size);
}
- segment_get(&globals->rid_seg, (void *) &rid, row, col);
+ Segment_get(&globals->rid_seg, (void *) &rid, row, col);
if (rid != rs->id) {
G_fatal_error(_("Region ids are different"));
@@ -1088,7 +1088,7 @@
}
/* update region stats */
- segment_put(&globals->bands_seg, (void *)rs->sum, row, col);
+ Segment_put(&globals->bands_seg, (void *)rs->sum, row, col);
count = 1;
/* fast version for rs->count == 2 */
@@ -1108,13 +1108,13 @@
if ((FLAG_GET(globals->null_flag, ngbr_rc.row, ngbr_rc.col)) == 0) {
- segment_get(&globals->rid_seg, (void *) &rid,
+ Segment_get(&globals->rid_seg, (void *) &rid,
ngbr_rc.row, ngbr_rc.col);
if (rid == rs->id) {
/* update region stats */
- segment_put(&globals->bands_seg,
+ Segment_put(&globals->bands_seg,
(void *)rs->sum,
ngbr_rc.row, ngbr_rc.col);
@@ -1168,7 +1168,7 @@
/* not yet checked, don't check it again */
rbtree_insert(rc_check_tree, &ngbr_rc);
- segment_get(&globals->rid_seg, (void *) &rid,
+ Segment_get(&globals->rid_seg, (void *) &rid,
ngbr_rc.row, ngbr_rc.col);
if (rid == rs->id) {
@@ -1177,7 +1177,7 @@
rclist_add(&rlist, ngbr_rc.row, ngbr_rc.col);
/* update region stats */
- segment_put(&globals->bands_seg,
+ Segment_put(&globals->bands_seg,
(void *)rs->sum,
ngbr_rc.row, ngbr_rc.col);
count++;
@@ -1282,7 +1282,7 @@
* need to clear candidate flag for Rk and set new id */
/* the actual merge: change region id */
- segment_put(&globals->rid_seg, (void *) &Ri->id, Rk->row, Rk->col);
+ Segment_put(&globals->rid_seg, (void *) &Ri->id, Rk->row, Rk->col);
if (do_cand) {
do_cand = 0;
@@ -1320,12 +1320,12 @@
if (!(FLAG_GET(globals->null_flag, ngbr_rc.row, ngbr_rc.col))) {
- segment_get(&globals->rid_seg, (void *) &R_id,
+ Segment_get(&globals->rid_seg, (void *) &R_id,
ngbr_rc.row, ngbr_rc.col);
if (R_id == Rk->id) {
/* the actual merge: change region id */
- segment_put(&globals->rid_seg, (void *) &Ri->id, ngbr_rc.row, ngbr_rc.col);
+ Segment_put(&globals->rid_seg, (void *) &Ri->id, ngbr_rc.row, ngbr_rc.col);
/* want to check this neighbor's neighbors */
rclist_add(&rlist, ngbr_rc.row, ngbr_rc.col);
@@ -1347,7 +1347,7 @@
/* update region id for Ri */
/* the actual merge: change region id */
- segment_put(&globals->rid_seg, (void *) &Rk->id, Ri->row, Ri->col);
+ Segment_put(&globals->rid_seg, (void *) &Rk->id, Ri->row, Ri->col);
rclist_init(&rlist);
rclist_add(&rlist, Ri->row, Ri->col);
@@ -1370,11 +1370,11 @@
if (!(FLAG_GET(globals->null_flag, ngbr_rc.row, ngbr_rc.col))) {
- segment_get(&globals->rid_seg, (void *) &R_id, ngbr_rc.row, ngbr_rc.col);
+ Segment_get(&globals->rid_seg, (void *) &R_id, ngbr_rc.row, ngbr_rc.col);
if (R_id == Ri->id) {
/* the actual merge: change region id */
- segment_put(&globals->rid_seg, (void *) &Rk->id, ngbr_rc.row, ngbr_rc.col);
+ Segment_put(&globals->rid_seg, (void *) &Rk->id, ngbr_rc.row, ngbr_rc.col);
/* want to check this neighbor's neighbors */
rclist_add(&rlist, ngbr_rc.row, ngbr_rc.col);
@@ -1453,7 +1453,7 @@
if (!(FLAG_GET(globals->candidate_flag, ngbr_rc.row, ngbr_rc.col)) == value) {
- segment_get(&globals->rid_seg, (void *) &R_id, ngbr_rc.row, ngbr_rc.col);
+ Segment_get(&globals->rid_seg, (void *) &R_id, ngbr_rc.row, ngbr_rc.col);
if (R_id == head->id) {
/* want to check this neighbor's neighbors */
@@ -1510,7 +1510,7 @@
if (rs->id <= 0)
G_fatal_error("Invalid region id %d", rs->id);
- segment_get(&globals->bands_seg, (void *)globals->bands_val,
+ Segment_get(&globals->bands_seg, (void *)globals->bands_val,
row, col);
rs->count = 1;
memcpy(rs->sum, globals->bands_val, globals->datasize);
@@ -1537,7 +1537,7 @@
if ((FLAG_GET(globals->null_flag, ngbr_rc.row, ngbr_rc.col)) == 0) {
- segment_get(&globals->rid_seg, (void *) &rid,
+ Segment_get(&globals->rid_seg, (void *) &rid,
ngbr_rc.row, ngbr_rc.col);
if (rid == rs->id) {
@@ -1601,7 +1601,7 @@
/* not yet checked, don't check it again */
rbtree_insert(rc_check_tree, &ngbr_rc);
- segment_get(&globals->rid_seg, (void *) &rid,
+ Segment_get(&globals->rid_seg, (void *) &rid,
ngbr_rc.row, ngbr_rc.col);
if (rid == rs->id) {
Modified: grass/branches/releasebranch_7_0/imagery/i.segment/open_files.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.segment/open_files.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/imagery/i.segment/open_files.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -125,12 +125,12 @@
nseg = manage_memory(srows, scols, globals);
/* create segment structures */
- if (segment_open
+ if (Segment_open
(&globals->bands_seg, G_tempfile(), globals->nrows, globals->ncols, srows,
scols, inlen, nseg) != 1)
G_fatal_error("Unable to create input temporary files");
- if (segment_open
+ if (Segment_open
(&globals->rid_seg, G_tempfile(), globals->nrows, globals->ncols, srows,
scols, outlen, nseg * 2) != 1)
G_fatal_error("Unable to create input temporary files");
@@ -169,7 +169,7 @@
globals->bands_val[n] = (inbuf[n][col] - min[n]) / (max[n] - min[n]);
}
}
- if (segment_put(&globals->bands_seg,
+ if (Segment_put(&globals->bands_seg,
(void *)globals->bands_val, row, col) != 1)
G_fatal_error(_("Unable to write to temporary file"));
@@ -196,7 +196,7 @@
FLAG_SET(globals->null_flag, row, col);
}
if (!globals->seeds || is_null) {
- if (segment_put(&globals->rid_seg,
+ if (Segment_put(&globals->rid_seg,
(void *)&id, row, col) != 1)
G_fatal_error(_("Unable to write to temporary file"));
}
@@ -219,7 +219,7 @@
Rast_set_c_null_value(&globals->lower_bound, 1);
if (globals->bounds_map != NULL) {
- if (segment_open
+ if (Segment_open
(&globals->bounds_seg, G_tempfile(), globals->nrows, globals->ncols,
srows, scols, sizeof(CELL), nseg) != TRUE)
G_fatal_error("Unable to create bounds temporary files");
@@ -256,7 +256,7 @@
globals->upper_bound = bounds_val;
}
}
- if (segment_put(&globals->bounds_seg, &bounds_val, row, col) != 1)
+ if (Segment_put(&globals->bounds_seg, &bounds_val, row, col) != 1)
G_fatal_error(_("Unable to write to temporary file"));
}
}
@@ -267,7 +267,7 @@
G_warning(_("There are no boundary constraints in '%s'"), globals->bounds_map);
Rast_set_c_null_value(&globals->upper_bound, 1);
Rast_set_c_null_value(&globals->lower_bound, 1);
- segment_close(&globals->bounds_seg);
+ Segment_close(&globals->bounds_seg);
globals->bounds_map = NULL;
globals->bounds_mapset = NULL;
}
@@ -321,7 +321,7 @@
G_message(_("Loading seeds from '%s'"), globals->seeds);
- if (segment_open
+ if (Segment_open
(&seeds_seg, G_tempfile(), globals->nrows, globals->ncols,
srows, scols, sizeof(CELL), nseg) != TRUE)
G_fatal_error("Unable to create bounds temporary files");
@@ -343,7 +343,7 @@
if (!Rast_is_c_null_value(&seeds_val))
have_seeds = 1;
}
- if (segment_put(&seeds_seg, &seeds_val, row, col) != 1)
+ if (Segment_put(&seeds_seg, &seeds_val, row, col) != 1)
G_fatal_error(_("Unable to write to temporary file"));
}
}
@@ -352,7 +352,7 @@
G_warning(_("No seeds found in '%s'!"), globals->seeds);
G_free(seeds_buf);
Rast_close(seeds_fd);
- segment_close(&seeds_seg);
+ Segment_close(&seeds_seg);
return 0;
}
@@ -369,7 +369,7 @@
!(FLAG_GET(globals->candidate_flag, row, col))) {
if (Rast_is_c_null_value(&(seeds_buf[col]))) {
- if (segment_put(&globals->rid_seg, &sneg, row, col) != 1)
+ if (Segment_put(&globals->rid_seg, &sneg, row, col) != 1)
G_fatal_error(_("Unable to write to temporary file"));
sneg--;
globals->n_regions--;
@@ -386,7 +386,7 @@
G_free(seeds_buf);
Rast_close(seeds_fd);
- segment_close(&seeds_seg);
+ Segment_close(&seeds_seg);
globals->n_regions = spos - 1;
@@ -406,10 +406,10 @@
G_debug(4, "read_seed()");
/* get Ri's segment ID from input seeds */
- segment_get(seeds_seg, &Ri_id, Ri->row, Ri->col);
+ Segment_get(seeds_seg, &Ri_id, Ri->row, Ri->col);
/* set new segment id */
- if (segment_put(&globals->rid_seg, &new_id, Ri->row, Ri->col) != 1)
+ if (Segment_put(&globals->rid_seg, &new_id, Ri->row, Ri->col) != 1)
G_fatal_error(_("Unable to write to temporary file"));
/* set candidate flag */
FLAG_SET(globals->candidate_flag, Ri->row, Ri->col);
@@ -418,7 +418,7 @@
globals->rs.count = 1;
globals->rs.id = new_id;
- segment_get(&globals->bands_seg, (void *)globals->bands_val,
+ Segment_get(&globals->bands_seg, (void *)globals->bands_val,
Ri->row, Ri->col);
for (i = 0; i < globals->nbands; i++) {
@@ -455,7 +455,7 @@
continue;
}
- segment_get(seeds_seg, (void *) &Rk_id, ngbr_rc.row, ngbr_rc.col);
+ Segment_get(seeds_seg, (void *) &Rk_id, ngbr_rc.row, ngbr_rc.col);
G_debug(5, "Rk ID = %d Ri ID = %d", Rk_id, Ri_id);
@@ -464,7 +464,7 @@
}
/* set segment id */
- if (segment_put(&globals->rid_seg,
+ if (Segment_put(&globals->rid_seg,
&new_id, ngbr_rc.row, ngbr_rc.col) != 1)
G_fatal_error(_("Unable to write to temporary file"));
@@ -475,7 +475,7 @@
rclist_add(&rilist, ngbr_rc.row, ngbr_rc.col);
/* update region stats */
- segment_get(&globals->bands_seg, (void *)globals->bands_val,
+ Segment_get(&globals->bands_seg, (void *)globals->bands_val,
ngbr_rc.row, ngbr_rc.col);
for (i = 0; i < globals->nbands; i++) {
Modified: grass/branches/releasebranch_7_0/imagery/i.segment/write_output.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.segment/write_output.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/imagery/i.segment/write_output.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -38,7 +38,7 @@
for (col = 0; col < globals->ncols; col++) {
if (!(FLAG_GET(globals->null_flag, row, col))) {
- segment_get(&globals->rid_seg, (void *) &rid, row, col);
+ Segment_get(&globals->rid_seg, (void *) &rid, row, col);
if (rid > 0) {
outbuf[col] = rid;
@@ -122,7 +122,7 @@
if (!(FLAG_GET(globals->null_flag, row, col))) {
- segment_get(&globals->rid_seg, (void *) &rid, row, col);
+ Segment_get(&globals->rid_seg, (void *) &rid, row, col);
if (rid > 0) {
@@ -203,14 +203,14 @@
{
/* close segmentation files and output raster */
G_debug(1, "closing files");
- segment_close(&globals->bands_seg);
+ Segment_close(&globals->bands_seg);
if (globals->bounds_map)
- segment_close(&globals->bounds_seg);
+ Segment_close(&globals->bounds_seg);
G_free(globals->bands_val);
G_free(globals->second_val);
- segment_close(&globals->rid_seg);
+ Segment_close(&globals->rid_seg);
flag_destroy(globals->null_flag);
flag_destroy(globals->candidate_flag);
Modified: grass/branches/releasebranch_7_0/include/defs/segment.h
===================================================================
--- grass/branches/releasebranch_7_0/include/defs/segment.h 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/include/defs/segment.h 2014-10-22 07:37:07 UTC (rev 62336)
@@ -1,16 +1,16 @@
#ifndef GRASS_SEGMENTDEFS_H
#define GRASS_SEGMENTDEFS_H
-int segment_open(SEGMENT *, char *, off_t, off_t, int, int, int, int);
-int segment_close(SEGMENT *);
-int segment_flush(SEGMENT *);
-int segment_format(int, off_t, off_t, int, int, int);
-int segment_format_nofill(int, off_t, off_t, int, int, int);
-int segment_get(SEGMENT *, void *, off_t, off_t);
-int segment_get_row(const SEGMENT *, void *, off_t);
-int segment_init(SEGMENT *, int, int);
-int segment_put(SEGMENT *, const void *, off_t, off_t);
-int segment_put_row(const SEGMENT *, const void *, off_t);
-int segment_release(SEGMENT *);
+int Segment_open(SEGMENT *, char *, off_t, off_t, int, int, int, int);
+int Segment_close(SEGMENT *);
+int Segment_flush(SEGMENT *);
+int Segment_format(int, off_t, off_t, int, int, int);
+int Segment_format_nofill(int, off_t, off_t, int, int, int);
+int Segment_get(SEGMENT *, void *, off_t, off_t);
+int Segment_get_row(const SEGMENT *, void *, off_t);
+int Segment_init(SEGMENT *, int, int);
+int Segment_put(SEGMENT *, const void *, off_t, off_t);
+int Segment_put_row(const SEGMENT *, const void *, off_t);
+int Segment_release(SEGMENT *);
#endif /* GRASS_SEGMENTDEFS_H */
Modified: grass/branches/releasebranch_7_0/include/segment.h
===================================================================
--- grass/branches/releasebranch_7_0/include/segment.h 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/include/segment.h 2014-10-22 07:37:07 UTC (rev 62336)
@@ -37,12 +37,12 @@
int fast_seek; /* toggles fast seek mode */
int lenbits; /* data size bitshift */
int sizebits; /* segment size bitshift */
- int (*segment_address)();
- int (*segment_seek)();
+ int (*Segment_address)();
+ int (*Segment_seek)();
char *fname; /* segment file name */
int fd; /* file descriptor to read/write segment */
- struct SEGMENT_SCB /* control blocks */
+ struct Segment_SCB /* control blocks */
{
char *buf; /* data buffer */
char dirty; /* dirty flag */
Modified: grass/branches/releasebranch_7_0/lib/lidar/raster.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/lidar/raster.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/lidar/raster.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -247,7 +247,7 @@
dval = interpolation;
}
else {
- segment_get(out_seg, &dval, row, col);
+ Segment_get(out_seg, &dval, row, col);
if ((X > Overlap.E) && (X < General.E)) {
if ((Y > Overlap.N) && (Y < General.N)) { /* (3) */
csi = (General.E - X) / overlap;
@@ -303,7 +303,7 @@
}
}
}
- segment_put(out_seg, &dval, row, col);
+ Segment_put(out_seg, &dval, row, col);
}
} /* END COL */
} /* END ROW */
Modified: grass/branches/releasebranch_7_0/lib/lidar/zones.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/lidar/zones.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/lidar/zones.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -420,7 +420,7 @@
for (row = startrow; row < endrow; row++) {
for (col = startcol; col < endcol; col++) {
- segment_get(in_seg, &z, row, col);
+ Segment_get(in_seg, &z, row, col);
if (!Rast_is_d_null_value(&z)) {
Modified: grass/branches/releasebranch_7_0/lib/python/pygrass/docs/raster.rst
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/pygrass/docs/raster.rst 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/python/pygrass/docs/raster.rst 2014-10-22 07:37:07 UTC (rev 62336)
@@ -178,7 +178,7 @@
The RasterSegment class define two methods to read and write the map:
* ``get_row`` that return the buffer object with the row that call the
- C function ``segment_get_row``. ::
+ C function ``Segment_get_row``. ::
>>> # call explicity the method
>>> elev_row0 = elev.get_row(0)
@@ -186,7 +186,7 @@
>>> elev_row0 = elev[0]
* ``get`` that return the value of the call map that call the
- C function ``segment_get``. ::
+ C function ``Segment_get``. ::
>>> # call explicity the method
>>> elev_val_0_0 = elev.get(0, 0)
Modified: grass/branches/releasebranch_7_0/lib/python/pygrass/raster/__init__.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/pygrass/raster/__init__.py 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/python/pygrass/raster/__init__.py 2014-10-22 07:37:07 UTC (rev 62336)
@@ -257,11 +257,11 @@
"""Raster_segment_access": Inherits "Raster_abstract_base" and uses the
segment library for cached randomly reading and writing access.
* Implements the [row][col] operator for read and write access using
- segement_get() and segment_put() functions internally
+ Segment_get() and Segment_put() functions internally
* Implements row read and write access with the [row] operator using
- segment_get_row() segment_put_row() internally
+ Segment_get_row() Segment_put_row() internally
* Implements the get_row() and put_row() method using
- segment_get_row() segment_put_row() internally
+ Segment_get_row() Segment_put_row() internally
* Implements the flush_segment() method
* Implements the copying of raster maps to segments and vice verse
* Overwrites the open and close methods
Modified: grass/branches/releasebranch_7_0/lib/python/pygrass/raster/segment.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/pygrass/raster/segment.py 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/python/pygrass/raster/segment.py 2014-10-22 07:37:07 UTC (rev 62336)
@@ -48,7 +48,7 @@
size = ctypes.sizeof(RTYPE[mapobj.mtype]['ctypes'])
file_name = libgis.G_tempfile()
#import pdb; pdb.set_trace()
- libseg.segment_open(self.c_seg, file_name,
+ libseg.Segment_open(self.c_seg, file_name,
self.rows(), self.cols(),
self.srows, self.scols,
size,
@@ -65,10 +65,10 @@
mapobj.temp_file = file(file_name, 'w')
size = ctypes.sizeof(RTYPE[mapobj.mtype]['ctypes'])
if fill:
- libseg.segment_format(mapobj.temp_file.fileno(), self.rows(),
+ libseg.Segment_format(mapobj.temp_file.fileno(), self.rows(),
self.cols(), self.srows, self.scols, size)
else:
- libseg.segment_format_nofill(mapobj.temp_file.fileno(),
+ libseg.Segment_format_nofill(mapobj.temp_file.fileno(),
self.rows(), self.cols(),
self.srows, self.scols, size)
# TODO: why should I close and then re-open it?
@@ -78,29 +78,29 @@
if file_name == '':
file_name = mapobj.temp_file.name
mapobj.temp_file = open(file_name, 'w')
- libseg.segment_init(self.c_seg, mapobj.temp_file.fileno(),
+ libseg.Segment_init(self.c_seg, mapobj.temp_file.fileno(),
self.segments_in_mem)
def get_row(self, row_index, buf):
"""Return the row using, the `segment` method"""
- libseg.segment_get_row(self.c_seg, buf.p, row_index)
+ libseg.Segment_get_row(self.c_seg, buf.p, row_index)
return buf
def put_row(self, row_index, buf):
"""Write the row using the `segment` method"""
- libseg.segment_put_row(self.c_seg, buf.p, row_index)
+ libseg.Segment_put_row(self.c_seg, buf.p, row_index)
def get(self, row_index, col_index):
"""Return the value of the map
"""
- libseg.segment_get(self.c_seg,
+ libseg.Segment_get(self.c_seg,
ctypes.byref(self.val), row_index, col_index)
return self.val.value
def put(self, row_index, col_index):
"""Write the value to the map
"""
- libseg.segment_put(self.c_seg,
+ libseg.Segment_put(self.c_seg,
ctypes.byref(self.val), row_index, col_index)
def get_seg_number(self, row_index, col_index):
@@ -111,19 +111,19 @@
def flush(self):
"""Flush pending updates to disk.
- Forces all pending updates generated by segment_put() to be written to
- the segment file seg. Must be called after the final segment_put()
+ Forces all pending updates generated by Segment_put() to be written to
+ the segment file seg. Must be called after the final Segment_put()
to force all pending updates to disk. Must also be called before the
- first call to segment_get_row."""
- libseg.segment_flush(self.c_seg)
+ first call to Segment_get_row."""
+ libseg.Segment_flush(self.c_seg)
def close(self):
"""Free memory allocated to segment and delete temp file. """
- libseg.segment_close(self.c_seg)
+ libseg.Segment_close(self.c_seg)
def release(self):
"""Free memory allocated to segment.
Releases the allocated memory associated with the segment file seg.
Note: Does not close the file. Does not flush the data which may be
- pending from previous segment_put() calls."""
- libseg.segment_release(self.c_seg)
+ pending from previous Segment_put() calls."""
+ libseg.Segment_release(self.c_seg)
Modified: grass/branches/releasebranch_7_0/lib/segment/address.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/address.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/address.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -27,7 +27,7 @@
#define INDEX_ADJ(SEG, i) \
((SEG)->fast_seek ? ((i) << (SEG)->lenbits) : ((i) * (SEG)->len))
-int segment_address_fast(const SEGMENT * SEG, off_t row, off_t col, int *n,
+int Segment_address_fast(const SEGMENT * SEG, off_t row, off_t col, int *n,
int *index)
{
@@ -70,7 +70,7 @@
return 0;
}
-int segment_address_slow(const SEGMENT * SEG, off_t row, off_t col, int *n,
+int Segment_address_slow(const SEGMENT * SEG, off_t row, off_t col, int *n,
int *index)
{
if (row) {
@@ -102,7 +102,7 @@
* \return always returns 0
*/
-int segment_address(const SEGMENT * SEG, off_t row, off_t col, int *n, int *index)
+int Segment_address(const SEGMENT * SEG, off_t row, off_t col, int *n, int *index)
{
/* old code
*n = row / SEG->srows * SEG->spr + col / SEG->scols;
@@ -112,5 +112,5 @@
/* this function is called at least once every time data are accessed in SEG
* avoid very slow modulus and divisions, modulus was the main time killer */
- return SEG->segment_address(SEG, row, col, n, index);
+ return SEG->Segment_address(SEG, row, col, n, index);
}
Modified: grass/branches/releasebranch_7_0/lib/segment/close.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/close.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/close.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -18,7 +18,7 @@
#include "local_proto.h"
/**
- * \fn int segment_close (SEGMENT *SEG)
+ * \fn int Segment_close (SEGMENT *SEG)
*
* \brief Free memory allocated to segment, delete temp file.
*
@@ -30,12 +30,12 @@
* \return -1 if SEGMENT is not available (not open)
*/
-int segment_close(SEGMENT *SEG)
+int Segment_close(SEGMENT *SEG)
{
if (SEG->open != 1)
return -1;
- segment_release(SEG);
+ Segment_release(SEG);
close(SEG->fd);
unlink(SEG->fname);
Modified: grass/branches/releasebranch_7_0/lib/segment/flush.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/flush.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/flush.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -16,26 +16,26 @@
/**
- * \fn int segment_flush (SEGMENT *SEG)
+ * \fn int Segment_flush (SEGMENT *SEG)
*
* \brief Flush pending updates to disk.
*
- * Forces all pending updates generated by <i>segment_put()</i> to be
+ * Forces all pending updates generated by <i>Segment_put()</i> to be
* written to the segment file <b>seg</b>. Must be called after the
- * final <i>segment_put()</i> to force all pending updates to disk. Must
- * also be called before the first call to <i>segment_get_row</i>.
+ * final <i>Segment_put()</i> to force all pending updates to disk. Must
+ * also be called before the first call to <i>Segment_get_row</i>.
*
* \param[in] SEG segment
* \return always returns 0
*/
-int segment_flush(SEGMENT * SEG)
+int Segment_flush(SEGMENT * SEG)
{
int i;
for (i = 0; i < SEG->nseg; i++)
if (SEG->scb[i].n >= 0 && SEG->scb[i].dirty)
- segment_pageout(SEG, i);
+ Segment_pageout(SEG, i);
return 0;
}
Modified: grass/branches/releasebranch_7_0/lib/segment/format.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/format.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/format.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -22,7 +22,7 @@
#include "local_proto.h"
-static int _segment_format(int, off_t, off_t, int, int, int, int);
+static int _Segment_format(int, off_t, off_t, int, int, int, int);
static int write_int(int, int);
static int write_off_t(int, off_t);
static int zero_fill(int, off_t);
@@ -59,10 +59,10 @@
* \return -3 if illegal parameters are passed
*/
-int segment_format(int fd, off_t nrows, off_t ncols, int srows, int scols,
+int Segment_format(int fd, off_t nrows, off_t ncols, int srows, int scols,
int len)
{
- return _segment_format(fd, nrows, ncols, srows, scols, len, 1);
+ return _Segment_format(fd, nrows, ncols, srows, scols, len, 1);
}
/**
@@ -97,14 +97,14 @@
* \return -3 if illegal parameters are passed
*/
-int segment_format_nofill(int fd, off_t nrows, off_t ncols, int srows, int scols,
+int Segment_format_nofill(int fd, off_t nrows, off_t ncols, int srows, int scols,
int len)
{
- return _segment_format(fd, nrows, ncols, srows, scols, len, 0);
+ return _Segment_format(fd, nrows, ncols, srows, scols, len, 0);
}
-static int _segment_format(int fd,
+static int _Segment_format(int fd,
off_t nrows, off_t ncols,
int srows, int scols, int len, int fill)
{
@@ -112,7 +112,7 @@
int spr, size;
if (nrows <= 0 || ncols <= 0 || len <= 0 || srows <= 0 || scols <= 0) {
- G_warning("segment_format(fd,%lld,%lld,%d,%d,%d): illegal value(s)",
+ G_warning("Segment_format(fd,%lld,%lld,%d,%d,%d): illegal value(s)",
nrows, ncols, srows, scols, len);
return -3;
}
@@ -147,7 +147,7 @@
}
if (lseek(fd, 0L, SEEK_SET) == (off_t) -1) {
- G_warning("segment_format(): Unable to seek (%s)", strerror(errno));
+ G_warning("Segment_format(): Unable to seek (%s)", strerror(errno));
return -1;
}
@@ -179,7 +179,7 @@
static int write_int(int fd, int n)
{
if (write(fd, &n, sizeof(int)) != sizeof(int)) {
- G_warning("segment_format(): Unable to write (%s)", strerror(errno));
+ G_warning("Segment_format(): Unable to write (%s)", strerror(errno));
return 0;
}
@@ -189,7 +189,7 @@
static int write_off_t(int fd, off_t n)
{
if (write(fd, &n, sizeof(off_t)) != sizeof(off_t)) {
- G_warning("segment_format(): Unable to write (%s)", strerror(errno));
+ G_warning("Segment_format(): Unable to write (%s)", strerror(errno));
return 0;
}
Modified: grass/branches/releasebranch_7_0/lib/segment/get.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/get.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/get.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -17,7 +17,7 @@
/*bugfix: buf: char* vs int* -> wrong pointer arithmetics!!!. Pierre de Mouveaux - 09 april 2000 */
-/* int segment_get (SEGMENT *SEG, register int *buf,int row,int col) */
+/* int Segment_get (SEGMENT *SEG, register int *buf,int row,int col) */
/**
@@ -36,12 +36,12 @@
* \return -1 if unable to seek or read segment file
*/
-int segment_get(SEGMENT * SEG, void *buf, off_t row, off_t col)
+int Segment_get(SEGMENT * SEG, void *buf, off_t row, off_t col)
{
int index, n, i;
- SEG->segment_address(SEG, row, col, &n, &index);
- if ((i = segment_pagein(SEG, n)) < 0)
+ SEG->Segment_address(SEG, row, col, &n, &index);
+ if ((i = Segment_pagein(SEG, n)) < 0)
return -1;
memcpy(buf, &SEG->scb[i].buf[index], SEG->len);
Modified: grass/branches/releasebranch_7_0/lib/segment/get_row.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/get_row.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/get_row.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -21,14 +21,14 @@
/**
- * \fn int segment_get_row (SEGMENT *SEG, void *buf, int row)
+ * \fn int Segment_get_row (SEGMENT *SEG, void *buf, int row)
*
* \brief Read row from segment file.
*
* Transfers data from a segment file, row by row, into memory
* (which can then be written to a regular matrix file). <b>Seg</b> is the
* segment structure that was configured from a call to
- * <i>segment_init()</i>.
+ * <i>Segment_init()</i>.
*
* <b>Buf</b> will be filled with <em>ncols*len</em> bytes of data
* corresponding to the <b>row</b> in the data matrix.
@@ -40,7 +40,7 @@
* \return -1 if unable to seek or read segment file
*/
-int segment_get_row(const SEGMENT * SEG, void *buf, off_t row)
+int Segment_get_row(const SEGMENT * SEG, void *buf, off_t row)
{
int size;
off_t ncols, col;
@@ -52,11 +52,11 @@
size = scols * SEG->len;
for (col = 0; col < ncols; col += scols) {
- SEG->segment_address(SEG, row, col, &n, &index);
- SEG->segment_seek(SEG, n, index);
+ SEG->Segment_address(SEG, row, col, &n, &index);
+ SEG->Segment_seek(SEG, n, index);
if (read(SEG->fd, buf, size) != size) {
- G_warning("segment_get_row: %s", strerror(errno));
+ G_warning("Segment_get_row: %s", strerror(errno));
return -1;
}
@@ -68,11 +68,11 @@
buf = ((char *)buf) + size;
}
if ((size = SEG->spill * SEG->len)) {
- SEG->segment_address(SEG, row, col, &n, &index);
- SEG->segment_seek(SEG, n, index);
+ SEG->Segment_address(SEG, row, col, &n, &index);
+ SEG->Segment_seek(SEG, n, index);
if (read(SEG->fd, buf, size) != size) {
- G_warning("segment_get_row: %s", strerror(errno));
+ G_warning("Segment_get_row: %s", strerror(errno));
return -1;
}
}
Modified: grass/branches/releasebranch_7_0/lib/segment/init.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/init.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/init.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -32,15 +32,15 @@
/**
- * \fn int segment_init (SEGMENT *SEG, int fd, int nseg)
+ * \fn int Segment_init (SEGMENT *SEG, int fd, int nseg)
*
* \brief Initialize segment structure.
*
* Initializes the <b>seg</b> structure. The file on <b>fd</b> is
- * a segment file created by <i>segment_format()</i> and must be open
+ * a segment file created by <i>Segment_format()</i> and must be open
* for reading and writing. The segment file configuration parameters
* <i>nrows, ncols, srows, scols</i>, and <i>len</i>, as written to the
- * file by <i>segment_format()</i>, are read from the file and stored in
+ * file by <i>Segment_format()</i>, are read from the file and stored in
* the <b>seg</b> structure. <b>nsegs</b> specifies the number of
* segments that will be retained in memory. The minimum value allowed
* is 1.
@@ -56,14 +56,14 @@
* \return -2 if out of memory
*/
-int segment_init(SEGMENT *SEG, int fd, int nseg)
+int Segment_init(SEGMENT *SEG, int fd, int nseg)
{
SEG->open = 0;
SEG->fd = fd;
SEG->nseg = nseg;
if (lseek(fd, 0L, SEEK_SET) < 0) {
- G_warning("segment_init: %s", strerror(errno));
+ G_warning("Segment_init: %s", strerror(errno));
return -1;
}
@@ -75,7 +75,7 @@
|| !read_int(fd, &SEG->len))
return -1;
- return segment_setup(SEG);
+ return Segment_setup(SEG);
}
Modified: grass/branches/releasebranch_7_0/lib/segment/local_proto.h
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/local_proto.h 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/local_proto.h 2014-10-22 07:37:07 UTC (rev 62336)
@@ -1,27 +1,27 @@
-#ifndef SEGMENT_LOCAL_H
-#define SEGMENT_LOCAL_H
+#ifndef Segment_LOCAL_H
+#define Segment_LOCAL_H
#include <grass/segment.h>
/* address.c */
-int segment_address(const SEGMENT *, off_t, off_t, int *, int *);
-int segment_address_fast(const SEGMENT *, off_t, off_t, int *, int *);
-int segment_address_slow(const SEGMENT *, off_t, off_t, int *, int *);
+int Segment_address(const SEGMENT *, off_t, off_t, int *, int *);
+int Segment_address_fast(const SEGMENT *, off_t, off_t, int *, int *);
+int Segment_address_slow(const SEGMENT *, off_t, off_t, int *, int *);
/* pagein.c */
-int segment_pagein(SEGMENT *, int);
+int Segment_pagein(SEGMENT *, int);
/* pageout.c */
-int segment_pageout(SEGMENT *, int);
+int Segment_pageout(SEGMENT *, int);
/* seek.c */
-int segment_seek(const SEGMENT *, int, int);
-int segment_seek_fast(const SEGMENT *, int, int);
-int segment_seek_slow(const SEGMENT *, int, int);
+int Segment_seek(const SEGMENT *, int, int);
+int Segment_seek_fast(const SEGMENT *, int, int);
+int Segment_seek_slow(const SEGMENT *, int, int);
/* setup.c */
-int segment_setup(SEGMENT *);
+int Segment_setup(SEGMENT *);
-#endif /* SEGMENT_LOCAL_H */
+#endif /* Segment_LOCAL_H */
Modified: grass/branches/releasebranch_7_0/lib/segment/open.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/open.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/open.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -22,7 +22,7 @@
* \brief Initialize segment structure and open segment file.
*
* Initializes the <b>seg</b> structure and prepares a temporary file.
- * This fn is a wrapper for segment_format() and segment_init()
+ * This fn is a wrapper for Segment_format() and Segment_init()
*
* <b>Note:</b> The file with name fname will be created anew.
*
@@ -44,7 +44,7 @@
*/
int
-segment_open(SEGMENT *SEG, char *fname, off_t nrows, off_t ncols,
+Segment_open(SEGMENT *SEG, char *fname, off_t nrows, off_t ncols,
int srows, int scols, int len, int nseg)
{
int ret;
@@ -66,7 +66,7 @@
G_warning(_("Unable to create segment file"));
return -1;
}
- if (0 > (ret = segment_format(SEG->fd, nrows, ncols, srows,
+ if (0 > (ret = Segment_format(SEG->fd, nrows, ncols, srows,
scols, len))) {
close(SEG->fd);
unlink(SEG->fname);
@@ -86,7 +86,7 @@
G_warning(_("Unable to re-open segment file"));
return -4;
}
- if (0 > (ret = segment_init(SEG, SEG->fd, nseg))) {
+ if (0 > (ret = Segment_init(SEG, SEG->fd, nseg))) {
close(SEG->fd);
unlink(SEG->fname);
if (ret == -1) {
Modified: grass/branches/releasebranch_7_0/lib/segment/pagein.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/pagein.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/pagein.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -21,7 +21,7 @@
/**
- * \fn int segment_pagein (SEGMENT *SEG, int n)
+ * \fn int Segment_pagein (SEGMENT *SEG, int n)
*
* \brief Segment pagein.
*
@@ -34,7 +34,7 @@
* \return -1 if unable to seek or read segment file
*/
-int segment_pagein(SEGMENT * SEG, int n)
+int Segment_pagein(SEGMENT * SEG, int n)
{
int cur;
int read_result;
@@ -77,7 +77,7 @@
/* write it out if dirty */
if (SEG->scb[cur].dirty) {
- if (segment_pageout(SEG, cur) < 0)
+ if (Segment_pageout(SEG, cur) < 0)
return -1;
}
}
@@ -90,20 +90,20 @@
/* read in the segment */
SEG->scb[cur].n = n;
SEG->scb[cur].dirty = 0;
- SEG->segment_seek(SEG, SEG->scb[cur].n, 0);
+ SEG->Segment_seek(SEG, SEG->scb[cur].n, 0);
read_result = read(SEG->fd, SEG->scb[cur].buf, SEG->size);
if (read_result != SEG->size) {
- G_debug(2, "segment_pagein: read_result=%d SEG->size=%d",
+ G_debug(2, "Segment_pagein: read_result=%d SEG->size=%d",
read_result, SEG->size);
if (read_result < 0)
- G_warning("segment_pagein: %s", strerror(errno));
+ G_warning("Segment_pagein: %s", strerror(errno));
else if (read_result == 0)
- G_warning("segment_pagein: read EOF");
+ G_warning("Segment_pagein: read EOF");
else
G_warning
- ("segment_pagein: short count during read(), got %d, expected %d",
+ ("Segment_pagein: short count during read(), got %d, expected %d",
read_result, SEG->size);
return -1;
Modified: grass/branches/releasebranch_7_0/lib/segment/pageout.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/pageout.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/pageout.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -21,7 +21,7 @@
/**
- * \fn int segment_pageout(SEGMENT *SEG, int i)
+ * \fn int Segment_pageout(SEGMENT *SEG, int i)
*
* \brief Pages segment to disk.
*
@@ -34,11 +34,11 @@
* \return -1 on error
*/
-int segment_pageout(SEGMENT * SEG, int i)
+int Segment_pageout(SEGMENT * SEG, int i)
{
- SEG->segment_seek(SEG, SEG->scb[i].n, 0);
+ SEG->Segment_seek(SEG, SEG->scb[i].n, 0);
if (write(SEG->fd, SEG->scb[i].buf, SEG->size) != SEG->size) {
- G_warning("segment_pageout: %s", strerror(errno));
+ G_warning("Segment_pageout: %s", strerror(errno));
return -1;
}
SEG->scb[i].dirty = 0;
Modified: grass/branches/releasebranch_7_0/lib/segment/put.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/put.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/put.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -18,11 +18,11 @@
/*bugfix: buf: char* vs int* -> wrong pointer arithmetics!!!. Pierre de Mouveaux - 09 april 2000 */
-/* int segment_put (SEGMENT *SEG,int *buf,int row,int col) */
+/* int Segment_put (SEGMENT *SEG,int *buf,int row,int col) */
/**
- * \fn int segment_put (SEGMENT *SEG, void *buf, int row, int col)
+ * \fn int Segment_put (SEGMENT *SEG, void *buf, int row, int col)
*
* \brief Write value to segment file.
*
@@ -42,12 +42,12 @@
* \return -1 if unable to seek or write segment file
*/
-int segment_put(SEGMENT * SEG, const void *buf, off_t row, off_t col)
+int Segment_put(SEGMENT * SEG, const void *buf, off_t row, off_t col)
{
int index, n, i;
- SEG->segment_address(SEG, row, col, &n, &index);
- if ((i = segment_pagein(SEG, n)) < 0) {
+ SEG->Segment_address(SEG, row, col, &n, &index);
+ if ((i = Segment_pagein(SEG, n)) < 0) {
G_warning("segment lib: put: pagein failed");
return -1;
}
Modified: grass/branches/releasebranch_7_0/lib/segment/put_row.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/put_row.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/put_row.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -21,7 +21,7 @@
/* buf is CELL * WRAT code */
-/* int segment_put_row (SEGMENT *SEG, CELL *buf,int row) */
+/* int Segment_put_row (SEGMENT *SEG, CELL *buf,int row) */
/**
@@ -29,7 +29,7 @@
*
* Transfers non-segmented matrix data, row by row, into a segment
* file. <b>seg</b> is the segment structure that was configured from a
- * call to <i>segment_init()</i>. <b>buf</b> should contain
+ * call to <i>Segment_init()</i>. <b>buf</b> should contain
* <em>ncols*len</em> bytes of data to be transferred to the segment
* file. <b>row</b> specifies the row from the data matrix being
* transferred.
@@ -41,7 +41,7 @@
* \return -1 if unable to seek or write segment file
*/
-int segment_put_row(const SEGMENT * SEG, const void *buf, off_t row)
+int Segment_put_row(const SEGMENT * SEG, const void *buf, off_t row)
{
int size;
off_t ncols;
@@ -53,15 +53,15 @@
ncols = SEG->ncols - SEG->spill;
scols = SEG->scols;
size = scols * SEG->len;
- /* printf("segment_put_row ncols: %d, scols %d, size: %d, col %d, row: %d, SEG->fd: %d\n",ncols,scols,size,col,row, SEG->fd); */
+ /* printf("Segment_put_row ncols: %d, scols %d, size: %d, col %d, row: %d, SEG->fd: %d\n",ncols,scols,size,col,row, SEG->fd); */
for (col = 0; col < ncols; col += scols) {
- SEG->segment_address(SEG, row, col, &n, &index);
- SEG->segment_seek(SEG, n, index);
+ SEG->Segment_address(SEG, row, col, &n, &index);
+ SEG->Segment_seek(SEG, n, index);
if ((result = write(SEG->fd, buf, size)) != size) {
- G_warning("segment_put_row write error %s", strerror(errno));
- /* printf("segment_put_row result = %d. ncols: %d, scols %d, size: %d, col %d, row: %d, SEG->fd: %d\n",result,ncols,scols,size,col,row, SEG->fd); */
+ G_warning("Segment_put_row write error %s", strerror(errno));
+ /* printf("Segment_put_row result = %d. ncols: %d, scols %d, size: %d, col %d, row: %d, SEG->fd: %d\n",result,ncols,scols,size,col,row, SEG->fd); */
return -1;
}
@@ -74,11 +74,11 @@
}
if ((size = SEG->spill * SEG->len)) {
- SEG->segment_address(SEG, row, col, &n, &index);
- SEG->segment_seek(SEG, n, index);
+ SEG->Segment_address(SEG, row, col, &n, &index);
+ SEG->Segment_seek(SEG, n, index);
if (write(SEG->fd, buf, size) != size) {
- G_warning("segment_put_row final write error: %s",
+ G_warning("Segment_put_row final write error: %s",
strerror(errno));
return -1;
}
Modified: grass/branches/releasebranch_7_0/lib/segment/release.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/release.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/release.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -18,7 +18,7 @@
/**
- * \fn int segment_release (SEGMENT *SEG)
+ * \fn int Segment_release (SEGMENT *SEG)
*
* \brief Free memory allocated to segment.
*
@@ -26,14 +26,14 @@
* <b>seg</b>.
*
* <b>Note:</b> Does not close the file. Does not flush the data which
- * may be pending from previous <i>segment_put()</i> calls.
+ * may be pending from previous <i>Segment_put()</i> calls.
*
* \param[in,out] SEG segment
* \return 1 if successful
* \return -1 if SEGMENT is not available (not open)
*/
-int segment_release(SEGMENT * SEG)
+int Segment_release(SEGMENT * SEG)
{
int i;
Modified: grass/branches/releasebranch_7_0/lib/segment/seek.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/seek.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/seek.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -37,27 +37,27 @@
#define SEG_SEEK_SLOW(SEG, n, index) \
((off_t) (n) * (SEG)->size + (index) + (SEG)->offset)
-int segment_seek_fast(const SEGMENT * SEG, int n, int index)
+int Segment_seek_fast(const SEGMENT * SEG, int n, int index)
{
if (lseek((SEG)->fd, SEG_SEEK_FAST(SEG, n, index),
SEEK_SET) == (off_t) -1) {
- G_fatal_error("segment_seek: %s", strerror(errno));
+ G_fatal_error("Segment_seek: %s", strerror(errno));
}
return 0;
}
-int segment_seek_slow(const SEGMENT * SEG, int n, int index)
+int Segment_seek_slow(const SEGMENT * SEG, int n, int index)
{
if (lseek((SEG)->fd, SEG_SEEK_SLOW(SEG, n, index),
SEEK_SET) == (off_t) -1) {
- G_fatal_error("segment_seek: %s", strerror(errno));
+ G_fatal_error("Segment_seek: %s", strerror(errno));
}
return 0;
}
-int segment_seek(const SEGMENT * SEG, int n, int index)
+int Segment_seek(const SEGMENT * SEG, int n, int index)
{
- return SEG->segment_seek(SEG, n, index);
+ return SEG->Segment_seek(SEG, n, index);
}
Modified: grass/branches/releasebranch_7_0/lib/segment/segmentlib.dox
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/segmentlib.dox 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/segmentlib.dox 2014-10-22 07:37:07 UTC (rev 62336)
@@ -60,7 +60,7 @@
the caller.
\note All routines and global variables in this library, documented
-or undocumented, start with the prefix \c segment_. To avoid name
+or undocumented, start with the prefix \c Segment_. To avoid name
conflicts, programmers should not create variables or routines in their own
modules which use this prefix.
@@ -86,7 +86,7 @@
This can be done with the <I>Segment Library</I> routine:
<P>
-<I>int segment_open(SEGMENT *SEG, char *fname, off_t nrows, off_t ncols,
+<I>int Segment_open(SEGMENT *SEG, char *fname, off_t nrows, off_t ncols,
int srows, int scols, int len, int nseg)</I>, open a new segment structure.
<P>
A new file with full path name <B>fname</B> will be created and
@@ -94,8 +94,8 @@
<B>nrows</B> and <B>ncols</B>. The segments consist of <B>srows</B> by
<B>scols</B>. The data items have length <B>len</B> bytes. The number
of segments to be retained in memory is given by <B>nseg</B>. This
- routine calls segment_format() and segment_init(), see below. If
- segment_open() is used, the routines segment_format() and segment_init()
+ routine calls Segment_format() and Segment_init(), see below. If
+ Segment_open() is used, the routines Segment_format() and Segment_init()
must not be used.
<P>
Return codes are: 1 ok; else a negative number between -1 and -6 encoding
@@ -106,7 +106,7 @@
formatted for use by the <I>Segment Library</I> routines:
<P>
-<I>int segment_format (int fd, int nrows, off_t ncols,off_t srows, int scols,
+<I>int Segment_format (int fd, int nrows, off_t ncols,off_t srows, int scols,
int len)</I>, format a segment file
<P>
The segmentation routines require a disk file to be used for paging
@@ -130,17 +130,17 @@
<P>
The next step is to initialize a SEGMENT structure to be associated with a
-segment file formatted by segment_format().
+segment file formatted by Segment_format().
<P>
-<I>int segment_init (SEGMENT *seg, int fd, int nsegs)</I>, initialize segment
+<I>int Segment_init (SEGMENT *seg, int fd, int nsegs)</I>, initialize segment
structure
<P>
Initializes the <B>seg</B> structure. The file on <B>fd</B> is
- a segment file created by segment_format() and must be open for
+ a segment file created by Segment_format() and must be open for
reading and writing. The segment file configuration parameters <I>nrows,
ncols, srows, scols</I>, and <I>len</I>, as written to the file by
- <I>segment_format</I>, are read from the file and stored in the
+ <I>Segment_format</I>, are read from the file and stored in the
<B>seg</B> structure. <B>Nsegs</B> specifies the number of segments that
will be retained in memory. The minimum value allowed is 1.
@@ -154,12 +154,12 @@
Then data can be written from another file to the segment file row by row:
<P>
-<I>int segment_put_row (SEGMENT *seg, char *buf, int row)</I>, write row to
+<I>int Segment_put_row (SEGMENT *seg, char *buf, int row)</I>, write row to
segment file
<P>
Transfers nonsegmented matrix data, row by row, into a segment
file. <B>Seg</B> is the segment structure that was configured from a call
- to segment_init(). <B>Buf</B> should contain <I>ncols*len</I>
+ to Segment_init(). <B>Buf</B> should contain <I>ncols*len</I>
bytes of data to be transferred to the segment file. <B>Row</B> specifies
the row from the data matrix being transferred.
@@ -170,7 +170,7 @@
Then data can be read or written to the segment file randomly:
<P>
-<I>int segment_get (SEGMENT *seg, char *value, int row, int col)</I>, get value
+<I>int Segment_get (SEGMENT *seg, char *value, int row, int col)</I>, get value
from segment file
<P>
Provides random read access to the segmented data. It gets
@@ -182,7 +182,7 @@
Return codes are: 1 if ok; else -1 could not seek or read segment file.
<P>
-<I>int segment_put (SEGMENT *seg, char *value, int row, int col)</I>, put
+<I>int Segment_put (SEGMENT *seg, char *value, int row, int col)</I>, put
value to segment file
<P>
Provides random write access to the segmented data. It
@@ -202,24 +202,24 @@
flushed to disk:
<P>
-<I>int segment_flush (SEGMENT *seg)</I>, flush pending updates to disk
+<I>int Segment_flush (SEGMENT *seg)</I>, flush pending updates to disk
<P>
- Forces all pending updates generated by segment_put() to be
+ Forces all pending updates generated by Segment_put() to be
written to the segment file <B>seg.</B> Must be called after the final
- segment_put() to force all pending updates to disk. Must also be called
- before the first call to segment_get_row().
+ Segment_put() to force all pending updates to disk. Must also be called
+ before the first call to Segment_get_row().
<P>
Now the data in segment file can be read row by row and transferred to a normal
sequential data file:
<P>
-<I>int segment_get_row (SEGMENT *seg, char *buf, int row)</I>, read row from
+<I>int Segment_get_row (SEGMENT *seg, char *buf, int row)</I>, read row from
segment file
<P>
Transfers data from a segment file, row by row, into memory
(which can then be written to a regular matrix file) . <B>Seg</B> is the
- segment structure that was configured from a call to segment_init().
+ segment structure that was configured from a call to Segment_init().
<B>Buf</B> will be filled with <I>ncols*len</I> bytes of data
corresponding to the <B>row</B> in the data matrix.
@@ -230,11 +230,11 @@
Finally, memory allocated in the SEGMENT structure is freed:
<P>
-<I>int segment_release (SEGMENT *seg)</I>, free allocated memory
+<I>int Segment_release (SEGMENT *seg)</I>, free allocated memory
<P>
Releases the allocated memory associated with the segment file
<B>seg.</B> Does not close the file. Does not flush the data which may
- be pending from previous segment_put() calls.
+ be pending from previous Segment_put() calls.
<P>
@@ -242,9 +242,9 @@
memory:
<P>
-<I>int segment_close (SEGMENT *seg)</I>, close segment structure
+<I>int Segment_close (SEGMENT *seg)</I>, close segment structure
<P>
- Deletes the segment file and uses segment_release() to release the
+ Deletes the segment file and uses Segment_release() to release the
allocated memory. No further cleaing up is required.
<P>
@@ -260,7 +260,7 @@
\code
SEGMENT seg;
-segment_open (&seg, G_tempfile(), nrows, ncols, srows, scols, sizeof(int), nseg);
+Segment_open (&seg, G_tempfile(), nrows, ncols, srows, scols, sizeof(int), nseg);
\endcode
Alternatively, the first step is the creation and formatting of a segment
@@ -270,7 +270,7 @@
\code
fd = creat (file, 0666);
-segment_format (fd, nrows, ncols, srows, scols, sizeof(int));
+Segment_format (fd, nrows, ncols, srows, scols, sizeof(int));
close(fd);
\endcode
@@ -286,7 +286,7 @@
SEGMENT seg;
fd = open (file, O_RDWR);
-segment_init (&seg, fd, nseg);
+Segment_init (&seg, fd, nseg);
\endcode
<P>
@@ -299,7 +299,7 @@
{
// code to get original matrix data for row into buf
- segment_put_row (&seg, buf, row);
+ Segment_put_row (&seg, buf, row);
}
\endcode
@@ -307,11 +307,11 @@
<P>
Of course if the intention is only to add new values rather than update existing
values, the step which transfers data from the original matrix to the segment
-file, using segment_put_row(), could be omitted, since
-segment_format() will fill the segment file with zeros.
+file, using Segment_put_row(), could be omitted, since
+Segment_format() will fill the segment file with zeros.
<P>
-The data can now be accessed directly using segment_get(). For example,
+The data can now be accessed directly using Segment_get(). For example,
to get the value at a given row and column:
\code
@@ -319,11 +319,11 @@
SEGMENT seg;
-segment_get (&seg, &value, row, col);
+Segment_get (&seg, &value, row, col);
\endcode
<P>
-Similarly segment_put() can be used to change data values in the
+Similarly Segment_put() can be used to change data values in the
segment file:
@@ -334,16 +334,16 @@
value = 10;
-segment_put (&seg, &value, row, col);
+Segment_put (&seg, &value, row, col);
\endcode
\warning It is an easy mistake to pass a value directly to
-segment_put(). The following should be avoided:
+Segment_put(). The following should be avoided:
\code
-segment_put (&seg, 10, row, col); // this will not work
+Segment_put (&seg, 10, row, col); // this will not work
\endcode
<P>
@@ -353,11 +353,11 @@
\code
-segment_flush (&seg);
+Segment_flush (&seg);
for (row = 0; row < nrows; row++)
{
- segment_get_row (&seg, buf, row);
+ Segment_get_row (&seg, buf, row);
// code to put buf into a matrix data file for row
}
@@ -369,7 +369,7 @@
\code
-segment_release (&seg);
+Segment_release (&seg);
close (fd);
\endcode
Modified: grass/branches/releasebranch_7_0/lib/segment/setup.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/segment/setup.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/segment/setup.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -20,7 +20,7 @@
/**
- * \fn int segment_setup (SEGMENT *SEG)
+ * \fn int Segment_setup (SEGMENT *SEG)
*
* \brief Setup segment.
*
@@ -33,7 +33,7 @@
* \return -2 if unable to allocate memory
*/
-int segment_setup(SEGMENT * SEG)
+int Segment_setup(SEGMENT * SEG)
{
int i;
int seg_exp, n_total_segs;
@@ -43,7 +43,7 @@
if (SEG->nrows <= 0 || SEG->ncols <= 0
|| SEG->srows <= 0 || SEG->scols <= 0
|| SEG->len <= 0 || SEG->nseg <= 0) {
- G_warning("segment_setup: illegal segment file parameters");
+ G_warning("Segment_setup: illegal segment file parameters");
return -1;
}
@@ -71,13 +71,13 @@
SEG->srowbits = seg_exp;
SEG->segbits = SEG->srowbits + SEG->scolbits;
SEG->fast_adrs = 1;
- G_debug(1, "segment_setup: fast address activated");
+ G_debug(1, "Segment_setup: fast address activated");
}
}
if (SEG->fast_adrs)
- SEG->segment_address = segment_address_fast;
+ SEG->Segment_address = Segment_address_fast;
else
- SEG->segment_address = segment_address_slow;
+ SEG->Segment_address = Segment_address_slow;
/* fast seek */
SEG->fast_seek = 0;
@@ -89,25 +89,25 @@
SEG->lenbits = seg_exp;
SEG->sizebits = SEG->segbits + SEG->lenbits;
SEG->fast_seek = 1;
- G_debug(1, "segment_setup: fast seek activated");
+ G_debug(1, "Segment_setup: fast seek activated");
}
}
if (SEG->fast_seek)
- SEG->segment_seek = segment_seek_fast;
+ SEG->Segment_seek = Segment_seek_fast;
else
- SEG->segment_seek = segment_seek_slow;
+ SEG->Segment_seek = Segment_seek_slow;
/* adjust number of open segments if larger than number of total segments */
n_total_segs = SEG->spr * ((SEG->nrows + SEG->srows - 1) / SEG->srows);
if (SEG->nseg > n_total_segs) {
- G_debug(1, "segment_setup: reducing number of open segments from %d to %d",
+ G_debug(1, "Segment_setup: reducing number of open segments from %d to %d",
SEG->nseg, n_total_segs);
SEG->nseg = n_total_segs;
}
if ((SEG->scb =
- (struct SEGMENT_SCB *)G_malloc(SEG->nseg *
- sizeof(struct SEGMENT_SCB))) == NULL)
+ (struct Segment_SCB *)G_malloc(SEG->nseg *
+ sizeof(struct Segment_SCB))) == NULL)
return -2;
if ((SEG->freeslot = (int *)G_malloc(SEG->nseg * sizeof(int))) == NULL)
@@ -148,7 +148,7 @@
SEG->cur = 0;
SEG->open = 1;
- /* SEG->loaded = rbtree_create(segment_compare, sizeof(SEGID)); */
+ /* SEG->loaded = rbtree_create(Segment_compare, sizeof(SEGID)); */
/* SEG->loaded = NULL; */
/* index for each segment, same like cache of r.proj */
Modified: grass/branches/releasebranch_7_0/lib/vector/Vlib/open.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/vector/Vlib/open.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/lib/vector/Vlib/open.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -240,7 +240,9 @@
}
else {
char file_path[GPATH_MAX];
-
+ /* reduce to current mapset if search path was set */
+ if(strcmp(Map->mapset, "") == 0)
+ Map->mapset = G_store(G_mapset());
/* temporary map: reduce to current mapset if search path
* was set */
if (strcmp(Map->mapset, "") == 0)
Modified: grass/branches/releasebranch_7_0/raster/r.cost/main.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.cost/main.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.cost/main.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -423,12 +423,12 @@
/* Create segmented format files for cost layer and output layer */
G_verbose_message(_("Creating some temporary files..."));
- if (segment_open(&cost_seg, G_tempfile(), nrows, ncols, srows, scols,
+ if (Segment_open(&cost_seg, G_tempfile(), nrows, ncols, srows, scols,
sizeof(struct cc), segments_in_memory) != 1)
G_fatal_error(_("Can not create temporary file"));
if (dir == TRUE) {
- if (segment_open(&dir_seg, G_tempfile(), nrows, ncols, srows, scols,
+ if (Segment_open(&dir_seg, G_tempfile(), nrows, ncols, srows, scols,
sizeof(FCELL), segments_in_memory) != 1)
G_fatal_error(_("Can not create temporary file"));
}
@@ -485,7 +485,7 @@
p = null_cost;
}
costs.cost_in = p;
- segment_put(&cost_seg, &costs, row, i);
+ Segment_put(&cost_seg, &costs, row, i);
ptr2 = G_incr_void_ptr(ptr2, dsize);
}
}
@@ -498,7 +498,7 @@
for (row = 0; row < nrows; row++) {
G_percent(row, nrows, 2);
for (col = 0; col < ncols; col++) {
- segment_put(&dir_seg, &dnullval, row, col);
+ Segment_put(&dir_seg, &dnullval, row, col);
}
}
G_percent(1, 1, 1);
@@ -675,21 +675,21 @@
if (!Rast_is_null_value(ptr2, data_type2)) {
double cellval;
- segment_get(&cost_seg, &costs, row, col);
+ Segment_get(&cost_seg, &costs, row, col);
cellval = Rast_get_d_value(ptr2, data_type2);
if (start_with_raster_vals == 1) {
insert(cellval, row, col);
costs.cost_out = cellval;
costs.nearest = cellval;
- segment_put(&cost_seg, &costs, row, col);
+ Segment_put(&cost_seg, &costs, row, col);
}
else {
value = &zero;
insert(zero, row, col);
costs.cost_out = *value;
costs.nearest = cellval;
- segment_put(&cost_seg, &costs, row, col);
+ Segment_put(&cost_seg, &costs, row, col);
}
got_one = 1;
}
@@ -718,12 +718,12 @@
|| top_start_pt->col < 0 || top_start_pt->col >= ncols)
G_fatal_error(_("Specified starting location outside database window"));
insert(zero, top_start_pt->row, top_start_pt->col);
- segment_get(&cost_seg, &costs, top_start_pt->row,
+ Segment_get(&cost_seg, &costs, top_start_pt->row,
top_start_pt->col);
costs.cost_out = *value;
costs.nearest = top_start_pt->value;
- segment_put(&cost_seg, &costs, top_start_pt->row,
+ Segment_put(&cost_seg, &costs, top_start_pt->row,
top_start_pt->col);
top_start_pt = top_start_pt->next;
}
@@ -755,7 +755,7 @@
break;
/* If I've already been updated, delete me */
- segment_get(&cost_seg, &costs, pres_cell->row, pres_cell->col);
+ Segment_get(&cost_seg, &costs, pres_cell->row, pres_cell->col);
old_min_cost = costs.cost_out;
if (!Rast_is_d_null_value(&old_min_cost)) {
if (pres_cell->min_cost > old_min_cost) {
@@ -879,7 +879,7 @@
continue;
min_cost = dnullval;
- segment_get(&cost_seg, &costs, row, col);
+ Segment_get(&cost_seg, &costs, row, col);
switch (neighbor) {
case 1:
@@ -968,27 +968,27 @@
if (Rast_is_d_null_value(&min_cost))
continue;
- segment_get(&cost_seg, &costs, row, col);
+ Segment_get(&cost_seg, &costs, row, col);
old_min_cost = costs.cost_out;
/* add to list */
if (Rast_is_d_null_value(&old_min_cost)) {
costs.cost_out = min_cost;
costs.nearest = nearest;
- segment_put(&cost_seg, &costs, row, col);
+ Segment_put(&cost_seg, &costs, row, col);
insert(min_cost, row, col);
if (dir == TRUE) {
- segment_put(&dir_seg, &cur_dir, row, col);
+ Segment_put(&dir_seg, &cur_dir, row, col);
}
}
/* update with lower costs */
else if (old_min_cost > min_cost) {
costs.cost_out = min_cost;
costs.nearest = nearest;
- segment_put(&cost_seg, &costs, row, col);
+ Segment_put(&cost_seg, &costs, row, col);
insert(min_cost, row, col);
if (dir == TRUE) {
- segment_put(&dir_seg, &cur_dir, row, col);
+ Segment_put(&dir_seg, &cur_dir, row, col);
}
}
}
@@ -1060,7 +1060,7 @@
continue;
}
}
- segment_get(&cost_seg, &costs, row, col);
+ Segment_get(&cost_seg, &costs, row, col);
min_cost = costs.cost_out;
nearest = costs.nearest;
if (Rast_is_d_null_value(&min_cost)) {
@@ -1125,7 +1125,7 @@
for (row = 0; row < nrows; row++) {
p = dir_cell;
for (col = 0; col < ncols; col++) {
- segment_get(&dir_seg, &cur_dir, row, col);
+ Segment_get(&dir_seg, &cur_dir, row, col);
*((FCELL *) p) = cur_dir;
p = G_incr_void_ptr(p, dir_size);
}
@@ -1136,9 +1136,9 @@
G_free(dir_cell);
}
- segment_close(&cost_seg); /* release memory */
+ Segment_close(&cost_seg); /* release memory */
if (dir == TRUE)
- segment_close(&dir_seg);
+ Segment_close(&dir_seg);
Rast_close(cost_fd);
Rast_close(cum_fd);
if (dir == TRUE)
Modified: grass/branches/releasebranch_7_0/raster/r.flow/io.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.flow/io.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.flow/io.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -95,7 +95,7 @@
}
G_percent(1, 1, 1);
if (parm.seg)
- segment_flush(el.seg);
+ Segment_flush(el.seg);
Rast_close(fd);
if (parm.aspin) {
@@ -113,7 +113,7 @@
}
G_percent(1, 1, 1);
if (parm.seg)
- segment_flush(as.seg);
+ Segment_flush(as.seg);
Rast_close(fd);
}
@@ -148,7 +148,7 @@
if ((fd = G_open_new(string, name)) < 0)
G_fatal_error(_("Cannot create segment file %s"), name);
- if (segment_format(fd, region.rows + l.row_offset * 2,
+ if (Segment_format(fd, region.rows + l.row_offset * 2,
region.cols + l.col_offset * 2, SEGROWS, SEGCOLS,
sizeof(DCELL)) < 1)
G_fatal_error(_("Cannot format segment file %s"), name);
Modified: grass/branches/releasebranch_7_0/raster/r.flow/mem.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.flow/mem.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.flow/mem.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -35,7 +35,7 @@
void put_row_seg(layer l, int row)
{
- if (segment_put_row(l.seg, l.buf[row] - l.col_offset,
+ if (Segment_put_row(l.seg, l.buf[row] - l.col_offset,
row + l.row_offset) < 1)
G_fatal_error(_("Unable to write segment file for %s"), l.name);
}
@@ -64,12 +64,12 @@
if (parm.seg) {
G_debug(1, "Allocating memory: segment");
el.seg = (SEGMENT *) G_malloc(sizeof(SEGMENT));
- segment_init(el.seg, el.sfd, SEGSINMEM);
+ Segment_init(el.seg, el.sfd, SEGSINMEM);
as.seg = (SEGMENT *) G_malloc(sizeof(SEGMENT));
- segment_init(as.seg, as.sfd, SEGSINMEM);
+ Segment_init(as.seg, as.sfd, SEGSINMEM);
if (parm.dsout) {
ds.seg = (SEGMENT *) G_malloc(sizeof(SEGMENT));
- segment_init(ds.seg, ds.sfd, SEGSINMEM);
+ Segment_init(ds.seg, ds.sfd, SEGSINMEM);
}
}
@@ -122,11 +122,11 @@
G_free(el.buf[-1] - 1);
if (parm.seg) {
- segment_release(el.seg);
+ Segment_release(el.seg);
if (!parm.mem)
- segment_release(as.seg);
+ Segment_release(as.seg);
if (parm.dsout)
- segment_release(ds.seg);
+ Segment_release(ds.seg);
}
else {
G_free(el.buf[region.rows] - 1);
Modified: grass/branches/releasebranch_7_0/raster/r.flow/mem.h
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.flow/mem.h 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.flow/mem.h 2014-10-22 07:37:07 UTC (rev 62336)
@@ -29,8 +29,8 @@
void put_row_seg( /* l, row */ );
#define get_row(l, row) \
- ((parm.seg && (segment_flush(l.seg) < 1 || \
- segment_get_row(l.seg, l.buf[row] - l.col_offset, \
+ ((parm.seg && (Segment_flush(l.seg) < 1 || \
+ Segment_get_row(l.seg, l.buf[row] - l.col_offset, \
row + l.row_offset) < 1)) ? \
(sprintf(string, "r.flow: cannot write segment file for %s", l.name),\
G_fatal_error(string), (DCELL *) NULL) : \
@@ -38,8 +38,8 @@
/* This was is Astley's version 12...
> #define get_cell_row(l, row) \
- > ((parm.seg && (segment_flush(l.seg) < 1 || \
- > segment_get_row(l.seg, l.buf[row] - l.col_offset, \
+ > ((parm.seg && (Segment_flush(l.seg) < 1 || \
+ > Segment_get_row(l.seg, l.buf[row] - l.col_offset, \
> row + l.row_offset) < 1)) ? \
> (sprintf(string, "r.flow: cannot write segment file for %s", l.name),\
> G_fatal_error(string), (CELL *) NULL) : \
@@ -49,7 +49,7 @@
#define aspect(row, col) \
(parm.seg ? \
- (segment_get(as.seg, &v, \
+ (Segment_get(as.seg, &v, \
row + as.row_offset, col + as.col_offset) < 1 ? \
(sprintf(string,"r.flow: cannot read segment file for %s",as.name), \
G_fatal_error(string), 0) : \
@@ -62,7 +62,7 @@
#define get(l, row, col) \
(parm.seg ? \
- (segment_get(l.seg, &v, row + l.row_offset, col + l.col_offset) < 1 ? \
+ (Segment_get(l.seg, &v, row + l.row_offset, col + l.col_offset) < 1 ? \
(sprintf(string,"r.flow: cannot read segment file for %s",l.name),\
G_fatal_error(string), 0) : \
v) : \
@@ -71,7 +71,7 @@
#define put(l, row, col, w) \
(parm.seg ? \
(v = w, \
- segment_put(l.seg, &v, row + l.row_offset, col + l.col_offset) < 1 ? \
+ Segment_put(l.seg, &v, row + l.row_offset, col + l.col_offset) < 1 ? \
(sprintf(string,"r.flow: cannot write segment file for %s",l.name), \
G_fatal_error(string), 0) : \
0) : \
Modified: grass/branches/releasebranch_7_0/raster/r.resamp.bspline/main.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.resamp.bspline/main.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.resamp.bspline/main.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -304,12 +304,12 @@
in_file = G_tempfile();
in_fd = creat(in_file, 0666);
- if (segment_format(in_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(double)) != 1)
+ if (Segment_format(in_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(double)) != 1)
G_fatal_error(_("Can not create temporary file"));
close(in_fd);
in_fd = open(in_file, 2);
- if (segment_init(&in_seg, in_fd, segments_in_memory) != 1)
+ if (Segment_init(&in_seg, in_fd, segments_in_memory) != 1)
G_fatal_error(_("Can not initialize temporary file"));
/* read raster input */
@@ -332,7 +332,7 @@
got_one++;
}
}
- segment_put_row(&in_seg, drastbuf, row);
+ Segment_put_row(&in_seg, drastbuf, row);
}
if (!got_one)
@@ -366,7 +366,7 @@
G_done_msg(_("Cross validation finished for ew_step = %f and ns_step = %f"), stepE, stepN);
- segment_release(&in_seg); /* release memory */
+ Segment_release(&in_seg); /* release memory */
close(in_fd);
unlink(in_file);
@@ -390,12 +390,12 @@
mask_file = G_tempfile();
mask_fd = creat(mask_file, 0666);
- if (segment_format(mask_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(char)) != 1)
+ if (Segment_format(mask_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(char)) != 1)
G_fatal_error(_("Can not create temporary file"));
close(mask_fd);
mask_fd = open(mask_file, 2);
- if (segment_init(&mask_seg, mask_fd, segments_in_memory) != 1)
+ if (Segment_init(&mask_seg, mask_fd, segments_in_memory) != 1)
G_fatal_error(_("Can not initialize temporary file"));
if (mask_opt->answer) {
@@ -441,7 +441,7 @@
else
null_count++;
}
- segment_put(&mask_seg, &mask_val, row, col);
+ Segment_put(&mask_seg, &mask_val, row, col);
}
}
@@ -461,12 +461,12 @@
out_file = G_tempfile();
out_fd = creat(out_file, 0666);
- if (segment_format(out_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(double)) != 1)
+ if (Segment_format(out_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(double)) != 1)
G_fatal_error(_("Can not create temporary file"));
close(out_fd);
out_fd = open(out_file, 2);
- if (segment_init(&out_seg, out_fd, segments_in_memory) != 1)
+ if (Segment_init(&out_seg, out_fd, segments_in_memory) != 1)
G_fatal_error(_("Can not initialize temporary file"));
/* initialize output */
@@ -476,7 +476,7 @@
Rast_set_d_null_value(drastbuf, ncols);
for (row = 0; row < nrows; row++) {
G_percent(row, nrows, 9);
- segment_put_row(&out_seg, drastbuf, row);
+ Segment_put_row(&out_seg, drastbuf, row);
}
G_percent(row, nrows, 2);
@@ -723,12 +723,12 @@
} /*! END WHILE; last_column = TRUE */
} /*! END WHILE; last_row = TRUE */
- segment_release(&in_seg); /* release memory */
+ Segment_release(&in_seg); /* release memory */
close(in_fd);
unlink(in_file);
if (have_mask) {
- segment_release(&mask_seg); /* release memory */
+ Segment_release(&mask_seg); /* release memory */
close(mask_fd);
unlink(mask_file);
}
@@ -742,12 +742,12 @@
{
int nonulls = 0;
- segment_flush(&out_seg);
+ Segment_flush(&out_seg);
drastbuf = Rast_allocate_d_buf();
for (row = 0; row < dest_reg.rows; row++) {
G_percent(row, dest_reg.rows, 9);
- segment_get_row(&out_seg, drastbuf, row);
+ Segment_get_row(&out_seg, drastbuf, row);
for (col = 0; col < dest_reg.cols; col++) {
dval = drastbuf[col];
if (!Rast_is_d_null_value(&dval))
@@ -760,7 +760,7 @@
G_warning("only NULL cells in output raster");
}
- segment_release(&out_seg); /* release memory */
+ Segment_release(&out_seg); /* release memory */
close(out_fd);
unlink(out_file);
Modified: grass/branches/releasebranch_7_0/raster/r.resamp.bspline/resamp.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.resamp.bspline/resamp.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.resamp.bspline/resamp.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -78,7 +78,7 @@
for (row = startrow; row < endrow; row++) {
for (col = startcol; col < endcol; col++) {
- segment_get(mask_seg, &mask_val, row, col);
+ Segment_get(mask_seg, &mask_val, row, col);
if (!mask_val)
continue;
@@ -160,7 +160,7 @@
dval = interpolation;
}
else {
- segment_get(out_seg, &dval, row, col);
+ Segment_get(out_seg, &dval, row, col);
if ((X > Overlap.E) && (X < General.E)) {
if ((Y > Overlap.N) && (Y < General.N)) { /* (3) */
csi = (General.E - X) / overlap;
@@ -216,7 +216,7 @@
}
}
} /* end not in overlap */
- segment_put(out_seg, &dval, row, col);
+ Segment_put(out_seg, &dval, row, col);
} /* for num_points */
return 1;
Modified: grass/branches/releasebranch_7_0/raster/r.spreadpath/drawline.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.spreadpath/drawline.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.spreadpath/drawline.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -41,7 +41,7 @@
value = (char *)&data;
if (dx > dy) {
- segment_put(&out_seg, value, x, y);
+ Segment_put(&out_seg, value, x, y);
/*debug: printf("put1-(%d,%d) ",x,y); */
e = 2 * dy - dx;
inc1 = 2 * (dy - dx);
@@ -54,12 +54,12 @@
else
e += inc2;
x += incx;
- segment_put(&out_seg, value, x, y);
+ Segment_put(&out_seg, value, x, y);
/*debug:printf("put2-(%d,%d) ",x,y); */
}
}
else {
- segment_put(&out_seg, value, x, y);
+ Segment_put(&out_seg, value, x, y);
/*debug:printf("put3-(%d,%d) ",x,y); */
e = 2 * dx - dy;
inc1 = 2 * (dx - dy);
@@ -72,7 +72,7 @@
else
e += inc2;
y += incy;
- segment_put(&out_seg, value, x, y);
+ Segment_put(&out_seg, value, x, y);
/*debug:rintf("put4-(%d,%d) ",x,y); */
}
}
Modified: grass/branches/releasebranch_7_0/raster/r.spreadpath/main.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.spreadpath/main.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.spreadpath/main.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -186,24 +186,24 @@
/* Create segmented files for back cell and output layers */
in_row_fd = creat(in_row_file, 0666);
- segment_format(in_row_fd, nrows, ncols, srows, scols, len);
+ Segment_format(in_row_fd, nrows, ncols, srows, scols, len);
close(in_row_fd);
in_col_fd = creat(in_col_file, 0666);
- segment_format(in_col_fd, nrows, ncols, srows, scols, len);
+ Segment_format(in_col_fd, nrows, ncols, srows, scols, len);
close(in_col_fd);
out_fd = creat(out_file, 0666);
- segment_format(out_fd, nrows, ncols, srows, scols, len);
+ Segment_format(out_fd, nrows, ncols, srows, scols, len);
close(out_fd);
/* Open initialize and segment all files */
in_row_fd = open(in_row_file, 2);
- segment_init(&in_row_seg, in_row_fd, 4);
+ Segment_init(&in_row_seg, in_row_fd, 4);
in_col_fd = open(in_col_file, 2);
- segment_init(&in_col_seg, in_col_fd, 4);
+ Segment_init(&in_col_seg, in_col_fd, 4);
out_fd = open(out_file, 2);
- segment_init(&out_seg, out_fd, 4);
+ Segment_init(&out_seg, out_fd, 4);
/* Write the back cell layers in the segmented files, and
* Change UTM coordinates to ROWs and COLUMNs */
@@ -216,14 +216,14 @@
(window.north - cell[col]) / window.ns_res /* - 0.5 */ ;
else
cell[col] = -1;
- segment_put_row(&in_row_seg, cell, row);
+ Segment_put_row(&in_row_seg, cell, row);
Rast_get_c_row(backcol_fd, cell, row);
for (col = 0; col < ncols; col++)
if (cell[col] > 0)
cell[col] =
(cell[col] - window.west) / window.ew_res /* - 0.5 */ ;
- segment_put_row(&in_col_seg, cell, row);
+ Segment_put_row(&in_col_seg, cell, row);
}
/* Convert easting and northing from the command line to row and col */
@@ -242,7 +242,7 @@
}
value = (char *)&backrow;
- segment_get(&in_row_seg, value, row, col);
+ Segment_get(&in_row_seg, value, row, col);
/* ignore pt in no-data area */
if (backrow < 0) {
G_warning("Ignoring point in NO-DATA area :");
@@ -250,7 +250,7 @@
continue;
}
value = (char *)&backcol;
- segment_get(&in_col_seg, value, row, col);
+ Segment_get(&in_col_seg, value, row, col);
insert(&PRESENT_PT, row, col, backrow, backcol);
}
@@ -281,7 +281,7 @@
for (col = 0; col < ncols; col++) {
if (cell[col] > 0) {
value = (char *)&backrow;
- segment_get(&in_row_seg, value, row, col);
+ Segment_get(&in_row_seg, value, row, col);
/* ignore pt in no-data area */
if (backrow < 0) {
G_warning("Ignoring point in NO-DATA area:");
@@ -291,7 +291,7 @@
continue;
}
value = (char *)&backcol;
- segment_get(&in_col_seg, value, row, col);
+ Segment_get(&in_col_seg, value, row, col);
insert(&PRESENT_PT, row, col, backrow, backcol);
}
} /* loop over cols */
@@ -314,24 +314,24 @@
G_free(OLD_PT);
}
- /* Write pending updates by segment_put() to outputmap */
- segment_flush(&out_seg);
+ /* Write pending updates by Segment_put() to outputmap */
+ Segment_flush(&out_seg);
if (verbose)
G_message("\nWriting the output map -%s-...", path_layer);
path_fd = Rast_open_c_new(path_layer);
for (row = 0; row < nrows; row++) {
- segment_get_row(&out_seg, cell, row);
+ Segment_get_row(&out_seg, cell, row);
Rast_put_row(path_fd, cell, CELL_TYPE);
}
if (verbose)
G_message("finished.");
- segment_release(&in_row_seg); /* release memory */
- segment_release(&in_col_seg);
- segment_release(&out_seg);
+ Segment_release(&in_row_seg); /* release memory */
+ Segment_release(&in_col_seg);
+ Segment_release(&out_seg);
close(in_row_fd); /* close all files */
close(in_col_fd);
Modified: grass/branches/releasebranch_7_0/raster/r.spreadpath/path_finder.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.spreadpath/path_finder.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.spreadpath/path_finder.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -21,7 +21,7 @@
/* if the pt has already been traversed, return */
value = (char *)&data;
- segment_get(&out_seg, value, row, col);
+ Segment_get(&out_seg, value, row, col);
if (data == 1)
return; /* already traversed */
@@ -37,9 +37,9 @@
} /* reach an origin */
value = (char *)&new_backrow;
- segment_get(&in_row_seg, value, backrow, backcol);
+ Segment_get(&in_row_seg, value, backrow, backcol);
value = (char *)&new_backcol;
- segment_get(&in_col_seg, value, backrow, backcol);
+ Segment_get(&in_col_seg, value, backrow, backcol);
path_finder(backrow, backcol, new_backrow, new_backcol);
return;
Modified: grass/branches/releasebranch_7_0/raster/r.stream.channel/io.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.channel/io.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.channel/io.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -301,7 +301,7 @@
fd = creat(filename, 0666);
if (0 >
- segment_format(fd, seg->nrows, seg->ncols, srows, scols,
+ Segment_format(fd, seg->nrows, seg->ncols, srows, scols,
seg->data_size)) {
close(fd);
unlink(filename);
@@ -314,7 +314,7 @@
G_fatal_error(_("Unable to re-open file '%s'"), filename);
}
- if (0 > (fd = segment_init(&(seg->seg), fd, number_of_segs))) {
+ if (0 > (fd = Segment_init(&(seg->seg), fd, number_of_segs))) {
unlink(filename);
G_fatal_error(_("Unable to init segment file or out of memory"));
}
@@ -437,7 +437,7 @@
}
}
- if (0 > segment_put_row(&(seg->seg), target_buffer, r)) {
+ if (0 > Segment_put_row(&(seg->seg), target_buffer, r)) {
G_free(input_buffer);
G_free(target_buffer);
Rast_close(input_fd);
@@ -466,7 +466,7 @@
for (r = 0; r < seg->nrows; ++r)
for (c = 0; c < seg->ncols; ++c)
- segment_put(&(seg->seg), &value, r, c);
+ Segment_put(&(seg->seg), &value, r, c);
return 0;
}
@@ -498,13 +498,13 @@
G_message(_("Writing raster map <%s>..."), output_map_name);
output_fd = Rast_open_new(output_map_name, output_data_type);
output_buffer = Rast_allocate_buf(output_data_type);
- segment_flush(&(seg->seg));
+ Segment_flush(&(seg->seg));
/* writing */
for (r = 0; r < seg->nrows; ++r) {
G_percent(r, seg->nrows, 2);
- if (0 > segment_get_row(&(seg->seg), output_buffer, r))
+ if (0 > Segment_get_row(&(seg->seg), output_buffer, r))
G_warning(_("Unable to segment read row %d for raster map <%s>"),
r, output_map_name);
@@ -550,7 +550,7 @@
/*
* release segment close files, set pointers to null;
*/
- segment_release(&(seg->seg));
+ Segment_release(&(seg->seg));
close(seg->fd);
unlink(seg->filename);
Modified: grass/branches/releasebranch_7_0/raster/r.stream.channel/stream_topology.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.channel/stream_topology.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.channel/stream_topology.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -189,7 +189,7 @@
int next_r, next_c;
int streams_cell, streams_next_cell, dirs_next_cell;
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
for (i = 1; i < 9; ++i) {
if (NOT_IN_REGION(i))
continue;
@@ -197,8 +197,8 @@
j = DIAG(i);
next_r = NR(i);
next_c = NC(i);
- segment_get(streams, &streams_next_cell, next_r, next_c);
- segment_get(dirs, &dirs_next_cell, next_r, next_c);
+ Segment_get(streams, &streams_next_cell, next_r, next_c);
+ Segment_get(dirs, &dirs_next_cell, next_r, next_c);
if (streams_next_cell > 0 && dirs_next_cell == j)
trib_num++;
}
@@ -211,8 +211,8 @@
j = DIAG(i);
next_r = NR(i);
next_c = NC(i);
- segment_get(streams, &streams_next_cell, next_r, next_c);
- segment_get(dirs, &dirs_next_cell, next_r, next_c);
+ Segment_get(streams, &streams_next_cell, next_r, next_c);
+ Segment_get(dirs, &dirs_next_cell, next_r, next_c);
if (streams_next_cell == streams_cell && dirs_next_cell == j)
trib_num--;
}
@@ -233,7 +233,7 @@
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c) {
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
if (streams_cell > 0)
if (seg_trib_nums(r, c, streams, dirs) != 1)
stream_num++;
@@ -265,7 +265,7 @@
/* finding inits */
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c) {
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
if (streams_cell)
if (seg_trib_nums(r, c, streams, dirs) != 1) { /* adding inits */
@@ -283,20 +283,20 @@
r = SA[i].init_r;
c = SA[i].init_c;
- segment_get(streams, &(SA[i].order), r, c);
- //segment_get(streams,&streams_cell,r,c);
+ Segment_get(streams, &(SA[i].order), r, c);
+ /* Segment_get(streams,&streams_cell,r,c); */
SA[i].number_of_cells = 0;
do {
SA[i].number_of_cells++;
- segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
d = abs(dirs_cell);
if (NOT_IN_REGION(d) || d == 0)
break;
r = NR(d);
c = NC(d);
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
} while (streams_cell == SA[i].order);
SA[i].number_of_cells += 2; /* add two extra points for init+ and outlet+ */
@@ -322,25 +322,25 @@
/* what to do if there is no contributing points? */
SA[i].points[0] = (contrib_cell == 0) ? -1 : INDEX(prev_r, prev_c);
- segment_get(elevation, &elevation_prev_cell, prev_r, prev_c);
+ Segment_get(elevation, &elevation_prev_cell, prev_r, prev_c);
SA[i].elevation[0] = (contrib_cell == 0) ? -99999 :
elevation_prev_cell;
if (contrib_cell == 0)
- segment_get(dirs, &d, r, c);
+ Segment_get(dirs, &d, r, c);
else
- segment_get(dirs, &d, prev_r, prev_c);
+ Segment_get(dirs, &d, prev_r, prev_c);
SA[i].distance[0] = (contrib_cell == 0) ? get_distance(r, c, d) :
get_distance(prev_r, prev_c, d);
SA[i].points[1] = INDEX(r, c);
- segment_get(elevation, &(SA[i].elevation[1]), r, c);
- segment_get(dirs, &d, r, c);
+ Segment_get(elevation, &(SA[i].elevation[1]), r, c);
+ Segment_get(dirs, &d, r, c);
SA[i].distance[1] = get_distance(r, c, d);
cell_num = 2;
do {
- segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
d = abs(dirs_cell);
if (NOT_IN_REGION(d) || d == 0) {
@@ -354,12 +354,12 @@
r = NR(d);
c = NC(d);
SA[i].points[cell_num] = INDEX(r, c);
- segment_get(elevation, &(SA[i].elevation[cell_num]), r, c);
- segment_get(dirs, &next_d, r, c);
+ Segment_get(elevation, &(SA[i].elevation[cell_num]), r, c);
+ Segment_get(dirs, &next_d, r, c);
next_d = (abs(next_d) == 0) ? d : abs(next_d);
SA[i].distance[cell_num] = get_distance(r, c, next_d);
cell_num++;
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
if (cell_num > SA[i].number_of_cells)
G_fatal_error(_("To much points in stream line..."));
} while (streams_cell == SA[i].order);
@@ -406,8 +406,8 @@
continue;
next_r = NR(i);
next_c = NC(i);
- segment_get(dirs, &dirs_next_cell, next_r, next_c);
- segment_get(elevation, &elevation_next_cell, next_r, next_c);
+ Segment_get(dirs, &dirs_next_cell, next_r, next_c);
+ Segment_get(elevation, &elevation_next_cell, next_r, next_c);
if (dirs_next_cell == DIAG(i) && elevation_next_cell < elev_min) {
elev_min = elevation_next_cell;
j = i;
Modified: grass/branches/releasebranch_7_0/raster/r.stream.channel/stream_write.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.channel/stream_write.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.channel/stream_write.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -17,7 +17,7 @@
for (r = 0; r < nrows; ++r) {
for (c = 0; c < ncols; ++c) {
Rast_set_d_null_value(&output_cell, 1);
- segment_put(output, &output_cell, r, c);
+ Segment_put(output, &output_cell, r, c);
}
}
@@ -59,7 +59,7 @@
for (j = 1; j < SA[i].number_of_cells - 1; ++j) {
r = (int)SA[i].points[j] / ncols;
c = (int)SA[i].points[j] % ncols;
- segment_put(identifier, &(SA[i].stream_num), r, c);
+ Segment_put(identifier, &(SA[i].stream_num), r, c);
}
}
@@ -115,14 +115,14 @@
cum_length += SA[i].distance[j];
r = (int)SA[i].points[j] / ncols;
c = (int)SA[i].points[j] % ncols;
- segment_put(output, &cum_length, r, c);
+ Segment_put(output, &cum_length, r, c);
}
else
for (j = SA[i].number_of_cells - 2; j > 0; --j) {
cum_length += SA[i].distance[j];
r = (int)SA[i].points[j] / ncols;
c = (int)SA[i].points[j] % ncols;
- segment_put(output, &cum_length, r, c);
+ Segment_put(output, &cum_length, r, c);
}
}
@@ -167,7 +167,7 @@
r = (int)SA[i].points[j] / ncols;
c = (int)SA[i].points[j] % ncols;
output_cell = downstream ? k : j;
- segment_put(output, &output_cell, r, c);
+ Segment_put(output, &output_cell, r, c);
}
}
@@ -217,7 +217,7 @@
SA[i].elevation[j] - SA[i].elevation[j + 1];
r = (int)SA[i].points[j] / ncols;
c = (int)SA[i].points[j] % ncols;
- segment_put(output, &output_cell, r, c);
+ Segment_put(output, &output_cell, r, c);
}
}
@@ -273,7 +273,7 @@
r = (int)SA[i].points[j] / ncols;
c = (int)SA[i].points[j] % ncols;
output_cell = init - SA[i].elevation[j];
- segment_put(output, &output_cell, r, c);
+ Segment_put(output, &output_cell, r, c);
}
}
else {
@@ -282,7 +282,7 @@
r = (int)SA[i].points[j] / ncols;
c = (int)SA[i].points[j] % ncols;
output_cell = SA[i].elevation[j] - init;
- segment_put(output, &output_cell, r, c);
+ Segment_put(output, &output_cell, r, c);
}
}
}
@@ -347,7 +347,7 @@
r = (int)SA[i].points[j] / ncols;
c = (int)SA[i].points[j] % ncols;
output_cell = (init - SA[i].elevation[j]) / cum_length;
- segment_put(output, &output_cell, r, c);
+ Segment_put(output, &output_cell, r, c);
}
}
@@ -358,7 +358,7 @@
r = (int)SA[i].points[j] / ncols;
c = (int)SA[i].points[j] % ncols;
output_cell = (SA[i].elevation[j] - init) / cum_length;
- segment_put(output, &output_cell, r, c);
+ Segment_put(output, &output_cell, r, c);
}
}
}
@@ -411,7 +411,7 @@
(SA[i].elevation[j] - SA[i].elevation[j + 1]) <
0 ? 0 : (SA[i].elevation[j] - SA[i].elevation[j + 1]);
output_cell = elev_diff / SA[i].distance[j];
- segment_put(output, &output_cell, r, c);
+ Segment_put(output, &output_cell, r, c);
}
}
@@ -456,7 +456,7 @@
r = (int)SA[i].points[j] / ncols;
c = (int)SA[i].points[j] % ncols;
output_cell = SA[i].distance[j];
- segment_put(output, &output_cell, r, c);
+ Segment_put(output, &output_cell, r, c);
}
}
@@ -524,7 +524,7 @@
output_cell =
first_derivative /
pow((1 + second_derivative * second_derivative), 1.5);
- segment_put(output, &output_cell, r, c);
+ Segment_put(output, &output_cell, r, c);
}
}
Modified: grass/branches/releasebranch_7_0/raster/r.stream.distance/distance_calc.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.distance/distance_calc.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.distance/distance_calc.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -152,8 +152,8 @@
c = outlet.c;
if (elevation) {
- segment_get(elevation, &target_elev, r, c);
- segment_put(elevation, &zero_cell, r, c);
+ Segment_get(elevation, &target_elev, r, c);
+ Segment_put(elevation, &zero_cell, r, c);
}
while (tail != head) {
@@ -169,11 +169,11 @@
next_r = NR(i);
next_c = NC(i);
- segment_get(dirs, &dirs_cell, next_r, next_c);
+ Segment_get(dirs, &dirs_cell, next_r, next_c);
if (dirs_cell == j) { /* countributing cell, reset distance and elevation */
if (outs) { /* outlet mode */
- segment_get(distance, &distance_cell, next_r, next_c);
+ Segment_get(distance, &distance_cell, next_r, next_c);
if (distance_cell == 0)
continue; /* continue loop, point is not added to the queue! */
else {
@@ -185,17 +185,17 @@
tmp_dist + G_distance(easting, northing,
cell_easting,
cell_northing);
- segment_put(distance, &cur_dist, next_r, next_c);
+ Segment_put(distance, &cur_dist, next_r, next_c);
}
}
else { /* stream mode */
- segment_get(distance, &distance_cell, next_r, next_c);
+ Segment_get(distance, &distance_cell, next_r, next_c);
if (distance_cell == 0) {
cur_dist = 0;
if (elevation)
- segment_get(elevation, &target_elev, next_r,
+ Segment_get(elevation, &target_elev, next_r,
next_c);
}
else {
@@ -207,14 +207,14 @@
tmp_dist + G_distance(easting, northing,
cell_easting,
cell_northing);
- segment_put(distance, &cur_dist, next_r, next_c);
+ Segment_put(distance, &cur_dist, next_r, next_c);
}
} /* end stream mode */
if (elevation) {
- segment_get(elevation, &elevation_cell, next_r, next_c);
+ Segment_get(elevation, &elevation_cell, next_r, next_c);
elevation_cell -= target_elev;
- segment_put(elevation, &elevation_cell, next_r, next_c);
+ Segment_put(elevation, &elevation_cell, next_r, next_c);
n_cell.target_elev = target_elev;
}
@@ -297,7 +297,7 @@
val = 1;
stop = 0;
- segment_put(distance, &stop, r, c);
+ Segment_put(distance, &stop, r, c);
while (tail != head) {
@@ -309,13 +309,13 @@
next_r = NR(i);
next_c = NC(i);
- segment_get(dirs, &dirs_cell, next_r, next_c);
+ Segment_get(dirs, &dirs_cell, next_r, next_c);
if (dirs_cell == j) { /* countributing cell */
- segment_get(distance, &distance_cell, next_r, next_c);
+ Segment_get(distance, &distance_cell, next_r, next_c);
distance_cell = (distance_cell == stop) ? stop : val;
- segment_put(distance, &distance_cell, next_r, next_c);
+ Segment_put(distance, &distance_cell, next_r, next_c);
n_cell.r = next_r;
n_cell.c = next_c;
fifo_insert(n_cell);
@@ -495,15 +495,15 @@
/* elevation_data_size = Rast_cell_size(FCELL_TYPE); */
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c) {
- segment_get(elevation, &elevation_cell, r, c);
- segment_put(tmp_elevation, &elevation_cell, r, c);
+ Segment_get(elevation, &elevation_cell, r, c);
+ Segment_put(tmp_elevation, &elevation_cell, r, c);
}
}
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c) {
- segment_get(distance, &distance_cell, r, c);
+ Segment_get(distance, &distance_cell, r, c);
for (i = 1; i < 9; ++i) {
if (NOT_IN_REGION(i))
@@ -513,21 +513,21 @@
next_r = NR(i);
next_c = NC(i);
- segment_get(dirs, &dirs_cell, next_r, next_c);
+ Segment_get(dirs, &dirs_cell, next_r, next_c);
if (dirs_cell == j && distance_cell != 0) { /* is contributing cell */
- segment_put(distance, &minus_one_cell, r, c);
+ Segment_put(distance, &minus_one_cell, r, c);
break;
}
} /* end for i */
- segment_get(distance, &distance_cell, r, c);
- segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(distance, &distance_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
if (distance_cell == 1) {
if (distance_cell == 1 && dirs_cell > 0)
n_inits++;
else if (dirs_cell > 0)
- segment_put(distance, &minus_one_cell, r, c);
+ Segment_put(distance, &minus_one_cell, r, c);
}
}
@@ -538,15 +538,15 @@
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c) {
- segment_get(distance, &distance_cell, r, c);
+ Segment_get(distance, &distance_cell, r, c);
if (distance_cell == 1) {
- segment_put(distance, &zero_cell, r, c);
+ Segment_put(distance, &zero_cell, r, c);
if (elevation)
- segment_put(elevation, &zero_cell, r, c);
+ Segment_put(elevation, &zero_cell, r, c);
- segment_get(dirs, &d, r, c);
- segment_get(dirs, &d_next, NR(d), NR(d));
+ Segment_get(dirs, &d, r, c);
+ Segment_get(dirs, &d_next, NR(d), NR(d));
if (d_next < 0)
continue;
@@ -556,7 +556,7 @@
d_inits[k].cur_dist = 0;
if (elevation)
- segment_get(tmp_elevation, &(d_inits[k].target_elev), r,
+ Segment_get(tmp_elevation, &(d_inits[k].target_elev), r,
c);
k++;
}
@@ -573,7 +573,7 @@
r = d_inits[i].r;
c = d_inits[i].c;
- segment_get(dirs, &d, r, c);
+ Segment_get(dirs, &d, r, c);
next_r = NR(d);
next_c = NC(d);
tmp_dist = d_inits[i].cur_dist;
@@ -589,7 +589,7 @@
cur_dist = tmp_dist +
G_distance(easting, northing, cell_easting, cell_northing);
- segment_get(distance, &distance_cell, next_r, next_c);
+ Segment_get(distance, &distance_cell, next_r, next_c);
if (near)
done = (distance_cell > cur_dist ||
@@ -599,16 +599,16 @@
distance_cell <= 0) ? 1 : 0;
if (done) {
- segment_put(distance, &cur_dist, next_r, next_c);
+ Segment_put(distance, &cur_dist, next_r, next_c);
if (elevation) {
- segment_get(tmp_elevation, &tmp_elevation_cell, next_r,
+ Segment_get(tmp_elevation, &tmp_elevation_cell, next_r,
next_c);
tmp_elevation_cell = target_elev - tmp_elevation_cell;
- segment_put(elevation, &tmp_elevation_cell, next_r,
+ Segment_put(elevation, &tmp_elevation_cell, next_r,
next_c);
}
- segment_get(dirs, &dirs_cell, NR(d), NC(d));
+ Segment_get(dirs, &dirs_cell, NR(d), NC(d));
if (dirs_cell < 1)
continue;
Modified: grass/branches/releasebranch_7_0/raster/r.stream.distance/distance_init.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.distance/distance_init.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.distance/distance_init.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -82,7 +82,7 @@
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c) {
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
if (streams_cell > 0) {
if (outlets_num > (out_max - 1)) {
@@ -94,14 +94,14 @@
(out_max) * sizeof(OUTLET));
}
- segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
d = abs(dirs_cell); /* r.watershed */
if (NOT_IN_REGION(d)) {
next_stream = -1;
}
else {
- segment_get(streams, &next_stream, NR(d), NC(d));
+ Segment_get(streams, &next_stream, NR(d), NC(d));
if (next_stream < 1)
next_stream = -1;
}
@@ -164,18 +164,18 @@
if (!outs) { /* stream mode */
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c) {
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
distance_cell = (streams_cell) ? 0 : -1;
- segment_put(distance, &distance_cell, r, c);
+ Segment_put(distance, &distance_cell, r, c);
}
}
else { /* outlets mode */
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c)
- segment_put(distance, &minus_one_cell, r, c);
+ Segment_put(distance, &minus_one_cell, r, c);
for (i = 0; i < outlets_num; ++i)
- segment_put(distance, &zero_cell, outlets[i].r, outlets[i].c);
+ Segment_put(distance, &zero_cell, outlets[i].r, outlets[i].c);
}
return 0;
}
@@ -202,9 +202,9 @@
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c) {
- segment_get(distance, &distance_cell, r, c);
+ Segment_get(distance, &distance_cell, r, c);
if (distance_cell == -1)
- segment_put(elevation, &distance_cell, r, c);
+ Segment_put(elevation, &distance_cell, r, c);
}
return 0;
Modified: grass/branches/releasebranch_7_0/raster/r.stream.distance/io.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.distance/io.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.distance/io.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -301,7 +301,7 @@
fd = creat(filename, 0666);
if (0 >
- segment_format(fd, seg->nrows, seg->ncols, srows, scols,
+ Segment_format(fd, seg->nrows, seg->ncols, srows, scols,
seg->data_size)) {
close(fd);
unlink(filename);
@@ -314,7 +314,7 @@
G_fatal_error(_("Unable to re-open file '%s'"), filename);
}
- if (0 > (fd = segment_init(&(seg->seg), fd, number_of_segs))) {
+ if (0 > (fd = Segment_init(&(seg->seg), fd, number_of_segs))) {
unlink(filename);
G_fatal_error(_("Unable to init segment file or out of memory"));
}
@@ -437,7 +437,7 @@
}
}
- if (0 > segment_put_row(&(seg->seg), target_buffer, r)) {
+ if (0 > Segment_put_row(&(seg->seg), target_buffer, r)) {
G_free(input_buffer);
G_free(target_buffer);
Rast_close(input_fd);
@@ -466,7 +466,7 @@
for (r = 0; r < seg->nrows; ++r)
for (c = 0; c < seg->ncols; ++c)
- segment_put(&(seg->seg), &value, r, c);
+ Segment_put(&(seg->seg), &value, r, c);
return 0;
}
@@ -498,13 +498,13 @@
G_message(_("Writing raster map <%s>..."), output_map_name);
output_fd = Rast_open_new(output_map_name, output_data_type);
output_buffer = Rast_allocate_buf(output_data_type);
- segment_flush(&(seg->seg));
+ Segment_flush(&(seg->seg));
/* writing */
for (r = 0; r < seg->nrows; ++r) {
G_percent(r, seg->nrows, 2);
- if (0 > segment_get_row(&(seg->seg), output_buffer, r))
+ if (0 > Segment_get_row(&(seg->seg), output_buffer, r))
G_warning(_("Unable to segment read row %d for raster map <%s>"),
r, output_map_name);
@@ -550,7 +550,7 @@
/*
* release segment close files, set pointers to null;
*/
- segment_release(&(seg->seg));
+ Segment_release(&(seg->seg));
close(seg->fd);
unlink(seg->filename);
Modified: grass/branches/releasebranch_7_0/raster/r.stream.extract/bseg.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.extract/bseg.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.extract/bseg.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -19,7 +19,7 @@
G_warning(_("Unable to create segment file"));
return -2;
}
- if (0 > (errflag = segment_format(fd, Rast_window_rows(),
+ if (0 > (errflag = Segment_format(fd, Rast_window_rows(),
Rast_window_cols(), srows, scols,
sizeof(char)))) {
close(fd);
@@ -39,7 +39,7 @@
G_warning(_("Unable to re-open segment file"));
return -4;
}
- if (0 > (errflag = segment_init(&(bseg->seg), fd, nsegs_in_memory))) {
+ if (0 > (errflag = Segment_init(&(bseg->seg), fd, nsegs_in_memory))) {
close(fd);
unlink(filename);
if (errflag == -1) {
@@ -58,7 +58,7 @@
int bseg_close(BSEG *bseg)
{
- segment_release(&(bseg->seg));
+ Segment_release(&(bseg->seg));
close(bseg->fd);
unlink(bseg->filename);
if (bseg->name) {
@@ -74,7 +74,7 @@
int bseg_put(BSEG *bseg, char *value, int row, int col)
{
- if (segment_put(&(bseg->seg), value, row, col) < 0) {
+ if (Segment_put(&(bseg->seg), value, row, col) < 0) {
G_warning(_("Unable to write segment file"));
return -1;
}
@@ -83,7 +83,7 @@
int bseg_put_row(BSEG *bseg, char *value, int row)
{
- if (segment_put_row(&(bseg->seg), value, row) < 0) {
+ if (Segment_put_row(&(bseg->seg), value, row) < 0) {
G_warning(_("Unable to write segment file"));
return -1;
}
@@ -92,7 +92,7 @@
int bseg_get(BSEG *bseg, char *value, int row, int col)
{
- if (segment_get(&(bseg->seg), value, row, col) < 0) {
+ if (Segment_get(&(bseg->seg), value, row, col) < 0) {
G_warning(_("Unable to read segment file"));
return -1;
}
Modified: grass/branches/releasebranch_7_0/raster/r.stream.extract/cseg.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.extract/cseg.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.extract/cseg.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -21,7 +21,7 @@
}
if (0 >
(errflag =
- segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, scols,
+ Segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, scols,
sizeof(CELL)))) {
close(fd);
unlink(filename);
@@ -40,7 +40,7 @@
G_warning(_("Unable to re-open segment file"));
return -4;
}
- if (0 > (errflag = segment_init(&(cseg->seg), fd, nsegs_in_memory))) {
+ if (0 > (errflag = Segment_init(&(cseg->seg), fd, nsegs_in_memory))) {
close(fd);
unlink(filename);
if (errflag == -1) {
@@ -59,7 +59,7 @@
int cseg_close(CSEG *cseg)
{
- segment_release(&(cseg->seg));
+ Segment_release(&(cseg->seg));
close(cseg->fd);
unlink(cseg->filename);
if (cseg->name) {
@@ -75,7 +75,7 @@
int cseg_put(CSEG *cseg, CELL *value, int row, int col)
{
- if (segment_put(&(cseg->seg), value, row, col) < 0) {
+ if (Segment_put(&(cseg->seg), value, row, col) < 0) {
G_warning(_("Unable to write segment file"));
return -1;
}
@@ -84,7 +84,7 @@
int cseg_put_row(CSEG *cseg, CELL *value, int row)
{
- if (segment_put_row(&(cseg->seg), value, row) < 0) {
+ if (Segment_put_row(&(cseg->seg), value, row) < 0) {
G_warning(_("Unable to write segment file"));
return -1;
}
@@ -93,7 +93,7 @@
int cseg_get(CSEG *cseg, CELL *value, int row, int col)
{
- if (segment_get(&(cseg->seg), value, row, col) < 0) {
+ if (Segment_get(&(cseg->seg), value, row, col) < 0) {
G_warning(_("Unabel to read segment file"));
return -1;
}
@@ -114,7 +114,7 @@
buffer = Rast_allocate_c_buf();
for (row = 0; row < nrows; row++) {
Rast_get_c_row(map_fd, buffer, row);
- if (segment_put_row(&(cseg->seg), buffer, row) < 0) {
+ if (Segment_put_row(&(cseg->seg), buffer, row) < 0) {
G_free(buffer);
Rast_close(map_fd);
G_warning(_("Unable to segment put row %d for raster map <%s>"),
@@ -141,10 +141,10 @@
map_fd = Rast_open_c_new(map_name);
nrows = Rast_window_rows();
buffer = Rast_allocate_c_buf();
- segment_flush(&(cseg->seg));
+ Segment_flush(&(cseg->seg));
for (row = 0; row < nrows; row++) {
G_percent(row, nrows, 1);
- segment_get_row(&(cseg->seg), buffer, row);
+ Segment_get_row(&(cseg->seg), buffer, row);
Rast_put_row(map_fd, buffer, CELL_TYPE);
}
G_percent(row, nrows, 1); /* finish it */
Modified: grass/branches/releasebranch_7_0/raster/r.stream.extract/dseg.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.extract/dseg.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.extract/dseg.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -21,7 +21,7 @@
}
if (0 >
(errflag =
- segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, scols,
+ Segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, scols,
sizeof(DCELL)))) {
close(fd);
unlink(filename);
@@ -40,7 +40,7 @@
G_warning(_("Unable to re-open segment file"));
return -4;
}
- if (0 > (errflag = segment_init(&(dseg->seg), fd, nsegs_in_memory))) {
+ if (0 > (errflag = Segment_init(&(dseg->seg), fd, nsegs_in_memory))) {
close(fd);
unlink(filename);
if (errflag == -1) {
@@ -59,7 +59,7 @@
int dseg_close(DSEG *dseg)
{
- segment_release(&(dseg->seg));
+ Segment_release(&(dseg->seg));
close(dseg->fd);
unlink(dseg->filename);
if (dseg->name) {
@@ -75,7 +75,7 @@
int dseg_put(DSEG *dseg, DCELL *value, int row, int col)
{
- if (segment_put(&(dseg->seg), (DCELL *) value, row, col) < 0) {
+ if (Segment_put(&(dseg->seg), (DCELL *) value, row, col) < 0) {
G_warning(_("Unable to write segment file"));
return -1;
}
@@ -84,7 +84,7 @@
int dseg_put_row(DSEG *dseg, DCELL *value, int row)
{
- if (segment_put_row(&(dseg->seg), (DCELL *) value, row) < 0) {
+ if (Segment_put_row(&(dseg->seg), (DCELL *) value, row) < 0) {
G_warning(_("Unable to write segment file"));
return -1;
}
@@ -93,7 +93,7 @@
int dseg_get(DSEG *dseg, DCELL *value, int row, int col)
{
- if (segment_get(&(dseg->seg), (DCELL *) value, row, col) < 0) {
+ if (Segment_get(&(dseg->seg), (DCELL *) value, row, col) < 0) {
G_warning(_("Unable to read segment file"));
return -1;
}
@@ -114,7 +114,7 @@
dbuffer = Rast_allocate_d_buf();
for (row = 0; row < nrows; row++) {
Rast_get_d_row(map_fd, dbuffer, row);
- if (segment_put_row(&(dseg->seg), (DCELL *) dbuffer, row) < 0) {
+ if (Segment_put_row(&(dseg->seg), (DCELL *) dbuffer, row) < 0) {
G_free(dbuffer);
Rast_close(map_fd);
G_warning(_("Inable to segment put row %d for raster <%s>"),
@@ -141,10 +141,10 @@
map_fd = Rast_open_new(map_name, DCELL_TYPE);
nrows = Rast_window_rows();
dbuffer = Rast_allocate_d_buf();
- segment_flush(&(dseg->seg));
+ Segment_flush(&(dseg->seg));
for (row = 0; row < nrows; row++) {
G_percent(row, nrows, 1);
- segment_get_row(&(dseg->seg), (DCELL *) dbuffer, row);
+ Segment_get_row(&(dseg->seg), (DCELL *) dbuffer, row);
Rast_put_row(map_fd, dbuffer, DCELL_TYPE);
}
G_percent(row, nrows, 1); /* finish it */
Modified: grass/branches/releasebranch_7_0/raster/r.stream.extract/seg.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.extract/seg.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.extract/seg.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -20,10 +20,10 @@
return -2;
}
if (fill)
- errflag = segment_format(fd, nrows, ncols, row_in_seg,
+ errflag = Segment_format(fd, nrows, ncols, row_in_seg,
col_in_seg, size_struct);
else
- errflag = segment_format_nofill(fd, nrows, ncols, row_in_seg,
+ errflag = Segment_format_nofill(fd, nrows, ncols, row_in_seg,
col_in_seg, size_struct);
if (0 > errflag) {
@@ -44,7 +44,7 @@
G_warning(_("Unable to re-open file '%s'"), filename);
return -4;
}
- if (0 > (errflag = segment_init(&(sseg->seg), fd, nsegs_in_memory))) {
+ if (0 > (errflag = Segment_init(&(sseg->seg), fd, nsegs_in_memory))) {
close(fd);
unlink(filename);
if (errflag == -1) {
@@ -63,7 +63,7 @@
int seg_close(SSEG *sseg)
{
- segment_release(&(sseg->seg));
+ Segment_release(&(sseg->seg));
close(sseg->fd);
unlink(sseg->filename);
return 0;
@@ -71,7 +71,7 @@
int seg_put(SSEG *sseg, char *value, int row, int col)
{
- if (segment_put(&(sseg->seg), value, row, col) < 0) {
+ if (Segment_put(&(sseg->seg), value, row, col) < 0) {
G_warning(_("Unable to write segment file"));
return -1;
}
@@ -80,7 +80,7 @@
int seg_put_row(SSEG *sseg, char *value, int row)
{
- if (segment_put_row(&(sseg->seg), value, row) < 0) {
+ if (Segment_put_row(&(sseg->seg), value, row) < 0) {
G_warning(_("seg_put_row(): could not write segment file"));
return -1;
}
@@ -89,7 +89,7 @@
int seg_get(SSEG *sseg, char *value, int row, int col)
{
- if (segment_get(&(sseg->seg), value, row, col) < 0) {
+ if (Segment_get(&(sseg->seg), value, row, col) < 0) {
G_warning(_("Unable to read segment file"));
return -1;
}
@@ -98,7 +98,7 @@
int seg_get_row(SSEG *sseg, char *value, int row)
{
- if (segment_get_row(&(sseg->seg), value, row) < 0) {
+ if (Segment_get_row(&(sseg->seg), value, row) < 0) {
G_warning(_("Unable to read segment file"));
return -1;
}
@@ -107,6 +107,6 @@
int seg_flush(SSEG *sseg)
{
- segment_flush(&(sseg->seg));
+ Segment_flush(&(sseg->seg));
return 0;
}
Modified: grass/branches/releasebranch_7_0/raster/r.stream.order/io.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.order/io.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.order/io.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -301,7 +301,7 @@
fd = creat(filename, 0666);
if (0 >
- segment_format(fd, seg->nrows, seg->ncols, srows, scols,
+ Segment_format(fd, seg->nrows, seg->ncols, srows, scols,
seg->data_size)) {
close(fd);
unlink(filename);
@@ -314,7 +314,7 @@
G_fatal_error(_("Unable to re-open file '%s'"), filename);
}
- if (0 > (fd = segment_init(&(seg->seg), fd, number_of_segs))) {
+ if (0 > (fd = Segment_init(&(seg->seg), fd, number_of_segs))) {
unlink(filename);
G_fatal_error(_("Unable to init segment file or out of memory"));
}
@@ -437,7 +437,7 @@
}
}
- if (0 > segment_put_row(&(seg->seg), target_buffer, r)) {
+ if (0 > Segment_put_row(&(seg->seg), target_buffer, r)) {
G_free(input_buffer);
G_free(target_buffer);
Rast_close(input_fd);
@@ -466,7 +466,7 @@
for (r = 0; r < seg->nrows; ++r)
for (c = 0; c < seg->ncols; ++c)
- segment_put(&(seg->seg), &value, r, c);
+ Segment_put(&(seg->seg), &value, r, c);
return 0;
}
@@ -498,13 +498,13 @@
G_message(_("Writing raster map <%s>..."), output_map_name);
output_fd = Rast_open_new(output_map_name, output_data_type);
output_buffer = Rast_allocate_buf(output_data_type);
- segment_flush(&(seg->seg));
+ Segment_flush(&(seg->seg));
/* writing */
for (r = 0; r < seg->nrows; ++r) {
G_percent(r, seg->nrows, 2);
- if (0 > segment_get_row(&(seg->seg), output_buffer, r))
+ if (0 > Segment_get_row(&(seg->seg), output_buffer, r))
G_warning(_("Unable to segment read row %d for raster map <%s>"),
r, output_map_name);
@@ -550,7 +550,7 @@
/*
* release segment close files, set pointers to null;
*/
- segment_release(&(seg->seg));
+ Segment_release(&(seg->seg));
close(seg->fd);
unlink(seg->filename);
Modified: grass/branches/releasebranch_7_0/raster/r.stream.order/stream_raster_close.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.order/stream_raster_close.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.order/stream_raster_close.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -88,10 +88,10 @@
data_size = Rast_cell_size(CELL_TYPE);
output_buffer = Rast_allocate_c_buf();
streams_buffer = Rast_allocate_c_buf();
- segment_flush(streams);
+ Segment_flush(streams);
for (r = 0; r < nrows; ++r) {
- if (0 > segment_get_row(streams, streams_buffer, r))
+ if (0 > Segment_get_row(streams, streams_buffer, r))
G_warning(_("Unable to segment read row %d for raster map <%s>"),
r, output_map_names[i]);
Modified: grass/branches/releasebranch_7_0/raster/r.stream.order/stream_topology.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.order/stream_topology.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.order/stream_topology.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -214,8 +214,8 @@
j = DIAG(i);
- segment_get(streams, &streams_cell, NR(i), NC(i));
- segment_get(dirs, &dirs_cell, NR(i), NC(i));
+ Segment_get(streams, &streams_cell, NR(i), NC(i));
+ Segment_get(dirs, &dirs_cell, NR(i), NC(i));
if (streams_cell && dirs_cell == j)
trib++;
@@ -258,8 +258,8 @@
for (r = 0; r < nrows; ++r) {
G_percent(r, nrows, 2);
for (c = 0; c < ncols; ++c) {
- segment_get(streams, &streams_cell, r, c);
- segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
if (streams_cell) {
trib_num = seg_number_of_tribs(r, c, streams, dirs);
@@ -269,12 +269,12 @@
if (NOT_IN_REGION(d))
next_stream = -1;
else
- segment_get(streams, &next_streams_cell, NR(d), NC(d));
+ Segment_get(streams, &next_streams_cell, NR(d), NC(d));
if (d < 1 || NOT_IN_REGION(d) || !next_streams_cell)
next_stream = -1;
else
- segment_get(streams, &next_stream, NR(d), NC(d));
+ Segment_get(streams, &next_stream, NR(d), NC(d));
cur_stream = streams_cell;
@@ -313,9 +313,9 @@
j = DIAG(i);
next_r = NR(i);
next_c = NC(i);
- segment_get(streams, &trib_stream_cell, next_r,
+ Segment_get(streams, &trib_stream_cell, next_r,
next_c);
- segment_get(dirs, &trib_dirs_cell, next_r, next_c);
+ Segment_get(dirs, &trib_dirs_cell, next_r, next_c);
if (trib_stream_cell && trib_dirs_cell == j)
SA[cur_stream].trib[trib++] = trib_stream_cell;
@@ -354,7 +354,7 @@
G_percent(s, init_num, 2);
r = (int)init_cells[s] / ncols;
c = (int)init_cells[s] % ncols;
- segment_get(streams, &cur_stream, r, c);
+ Segment_get(streams, &cur_stream, r, c);
cur_length = 0;
done = 1;
@@ -367,14 +367,14 @@
cur_northing = window.north - (r + .5) * window.ns_res;
cur_easting = window.west + (c + .5) * window.ew_res;
- segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
d = abs(dirs_cell);
next_r = NR(d);
next_c = NC(d);
if (NOT_IN_REGION(d))
Rast_set_c_null_value(&next_stream, 1);
else
- segment_get(streams, &next_stream, next_r, next_c);
+ Segment_get(streams, &next_stream, next_r, next_c);
if (d < 1 || NOT_IN_REGION(d) || !next_stream) {
cur_length = (window.ns_res + window.ew_res) / 2;
Modified: grass/branches/releasebranch_7_0/raster/r.stream.order/stream_vector.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.order/stream_vector.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.order/stream_vector.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -124,10 +124,10 @@
Vect_reset_line(Segments);
Vect_append_point(Segments, easting, northing, 0);
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
while (streams_cell == cur_stream) {
- segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
d = abs(dirs_cell);
next_r = NR(d);
next_c = NC(d);
@@ -139,7 +139,7 @@
if (NOT_IN_REGION(d))
Rast_set_c_null_value(&next_stream, 1);
else
- segment_get(streams, &next_stream, next_r, next_c);
+ Segment_get(streams, &next_stream, next_r, next_c);
if (d < 1 || NOT_IN_REGION(d) || !next_stream) {
add_outlet = 1;
@@ -147,7 +147,7 @@
}
r = next_r;
c = next_c;
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
} /* end while */
Vect_cat_set(Cats, 1, cur_stream);
Modified: grass/branches/releasebranch_7_0/raster/r.stream.segment/io.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.segment/io.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.segment/io.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -301,7 +301,7 @@
fd = creat(filename, 0666);
if (0 >
- segment_format(fd, seg->nrows, seg->ncols, srows, scols,
+ Segment_format(fd, seg->nrows, seg->ncols, srows, scols,
seg->data_size)) {
close(fd);
unlink(filename);
@@ -314,7 +314,7 @@
G_fatal_error(_("Unable to re-open file '%s'"), filename);
}
- if (0 > (fd = segment_init(&(seg->seg), fd, number_of_segs))) {
+ if (0 > (fd = Segment_init(&(seg->seg), fd, number_of_segs))) {
unlink(filename);
G_fatal_error(_("Unable to init segment file or out of memory"));
}
@@ -437,7 +437,7 @@
}
}
- if (0 > segment_put_row(&(seg->seg), target_buffer, r)) {
+ if (0 > Segment_put_row(&(seg->seg), target_buffer, r)) {
G_free(input_buffer);
G_free(target_buffer);
Rast_close(input_fd);
@@ -466,7 +466,7 @@
for (r = 0; r < seg->nrows; ++r)
for (c = 0; c < seg->ncols; ++c)
- segment_put(&(seg->seg), &value, r, c);
+ Segment_put(&(seg->seg), &value, r, c);
return 0;
}
@@ -498,13 +498,13 @@
G_message(_("Writing raster map <%s>..."), output_map_name);
output_fd = Rast_open_new(output_map_name, output_data_type);
output_buffer = Rast_allocate_buf(output_data_type);
- segment_flush(&(seg->seg));
+ Segment_flush(&(seg->seg));
/* writing */
for (r = 0; r < seg->nrows; ++r) {
G_percent(r, seg->nrows, 2);
- if (0 > segment_get_row(&(seg->seg), output_buffer, r))
+ if (0 > Segment_get_row(&(seg->seg), output_buffer, r))
G_warning(_("Unable to segment read row %d for raster map <%s>"),
r, output_map_name);
@@ -550,7 +550,7 @@
/*
* release segment close files, set pointers to null;
*/
- segment_release(&(seg->seg));
+ Segment_release(&(seg->seg));
close(seg->fd);
unlink(seg->filename);
Modified: grass/branches/releasebranch_7_0/raster/r.stream.segment/stream_topology.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.segment/stream_topology.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.segment/stream_topology.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -65,7 +65,7 @@
int next_r, next_c;
int streams_cell, streams_next_cell, dirs_next_cell;
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
for (i = 1; i < 9; ++i) {
if (NOT_IN_REGION(i))
continue;
@@ -74,8 +74,8 @@
next_r = NR(i);
next_c = NC(i);
- segment_get(streams, &streams_next_cell, next_r, next_c);
- segment_get(dirs, &dirs_next_cell, next_r, next_c);
+ Segment_get(streams, &streams_next_cell, next_r, next_c);
+ Segment_get(dirs, &dirs_next_cell, next_r, next_c);
if (streams_next_cell > 0 && dirs_next_cell == j)
trib_num++;
@@ -90,8 +90,8 @@
next_r = NR(i);
next_c = NC(i);
- segment_get(streams, &streams_next_cell, next_r, next_c);
- segment_get(dirs, &dirs_next_cell, next_r, next_c);
+ Segment_get(streams, &streams_next_cell, next_r, next_c);
+ Segment_get(dirs, &dirs_next_cell, next_r, next_c);
if (streams_next_cell == streams_cell && dirs_next_cell == j)
trib_num--;
@@ -137,7 +137,7 @@
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c) {
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
if (streams_cell > 0)
if (seg_trib_nums(r, c, streams, dirs) != 1) {
stream_num++;
@@ -286,7 +286,7 @@
/* finding inits */
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c) {
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
if (streams_cell)
if (seg_trib_nums(r, c, streams, dirs) != 1) { /* adding inits */
@@ -304,20 +304,20 @@
r = (int)SA[i].init / ncols;
c = (int)SA[i].init % ncols;
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
SA[i].order = streams_cell;
SA[i].number_of_cells = 0;
do {
SA[i].number_of_cells++;
- segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
d = abs(dirs_cell);
if (NOT_IN_REGION(d) || d == 0)
break;
r = NR(d);
c = NC(d);
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
} while (streams_cell == SA[i].order);
SA[i].number_of_cells += 2; /* add two extra points for point before init and after outlet */
@@ -341,10 +341,10 @@
/* add one point contributing to init to calculate parameters */
/* what to do if there is no contributing points? */
- segment_get(dirs, &dirs_cell, r, c);
- segment_get(dirs, &dirs_prev_cell, prev_r, prev_c);
- segment_get(elevation, &elevation_prev_cell, prev_r, prev_c);
- segment_get(elevation, &elevation_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(dirs, &dirs_prev_cell, prev_r, prev_c);
+ Segment_get(elevation, &elevation_prev_cell, prev_r, prev_c);
+ Segment_get(elevation, &elevation_cell, r, c);
SA[i].points[0] = (contrib_cell == 0) ? -1 : INDEX(prev_r, prev_c);
SA[i].elevation[0] = (contrib_cell == 0) ? -99999 :
@@ -360,7 +360,7 @@
cell_num = 2;
do {
- segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
d = abs(dirs_cell);
if (NOT_IN_REGION(d) || d == 0) {
@@ -375,16 +375,16 @@
}
r = NR(d);
c = NC(d);
- segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
SA[i].last_cell_dir = dirs_cell;
SA[i].points[cell_num] = INDEX(r, c);
- segment_get(elevation, &SA[i].elevation[cell_num], r, c);
+ Segment_get(elevation, &SA[i].elevation[cell_num], r, c);
next_d = (abs(dirs_cell) == 0) ? d : abs(dirs_cell);
SA[i].distance[cell_num] = get_distance(r, c, next_d);
cell_num++;
if (cell_num > SA[i].number_of_cells)
G_fatal_error(_("To much points in stream line"));
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
} while (streams_cell == SA[i].order);
if (SA[i].elevation[0] == -99999)
@@ -429,8 +429,8 @@
continue;
next_r = NR(i);
next_c = NC(i);
- segment_get(elevation, &elevation_next_cell, next_r, next_c);
- segment_get(dirs, &dirs_next_cell, next_r, next_c);
+ Segment_get(elevation, &elevation_next_cell, next_r, next_c);
+ Segment_get(dirs, &dirs_next_cell, next_r, next_c);
if (dirs_next_cell == DIAG(i) && elevation_next_cell < elev_min) {
elev_min = elevation_next_cell;
@@ -470,7 +470,7 @@
for (j = 1; j < SA[i].number_of_cells - 1; ++j) {
r = (int)SA[i].points[j] / ncols;
c = (int)SA[i].points[j] % ncols;
- segment_put(unique_streams, &SA[i].stream, r, c);
+ Segment_put(unique_streams, &SA[i].stream, r, c);
}
}
return 0;
@@ -515,7 +515,7 @@
else {
r = (int)SA[i].points[SA[i].number_of_cells - 1] / ncols;
c = (int)SA[i].points[SA[i].number_of_cells - 1] % ncols;
- segment_get(streams, &SA[i].next_stream, r, c);
+ Segment_get(streams, &SA[i].next_stream, r, c);
SA[i].outlet = SA[i].points[SA[i].number_of_cells - 1];
}
}
Modified: grass/branches/releasebranch_7_0/raster/r.stream.snap/io.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.snap/io.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.snap/io.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -301,7 +301,7 @@
fd = creat(filename, 0666);
if (0 >
- segment_format(fd, seg->nrows, seg->ncols, srows, scols,
+ Segment_format(fd, seg->nrows, seg->ncols, srows, scols,
seg->data_size)) {
close(fd);
unlink(filename);
@@ -314,7 +314,7 @@
G_fatal_error(_("Unable to re-open file '%s'"), filename);
}
- if (0 > (fd = segment_init(&(seg->seg), fd, number_of_segs))) {
+ if (0 > (fd = Segment_init(&(seg->seg), fd, number_of_segs))) {
unlink(filename);
G_fatal_error(_("Unable to init segment file or out of memory"));
}
@@ -437,7 +437,7 @@
}
}
- if (0 > segment_put_row(&(seg->seg), target_buffer, r)) {
+ if (0 > Segment_put_row(&(seg->seg), target_buffer, r)) {
G_free(input_buffer);
G_free(target_buffer);
Rast_close(input_fd);
@@ -466,7 +466,7 @@
for (r = 0; r < seg->nrows; ++r)
for (c = 0; c < seg->ncols; ++c)
- segment_put(&(seg->seg), &value, r, c);
+ Segment_put(&(seg->seg), &value, r, c);
return 0;
}
@@ -498,13 +498,13 @@
G_message(_("Writing raster map <%s>..."), output_map_name);
output_fd = Rast_open_new(output_map_name, output_data_type);
output_buffer = Rast_allocate_buf(output_data_type);
- segment_flush(&(seg->seg));
+ Segment_flush(&(seg->seg));
/* writing */
for (r = 0; r < seg->nrows; ++r) {
G_percent(r, seg->nrows, 2);
- if (0 > segment_get_row(&(seg->seg), output_buffer, r))
+ if (0 > Segment_get_row(&(seg->seg), output_buffer, r))
G_warning(_("Unable to segment read row %d for raster map <%s>"),
r, output_map_name);
@@ -550,7 +550,7 @@
/*
* release segment close files, set pointers to null;
*/
- segment_release(&(seg->seg));
+ Segment_release(&(seg->seg));
close(seg->fd);
unlink(seg->filename);
Modified: grass/branches/releasebranch_7_0/raster/r.stream.snap/points_io.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.snap/points_io.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.snap/points_io.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -49,11 +49,11 @@
points[i].dj = 0;
points[i].cat = cat;
if (streams)
- segment_get(streams, &points[i].stream, points[i].r, points[i].c);
+ Segment_get(streams, &points[i].stream, points[i].r, points[i].c);
else
points[i].stream = 0;
if (accum) {
- segment_get(accum, &absaccum, points[i].r, points[i].c);
+ Segment_get(accum, &absaccum, points[i].r, points[i].c);
points[i].accum = fabs(absaccum);
}
else {
Modified: grass/branches/releasebranch_7_0/raster/r.stream.snap/snap.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.snap/snap.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.snap/snap.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -54,13 +54,13 @@
if (!distance_mask[i + radius][j + radius])
continue;
- segment_get(streams, &teststream, point->r + i, point->c + j);
+ Segment_get(streams, &teststream, point->r + i, point->c + j);
distance = distance_mask[i + radius][j + radius];
if (teststream) { /* is stream line */
if (accum) {
- segment_get(accum, &absaccum, point->r + i,
+ Segment_get(accum, &absaccum, point->r + i,
point->c + j);
absaccum = fabs(absaccum);
}
@@ -91,7 +91,7 @@
if (!distance_mask[i + radius][j + radius])
continue;
- segment_get(accum, &absaccum, point->r + i, point->c + j);
+ Segment_get(accum, &absaccum, point->r + i, point->c + j);
absaccum = fabs(absaccum);
if (absaccum > maxaccum)
@@ -118,7 +118,7 @@
if (!distance_mask[i + radius][j + radius])
continue;
- segment_get(accum, &absaccum, point->r + i, point->c + j);
+ Segment_get(accum, &absaccum, point->r + i, point->c + j);
absaccum = fabs(absaccum);
if (accum_treshold > 0 && absaccum > accum_treshold)
Modified: grass/branches/releasebranch_7_0/raster/r.stream.stats/io.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.stats/io.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.stats/io.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -301,7 +301,7 @@
fd = creat(filename, 0666);
if (0 >
- segment_format(fd, seg->nrows, seg->ncols, srows, scols,
+ Segment_format(fd, seg->nrows, seg->ncols, srows, scols,
seg->data_size)) {
close(fd);
unlink(filename);
@@ -314,7 +314,7 @@
G_fatal_error(_("Unable to re-open file '%s'"), filename);
}
- if (0 > (fd = segment_init(&(seg->seg), fd, number_of_segs))) {
+ if (0 > (fd = Segment_init(&(seg->seg), fd, number_of_segs))) {
unlink(filename);
G_fatal_error(_("Unable to init segment file or out of memory"));
}
@@ -437,7 +437,7 @@
}
}
- if (0 > segment_put_row(&(seg->seg), target_buffer, r)) {
+ if (0 > Segment_put_row(&(seg->seg), target_buffer, r)) {
G_free(input_buffer);
G_free(target_buffer);
Rast_close(input_fd);
@@ -466,7 +466,7 @@
for (r = 0; r < seg->nrows; ++r)
for (c = 0; c < seg->ncols; ++c)
- segment_put(&(seg->seg), &value, r, c);
+ Segment_put(&(seg->seg), &value, r, c);
return 0;
}
@@ -498,13 +498,13 @@
G_message(_("Writing raster map <%s>..."), output_map_name);
output_fd = Rast_open_new(output_map_name, output_data_type);
output_buffer = Rast_allocate_buf(output_data_type);
- segment_flush(&(seg->seg));
+ Segment_flush(&(seg->seg));
/* writing */
for (r = 0; r < seg->nrows; ++r) {
G_percent(r, seg->nrows, 2);
- if (0 > segment_get_row(&(seg->seg), output_buffer, r))
+ if (0 > Segment_get_row(&(seg->seg), output_buffer, r))
G_warning(_("Unable to segment read row %d for raster map <%s>"),
r, output_map_name);
@@ -550,7 +550,7 @@
/*
* release segment close files, set pointers to null;
*/
- segment_release(&(seg->seg));
+ Segment_release(&(seg->seg));
close(seg->fd);
unlink(seg->filename);
Modified: grass/branches/releasebranch_7_0/raster/r.stream.stats/stats_prepare.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.stream.stats/stats_prepare.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.stream.stats/stats_prepare.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -110,7 +110,7 @@
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c) {
- segment_get(streams, &streams_cell, r, c);
+ Segment_get(streams, &streams_cell, r, c);
if (streams_cell > 0) {
if (outlets_num > (out_max - 1)) {
out_max *= 2;
@@ -118,12 +118,12 @@
(POINT *) G_realloc(outlets, out_max * sizeof(POINT));
}
- segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
d = abs(dirs_cell);
if (NOT_IN_REGION(d))
next_stream = -1; /* border */
else {
- segment_get(streams, &next_stream, NR(d), NC(d));
+ Segment_get(streams, &next_stream, NR(d), NC(d));
if (next_stream < 1)
next_stream = -1;
}
@@ -160,9 +160,9 @@
stat_streams[i].length = 0.;
stat_streams[i].elev_diff = 0.;
stat_streams[i].elev_spring = 0.;
- segment_get(elevation, &(stat_streams[i].elev_outlet), outlets[i].r,
+ Segment_get(elevation, &(stat_streams[i].elev_outlet), outlets[i].r,
outlets[i].c);
- segment_get(streams, &(stat_streams[i].order), outlets[i].r,
+ Segment_get(streams, &(stat_streams[i].order), outlets[i].r,
outlets[i].c);
stat_streams[i].basin_area = 0.;
stat_streams[i].cell_num = 0;
@@ -279,7 +279,7 @@
cur_northing = window.north - (r + .5) * window.ns_res;
cur_easting = window.west + (c + .5) * window.ew_res;
- segment_get(dirs, &dirs_cell, r, c);
+ Segment_get(dirs, &dirs_cell, r, c);
d = (dirs_cell == 0) ? 2 : abs(dirs_cell);
next_northing = window.north - (NR(d) + .5) * window.ns_res;
@@ -297,7 +297,7 @@
cur_easting = window.west + (c + .5) * window.ew_res;
stat_streams[s].cell_num++;
- segment_get(elevation, &(stat_streams[s].elev_spring), r, c);
+ Segment_get(elevation, &(stat_streams[s].elev_spring), r, c);
for (i = 1; i < 9; ++i) {
if (NOT_IN_REGION(i))
@@ -307,8 +307,8 @@
next_r = NR(i);
next_c = NC(i);
- segment_get(streams, &streams_cell, next_r, next_c);
- segment_get(dirs, &dirs_cell, next_r, next_c);
+ Segment_get(streams, &streams_cell, next_r, next_c);
+ Segment_get(dirs, &dirs_cell, next_r, next_c);
if (streams_cell == stat_streams[s].order && dirs_cell == j) {
@@ -320,9 +320,9 @@
G_distance(next_easting, next_northing, cur_easting,
cur_northing);
- segment_get(elevation, &elevation_next_cell, next_r,
+ Segment_get(elevation, &elevation_next_cell, next_r,
next_c);
- segment_get(elevation, &elevation_cell, r, c);
+ Segment_get(elevation, &elevation_cell, r, c);
diff_elev = elevation_next_cell - elevation_cell;
diff_elev = (diff_elev < 0) ? 0. : diff_elev; /* water cannot flow up */
@@ -424,7 +424,7 @@
next_r = NR(i);
next_c = NC(i);
- segment_get(dirs, &dirs_cell, next_r, next_c);
+ Segment_get(dirs, &dirs_cell, next_r, next_c);
if (dirs_cell == j) { /* countributing cell */
area += G_area_of_cell_at_row(r);
Modified: grass/branches/releasebranch_7_0/raster/r.walk/main.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.walk/main.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.walk/main.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -539,12 +539,12 @@
/* Create segmented format files for cost layer and output layer */
G_verbose_message(_("Creating some temporary files..."));
- if (segment_open(&cost_seg, G_tempfile(), nrows, ncols, srows, scols,
+ if (Segment_open(&cost_seg, G_tempfile(), nrows, ncols, srows, scols,
sizeof(struct cc), segments_in_memory) != 1)
G_fatal_error(_("Can not create temporary file"));
if (dir == 1) {
- if (segment_open(&dir_seg, G_tempfile(), nrows, ncols, srows, scols,
+ if (Segment_open(&dir_seg, G_tempfile(), nrows, ncols, srows, scols,
sizeof(FCELL), segments_in_memory) != 1)
G_fatal_error(_("Can not create temporary file"));
}
@@ -624,7 +624,7 @@
}
costs.dtm = p_dtm;
- segment_put(&cost_seg, &costs, row, col);
+ Segment_put(&cost_seg, &costs, row, col);
ptr1 = G_incr_void_ptr(ptr1, cost_dsize);
ptr2 = G_incr_void_ptr(ptr2, dtm_dsize);
}
@@ -639,7 +639,7 @@
for (row = 0; row < nrows; row++) {
G_percent(row, nrows, 2);
for (col = 0; col < ncols; col++) {
- segment_put(&dir_seg, &dnullval, row, col);
+ Segment_put(&dir_seg, &dnullval, row, col);
}
}
G_percent(1, 1, 1);
@@ -812,19 +812,19 @@
if (!Rast_is_null_value(ptr2, data_type2)) {
double cellval;
- segment_get(&cost_seg, &costs, row, col);
+ Segment_get(&cost_seg, &costs, row, col);
if (start_with_raster_vals == 1) {
cellval = Rast_get_d_value(ptr2, data_type2);
insert(cellval, row, col);
costs.cost_out = cellval;
- segment_put(&cost_seg, &costs, row, col);
+ Segment_put(&cost_seg, &costs, row, col);
}
else {
value = &zero;
insert(zero, row, col);
costs.cost_out = *value;
- segment_put(&cost_seg, &costs, row, col);
+ Segment_put(&cost_seg, &costs, row, col);
}
got_one = 1;
}
@@ -853,10 +853,10 @@
|| top_start_pt->col < 0 || top_start_pt->col >= ncols)
G_fatal_error(_("Specified starting location outside database window"));
insert(zero, top_start_pt->row, top_start_pt->col);
- segment_get(&cost_seg, &costs, top_start_pt->row,
+ Segment_get(&cost_seg, &costs, top_start_pt->row,
top_start_pt->col);
costs.cost_out = *value;
- segment_put(&cost_seg, &costs, top_start_pt->row,
+ Segment_put(&cost_seg, &costs, top_start_pt->row,
top_start_pt->col);
top_start_pt = top_start_pt->next;
}
@@ -896,7 +896,7 @@
break;
/* If I've already been updated, delete me */
- segment_get(&cost_seg, &costs, pres_cell->row, pres_cell->col);
+ Segment_get(&cost_seg, &costs, pres_cell->row, pres_cell->col);
old_min_cost = costs.cost_out;
if (!Rast_is_d_null_value(&old_min_cost)) {
if (pres_cell->min_cost > old_min_cost) {
@@ -1030,7 +1030,7 @@
continue;
min_cost = dnullval;
- segment_get(&cost_seg, &costs, row, col);
+ Segment_get(&cost_seg, &costs, row, col);
switch (neighbor) {
case 1:
@@ -1318,25 +1318,25 @@
if (Rast_is_d_null_value(&min_cost))
continue;
- segment_get(&cost_seg, &costs, row, col);
+ Segment_get(&cost_seg, &costs, row, col);
old_min_cost = costs.cost_out;
/* add to list */
if (Rast_is_d_null_value(&old_min_cost)) {
costs.cost_out = min_cost;
- segment_put(&cost_seg, &costs, row, col);
+ Segment_put(&cost_seg, &costs, row, col);
insert(min_cost, row, col);
if (dir == 1) {
- segment_put(&dir_seg, &cur_dir, row, col);
+ Segment_put(&dir_seg, &cur_dir, row, col);
}
}
/* update with lower costs */
else if (old_min_cost > min_cost) {
costs.cost_out = min_cost;
- segment_put(&cost_seg, &costs, row, col);
+ Segment_put(&cost_seg, &costs, row, col);
insert(min_cost, row, col);
if (dir == 1) {
- segment_put(&dir_seg, &cur_dir, row, col);
+ Segment_put(&dir_seg, &cur_dir, row, col);
}
}
}
@@ -1386,7 +1386,7 @@
continue;
}
}
- segment_get(&cost_seg, &costs, row, col);
+ Segment_get(&cost_seg, &costs, row, col);
min_cost = costs.cost_out;
if (Rast_is_d_null_value(&min_cost)) {
Rast_set_null_value((p), 1, cum_data_type);
@@ -1428,7 +1428,7 @@
for (row = 0; row < nrows; row++) {
p = dir_cell;
for (col = 0; col < ncols; col++) {
- segment_get(&dir_seg, &cur_dir, row, col);
+ Segment_get(&dir_seg, &cur_dir, row, col);
*((FCELL *) p) = cur_dir;
p = G_incr_void_ptr(p, dir_size);
}
@@ -1439,9 +1439,9 @@
G_free(dir_cell);
}
- segment_close(&cost_seg); /* release memory */
+ Segment_close(&cost_seg); /* release memory */
if (dir == 1)
- segment_close(&dir_seg);
+ Segment_close(&dir_seg);
Rast_close(dtm_fd);
Rast_close(cost_fd);
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_close.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_close.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_close.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -4,7 +4,7 @@
int bseg_close(BSEG * bseg)
{
- segment_release(&(bseg->seg));
+ Segment_release(&(bseg->seg));
close(bseg->fd);
unlink(bseg->filename);
if (bseg->name) {
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_get.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_get.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_get.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -4,7 +4,7 @@
int bseg_get(BSEG * bseg, char *value, GW_LARGE_INT row, GW_LARGE_INT col)
{
- if (segment_get(&(bseg->seg), value, row, col) < 0) {
+ if (Segment_get(&(bseg->seg), value, row, col) < 0) {
G_warning("cseg_get(): could not read segment file");
return -1;
}
@@ -15,7 +15,7 @@
{
CELL x;
- if (segment_get(&(bseg->seg), &x, row, col >> 3) < 0) {
+ if (Segment_get(&(bseg->seg), &x, row, col >> 3) < 0) {
G_warning("bseg_get(): could not read segment file");
return -1;
}
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_open.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_open.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_open.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -21,7 +21,7 @@
G_warning("bseg_open(): unable to create segment file");
return -2;
}
- if (0 > (errflag = segment_format(fd, Rast_window_rows(),
+ if (0 > (errflag = Segment_format(fd, Rast_window_rows(),
Rast_window_cols(), srows, scols,
sizeof(char)))) {
close(fd);
@@ -41,7 +41,7 @@
G_warning("bseg_open(): unable to re-open segment file");
return -4;
}
- if (0 > (errflag = segment_init(&(bseg->seg), fd, nsegs_in_memory))) {
+ if (0 > (errflag = Segment_init(&(bseg->seg), fd, nsegs_in_memory))) {
close(fd);
unlink(filename);
if (errflag == -1) {
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_put.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_put.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/bseg_put.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -4,7 +4,7 @@
int bseg_put(BSEG * bseg, char *value, GW_LARGE_INT row, GW_LARGE_INT col)
{
- if (segment_put(&(bseg->seg), value, row, col) < 0) {
+ if (Segment_put(&(bseg->seg), value, row, col) < 0) {
G_warning("cseg_put(): could not write segment file");
return -1;
}
@@ -13,7 +13,7 @@
int bseg_put_row(BSEG * bseg, char *value, GW_LARGE_INT row)
{
- if (segment_put_row(&(bseg->seg), value, row) < 0) {
+ if (Segment_put_row(&(bseg->seg), value, row) < 0) {
G_warning("cseg_put(): could not write segment file");
return -1;
}
@@ -24,7 +24,7 @@
{
CELL old_value;
- if (segment_get(&(bseg->seg), &old_value, row, col >> 3) < 0) {
+ if (Segment_get(&(bseg->seg), &old_value, row, col >> 3) < 0) {
G_warning("bseg_put(): could not read segment file");
return -1;
}
@@ -32,7 +32,7 @@
old_value |= (1 << (col & 7));
else
old_value &= ~(1 << (col & 7));
- if (segment_put(&(bseg->seg), &old_value, row, col >> 3) < 0) {
+ if (Segment_put(&(bseg->seg), &old_value, row, col >> 3) < 0) {
G_warning("bseg_put(): could not write segment file");
return -2;
}
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_close.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_close.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_close.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -5,7 +5,7 @@
int cseg_close(CSEG * cseg)
{
- segment_release(&(cseg->seg));
+ Segment_release(&(cseg->seg));
close(cseg->fd);
unlink(cseg->filename);
if (cseg->name) {
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_get.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_get.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_get.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -4,7 +4,7 @@
int cseg_get(CSEG * cseg, CELL * value, GW_LARGE_INT row, GW_LARGE_INT col)
{
- if (segment_get(&(cseg->seg), value, row, col) < 0) {
+ if (Segment_get(&(cseg->seg), value, row, col) < 0) {
G_warning("cseg_get(): could not read segment file");
return -1;
}
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_open.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_open.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_open.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -22,7 +22,7 @@
}
if (0 >
(errflag =
- segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, scols,
+ Segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, scols,
sizeof(CELL)))) {
close(fd);
unlink(filename);
@@ -41,7 +41,7 @@
G_warning("cseg_open(): unable to re-open segment file");
return -4;
}
- if (0 > (errflag = segment_init(&(cseg->seg), fd, nsegs_in_memory))) {
+ if (0 > (errflag = Segment_init(&(cseg->seg), fd, nsegs_in_memory))) {
close(fd);
unlink(filename);
if (errflag == -1) {
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_put.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_put.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_put.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -4,7 +4,7 @@
int cseg_put(CSEG * cseg, CELL * value, GW_LARGE_INT row, GW_LARGE_INT col)
{
- if (segment_put(&(cseg->seg), value, row, col) < 0) {
+ if (Segment_put(&(cseg->seg), value, row, col) < 0) {
G_warning("cseg_put(): could not write segment file");
return -1;
}
@@ -13,7 +13,7 @@
int cseg_put_row(CSEG * cseg, CELL * value, GW_LARGE_INT row)
{
- if (segment_put_row(&(cseg->seg), value, row) < 0) {
+ if (Segment_put_row(&(cseg->seg), value, row) < 0) {
G_warning("cseg_put(): could not write segment file");
return -1;
}
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_read.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_read.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_read.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -19,7 +19,7 @@
buffer = Rast_allocate_c_buf();
for (row = 0; row < nrows; row++) {
Rast_get_c_row(map_fd, buffer, row);
- if (segment_put_row(&(cseg->seg), buffer, row) < 0) {
+ if (Segment_put_row(&(cseg->seg), buffer, row) < 0) {
G_free(buffer);
Rast_close(map_fd);
G_warning("%s(): unable to segment put row for [%s] in [%s]",
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_write.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_write.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/cseg_write.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -12,10 +12,10 @@
map_fd = Rast_open_c_new(map_name);
nrows = Rast_window_rows();
buffer = Rast_allocate_c_buf();
- segment_flush(&(cseg->seg));
+ Segment_flush(&(cseg->seg));
for (row = 0; row < nrows; row++) {
G_percent(row, nrows, 1);
- segment_get_row(&(cseg->seg), buffer, row);
+ Segment_get_row(&(cseg->seg), buffer, row);
Rast_put_row(map_fd, buffer, CELL_TYPE);
}
G_percent(row, nrows, 1); /* finish it */
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_close.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_close.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_close.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -4,7 +4,7 @@
int dseg_close(DSEG * dseg)
{
- segment_release(&(dseg->seg));
+ Segment_release(&(dseg->seg));
close(dseg->fd);
unlink(dseg->filename);
if (dseg->name) {
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_get.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_get.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_get.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -4,7 +4,7 @@
int dseg_get(DSEG * dseg, double *value, GW_LARGE_INT row, GW_LARGE_INT col)
{
- if (segment_get(&(dseg->seg), (DCELL *) value, row, col) < 0) {
+ if (Segment_get(&(dseg->seg), (DCELL *) value, row, col) < 0) {
G_warning("dseg_get(): could not read segment file");
return -1;
}
@@ -13,6 +13,6 @@
int dseg_flush(DSEG * dseg)
{
- segment_flush(&(dseg->seg));
+ Segment_flush(&(dseg->seg));
return 0;
}
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_open.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_open.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_open.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -23,7 +23,7 @@
}
if (0 >
(errflag =
- segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, scols,
+ Segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, scols,
sizeof(double)))) {
close(fd);
unlink(filename);
@@ -42,7 +42,7 @@
G_warning("dseg_open(): unable to re-open segment file");
return -4;
}
- if (0 > (errflag = segment_init(&(dseg->seg), fd, nsegs_in_memory))) {
+ if (0 > (errflag = Segment_init(&(dseg->seg), fd, nsegs_in_memory))) {
close(fd);
unlink(filename);
if (errflag == -1) {
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_put.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_put.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_put.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -4,7 +4,7 @@
int dseg_put(DSEG * dseg, double *value, GW_LARGE_INT row, GW_LARGE_INT col)
{
- if (segment_put(&(dseg->seg), (DCELL *) value, row, col) < 0) {
+ if (Segment_put(&(dseg->seg), (DCELL *) value, row, col) < 0) {
G_warning("dseg_put(): could not write segment file");
return -1;
}
@@ -13,7 +13,7 @@
int dseg_put_row(DSEG * dseg, double *value, GW_LARGE_INT row)
{
- if (segment_put_row(&(dseg->seg), (DCELL *) value, row) < 0) {
+ if (Segment_put_row(&(dseg->seg), (DCELL *) value, row) < 0) {
G_warning("dseg_put(): could not write segment file");
return -1;
}
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_read.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_read.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_read.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -20,7 +20,7 @@
dbuffer = Rast_allocate_d_buf();
for (row = 0; row < nrows; row++) {
Rast_get_d_row(map_fd, dbuffer, row);
- if (segment_put_row(&(dseg->seg), (DCELL *) dbuffer, row) < 0) {
+ if (Segment_put_row(&(dseg->seg), (DCELL *) dbuffer, row) < 0) {
G_free(dbuffer);
Rast_close(map_fd);
G_warning("%s(): unable to segment put row for [%s] in [%s]",
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_write.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_write.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/dseg_write.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -13,10 +13,10 @@
nrows = Rast_window_rows();
ncols = Rast_window_cols();
dbuffer = Rast_allocate_d_buf();
- segment_flush(&(dseg->seg));
+ Segment_flush(&(dseg->seg));
for (row = 0; row < nrows; row++) {
G_percent(row, nrows, 1);
- segment_get_row(&(dseg->seg), (DCELL *) dbuffer, row);
+ Segment_get_row(&(dseg->seg), (DCELL *) dbuffer, row);
Rast_put_row(map_fd, dbuffer, DCELL_TYPE);
}
G_percent(row, nrows, 1); /* finish it */
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_close.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_close.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_close.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -5,7 +5,7 @@
int seg_close(SSEG * sseg)
{
- segment_release(&(sseg->seg));
+ Segment_release(&(sseg->seg));
close(sseg->fd);
unlink(sseg->filename);
return 0;
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_get.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_get.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_get.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -4,7 +4,7 @@
int seg_get(SSEG * sseg, char *value, GW_LARGE_INT row, GW_LARGE_INT col)
{
- if (segment_get(&(sseg->seg), value, row, col) < 0) {
+ if (Segment_get(&(sseg->seg), value, row, col) < 0) {
G_warning("seg_get(): could not read segment file");
return -1;
}
@@ -13,7 +13,7 @@
int seg_get_row(SSEG * sseg, char *value, GW_LARGE_INT row)
{
- if (segment_get_row(&(sseg->seg), value, row) < 0) {
+ if (Segment_get_row(&(sseg->seg), value, row) < 0) {
G_warning("seg_get(): could not read segment file");
return -1;
}
@@ -22,6 +22,6 @@
int seg_flush(SSEG * sseg)
{
- segment_flush(&(sseg->seg));
+ Segment_flush(&(sseg->seg));
return 0;
}
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_open.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_open.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_open.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -20,7 +20,7 @@
G_warning("seg_open(): unable to create segment file");
return -2;
}
- if (0 > (errflag = segment_format(fd, nrows, ncols,
+ if (0 > (errflag = Segment_format(fd, nrows, ncols,
row_in_seg, col_in_seg, size_struct))) {
close(fd);
unlink(filename);
@@ -39,7 +39,7 @@
G_warning("seg_open(): unable to re-open segment file");
return -4;
}
- if (0 > (errflag = segment_init(&(sseg->seg), fd, nsegs_in_memory))) {
+ if (0 > (errflag = Segment_init(&(sseg->seg), fd, nsegs_in_memory))) {
close(fd);
unlink(filename);
if (errflag == -1) {
Modified: grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_put.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_put.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/raster/r.watershed/seg/sseg_put.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -4,7 +4,7 @@
int seg_put(SSEG * sseg, char *value, GW_LARGE_INT row, GW_LARGE_INT col)
{
- if (segment_put(&(sseg->seg), value, row, col) < 0) {
+ if (Segment_put(&(sseg->seg), value, row, col) < 0) {
G_warning("seg_put(): could not write segment file");
return -1;
}
@@ -13,7 +13,7 @@
int seg_put_row(SSEG * sseg, char *value, GW_LARGE_INT row)
{
- if (segment_put_row(&(sseg->seg), value, row) < 0) {
+ if (Segment_put_row(&(sseg->seg), value, row) < 0) {
G_warning("seg_put(): could not write segment file");
return -1;
}
Modified: grass/branches/releasebranch_7_0/vector/v.surf.bspline/main.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.surf.bspline/main.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/vector/v.surf.bspline/main.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -459,12 +459,12 @@
out_file = G_tempfile();
out_fd = creat(out_file, 0666);
- if (segment_format(out_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(double)) != 1)
+ if (Segment_format(out_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(double)) != 1)
G_fatal_error(_("Can not create temporary file"));
close(out_fd);
out_fd = open(out_file, 2);
- if (segment_init(&out_seg, out_fd, segments_in_memory) != 1)
+ if (Segment_init(&out_seg, out_fd, segments_in_memory) != 1)
G_fatal_error(_("Can not initialize temporary file"));
/* initialize output */
@@ -474,7 +474,7 @@
Rast_set_d_null_value(drastbuf, ncols);
for (row = 0; row < nrows; row++) {
G_percent(row, nrows, 2);
- segment_put_row(&out_seg, drastbuf, row);
+ Segment_put_row(&out_seg, drastbuf, row);
}
G_percent(row, nrows, 2);
@@ -487,12 +487,12 @@
mask_file = G_tempfile();
mask_fd = creat(mask_file, 0666);
- if (segment_format(mask_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(char)) != 1)
+ if (Segment_format(mask_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(char)) != 1)
G_fatal_error(_("Can not create temporary file"));
close(mask_fd);
mask_fd = open(mask_file, 2);
- if (segment_init(&mask_seg, mask_fd, segments_in_memory) != 1)
+ if (Segment_init(&mask_seg, mask_fd, segments_in_memory) != 1)
G_fatal_error(_("Can not initialize temporary file"));
maskfd = Rast_open_old(mask_opt->answer, "");
@@ -508,7 +508,7 @@
else
mask_val = 1;
- segment_put(&mask_seg, &mask_val, row, col);
+ Segment_put(&mask_seg, &mask_val, row, col);
}
}
@@ -893,7 +893,7 @@
if (have_mask) {
- segment_release(&mask_seg); /* release memory */
+ Segment_release(&mask_seg); /* release memory */
close(mask_fd);
unlink(mask_file);
}
@@ -902,7 +902,7 @@
for (row = 0; row < nrows; row++) {
G_percent(row, nrows, 2);
for (col = 0; col < ncols; col++) {
- segment_get(&out_seg, &dval, row, col);
+ Segment_get(&out_seg, &dval, row, col);
drastbuf[col] = dval;
}
Rast_put_d_row(raster, drastbuf);
@@ -910,7 +910,7 @@
Rast_close(raster);
- segment_release(&out_seg); /* release memory */
+ Segment_release(&out_seg); /* release memory */
close(out_fd);
unlink(out_file);
/* set map title */
Modified: grass/branches/releasebranch_7_0/vector/v.surf.bspline/resamp.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.surf.bspline/resamp.c 2014-10-22 07:35:04 UTC (rev 62335)
+++ grass/branches/releasebranch_7_0/vector/v.surf.bspline/resamp.c 2014-10-22 07:37:07 UTC (rev 62336)
@@ -80,7 +80,7 @@
for (row = startrow; row < endrow; row++) {
for (col = startcol; col < endcol; col++) {
- segment_get(mask_seg, &mask_val, row, col);
+ Segment_get(mask_seg, &mask_val, row, col);
if (!mask_val)
continue;
@@ -162,7 +162,7 @@
dval = interpolation;
}
else {
- segment_get(out_seg, &dval, row, col);
+ Segment_get(out_seg, &dval, row, col);
if ((X > Overlap.E) && (X < General.E)) {
if ((Y > Overlap.N) && (Y < General.N)) { /* (3) */
csi = (General.E - X) / overlap;
@@ -218,7 +218,7 @@
}
}
} /* end not in overlap */
- segment_put(out_seg, &dval, row, col);
+ Segment_put(out_seg, &dval, row, col);
} /* for num_points */
return 1;
More information about the grass-commit
mailing list