Martin Landa b830d6a857 libgis: tokenize string using strtok() 11 years ago
..
colors 26637751dd avoid integer overflow for color rule population 12 years ago
FIPS.code db49180dd7 welcome to GRASS 7.0.svn 17 years ago
G.h 6d69fea9b6 Move XDR functions from lib/raster to lib/gis 12 years ago
Makefile b54f3e9bc2 move proj-related files from etc/ to etc/proj 13 years ago
README.TYPE 0265bfd52e spelling 13 years ago
adj_cellhd.c ebfd5088d1 dox: region (window) functions doc improvements 12 years ago
alloc.c 48b4f09d9d fix copyright initial year (from G6) 12 years ago
area.c 0619f52281 libgis: noting necessary call in documentation 12 years ago
area_ellipse.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
area_poly1.c 58014fe47b libgis/dox: verbatim for equations in G_ellipsoid_polygon_area 11 years ago
area_poly2.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
area_sphere.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
ascii_chk.c c7041e9ca3 Remove unnecessary return values 16 years ago
asprintf.c e0ca521985 libgis: fix vsnprintf usage in G_rasprintf 12 years ago
basename.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 years ago
bres_line.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
clicker.c c313e28597 Bundle static variables into per-file structures 16 years ago
color_rules.c 1dba9b62d4 dox: fixing several doxygen warnings (wrong file names, typos, lt gt chars) 12 years ago
color_str.c 8db528aa65 color_str.c moved back to libgis (modules fixed) 16 years ago
colors.desc dc52048837 libgis: new srtm_plus color table 12 years ago
commas.c c7041e9ca3 Remove unnecessary return values 16 years ago
copy_dir.c 623c7b94ec simplify wingrass LFS 12 years ago
copy_file.c 070eaa1a92 msg typo: occured -> occurred 11 years ago
counter.c aff756a341 Fix G_is_initialized() for case of concurrent initialisation attempts 16 years ago
date.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
datum.c 1a84429e14 some fixes for 'error: format not a string literal and no format arguments [-Werror=format-security]' 11 years ago
datum.table 1087d8ad64 support ITRF_1992 datum 12 years ago
datumtransform.table 1087d8ad64 support ITRF_1992 datum 12 years ago
debug.c 09b7db1dd9 doxygen errors fixed 12 years ago
distance.c b620683d20 dox: segment library (unnecessary fn and SEG/seg mess) 12 years ago
done_msg.c c7041e9ca3 Remove unnecessary return values 16 years ago
ellipse.table db49180dd7 welcome to GRASS 7.0.svn 17 years ago
ellipse.table.solar.system e4531aa905 Correction in Ganymede's minor radius from Alessandro Frigeri. 13 years ago
endian.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
env.c f54da971c3 gislib: update env.c doxygen documentation 14 years ago
error.c 0764296ef8 dox: reducing doxygen warnings 12 years ago
file_name.c 87da4ee948 libgis: dox cosmetics 12 years ago
find_etc.c 09b7db1dd9 doxygen errors fixed 12 years ago
find_file.c eacbed788b Fixed segmentation fault 11 years ago
find_rast.c dc7822aafa G_find_grid3 moved from raster3d to gislib 13 years ago
find_rast3d.c dc7822aafa G_find_grid3 moved from raster3d to gislib 13 years ago
find_vect.c 3e65212312 libgis: debug G_find_raster/vector() 15 years ago
flate.c 4c00de6892 Fix signedness mismatch 15 years ago
fmode.c 1acdd0be01 Build system clean-up 16 years ago
geodesic.c c7041e9ca3 Remove unnecessary return values 16 years ago
geodist.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
get_ellipse.c b54f3e9bc2 move proj-related files from etc/ to etc/proj 13 years ago
get_projinfo.c cb83f2c216 gislib: update doxygen docs for get_projinfo.c 13 years ago
get_window.c 09b7db1dd9 doxygen errors fixed 12 years ago
getl.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
gis_local_proto.h faacfd2eb2 libgis: add G_mapset_path() 12 years ago
gisbase.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
gisdbase.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
gisinit.c 016a2f333b fwd-port of improved error msg 12 years ago
gislib.dox d4c552ac46 gislib/dox: cmd line parsing doc updated, modernized and polished 11 years ago
gislib_cmdline_parsing.dox e9e13c2c2b gislib/dox: documenting Option, Flag and related enums using doxygen 11 years ago
handler.c ee734e99fb gislib: document error handlers 13 years ago
home.c 384d7f7b04 remove useless comment, we have to return something. probably the doxygen comments need adjustment 16 years ago
ilist.c 5120adf63f Fixed potential memory leak in integer list init, added new and free ilist functions. 11 years ago
intersect.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 years ago
is.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 years ago
key_value1.c 745e71030a libgis: doxygen docs update (key_value_[1|2|3].c) 13 years ago
key_value2.c 745e71030a libgis: doxygen docs update (key_value_[1|2|3].c) 13 years ago
key_value3.c e841d781ac libgis: be more verbose when opening a file fails 11 years ago
key_value4.c 4a29361f14 Generate fatal errors rather than returning a status, for: 15 years ago
legal_name.c 87da4ee948 libgis: dox cosmetics 12 years ago
line_dist.c c7041e9ca3 Remove unnecessary return values 16 years ago
list.c 1dba9b62d4 dox: fixing several doxygen warnings (wrong file names, typos, lt gt chars) 12 years ago
ll_format.c ab082da4e0 Add "const" where appropriate to libgis return types 16 years ago
ll_scan.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 years ago
locale.c 474402cb81 Various MinGW bugfixes from Rosen Matev 16 years ago
location.c faacfd2eb2 libgis: add G_mapset_path() 12 years ago
ls.c 8bddad327f revert https://trac.osgeo.org/grass/changeset/53207 with better fix 12 years ago
ls_filter.c af2133adf1 Move regex/glob G__ls() filters into lib/gis 15 years ago
mach_name.c 474402cb81 Various MinGW bugfixes from Rosen Matev 16 years ago
make_loc.c 311392ebcb libgis: G_make_location() - check for legal name 12 years ago
make_mapset.c 311392ebcb libgis: G_make_location() - check for legal name 12 years ago
mapcase.c 09b7db1dd9 doxygen errors fixed 12 years ago
mapset.c faacfd2eb2 libgis: add G_mapset_path() 12 years ago
mapset_msc.c 623c7b94ec simplify wingrass LFS 12 years ago
mapset_nme.c 790e6004da libgis: fix https://trac.osgeo.org/grass/changeset/34486 11 years ago
myname.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 years ago
named_colr.c 671e44225a Fix formatting of array initialisers 17 years ago
new_des db49180dd7 welcome to GRASS 7.0.svn 17 years ago
nl_to_spaces.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 years ago
nme_in_mps.c af91bdbb98 libgis: G_unqualified_name() accepts not specified mapset 12 years ago
open.c 2f2f700343 gislib: add some extra debug messages 12 years ago
open_misc.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 years ago
overwrite.c 8ae109e2b9 vectlib: very initial direct OGR write support (v.external.out) 14 years ago
pager.c 1e26c862c8 Fix pager/mail functions 15 years ago
parser.c 18fbc50fb4 Relax ambiguity check for option names, similar to https://trac.osgeo.org/grass/changeset/58034 for option values 11 years ago
parser_help.c 256a79d5f7 libgis: avoid segfault when opt->key is not defined 14 years ago
parser_html.c 48bcde610e libgis: partly disable https://trac.osgeo.org/grass/changeset/57897 (work in progress) 11 years ago
parser_interface.c b449f53816 Add suppress_required field to flags 14 years ago
parser_local_proto.h 2008e16620 add parse to return as output rest format 13 years ago
parser_rest.c f2d4da8614 improvements for restructeredtext parser 12 years ago
parser_script.c f8aaa2e6c2 libgis: G__script(): generate valid python script 12 years ago
parser_standard_options.c e9e13c2c2b gislib/dox: documenting Option, Flag and related enums using doxygen 11 years ago
parser_wps.c 88f0751f34 Space time raster and vector datasets supported. New mimetypes defined. 13 years ago
paths.c 623c7b94ec simplify wingrass LFS 12 years ago
percent.c 6618b33b4f libgis: add G_progress() 13 years ago
pi.h db49180dd7 welcome to GRASS 7.0.svn 17 years ago
plot.c b52f487fda libgis: fix FPE error tolerance for plotting 11 years ago
pole_in_poly.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
popen.c 770e798241 G_spawn_ex() expects descriptors as "int"s, not "char*". 15 years ago
progrm_nme.c 5d366eb05b major gislib.dox update (still not complete, https://trac.osgeo.org/grass/changeset/37744) 16 years ago
proj1.c 225171cd49 libgis: G_database_unit_name() should return localized unit name 14 years ago
proj2.c 225171cd49 libgis: G_database_unit_name() should return localized unit name 14 years ago
proj3.c 225171cd49 libgis: G_database_unit_name() should return localized unit name 14 years ago
projections c7478c69d3 enable Geostationary Satellite View (merge from devbr6) 15 years ago
put_window.c ebfd5088d1 dox: region (window) functions doc improvements 12 years ago
putenv.c 5c454c7ad2 gislib: cosmetics in doxygen documentation 14 years ago
radii.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
rd_cellhd.c 1dba9b62d4 dox: fixing several doxygen warnings (wrong file names, typos, lt gt chars) 12 years ago
remove.c 623c7b94ec simplify wingrass LFS 12 years ago
rename.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 years ago
rhumbline.c c7041e9ca3 Remove unnecessary return values 16 years ago
rotate.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 years ago
seek.c 7cc2db1d68 libgis: cosmetics in doxygen desc 14 years ago
set_window.c ebfd5088d1 dox: region (window) functions doc improvements 12 years ago
short_way.c bc702cc96b major gislib.dox update (still not complete) 16 years ago
sleep.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 years ago
snprintf.c 06ad8336d1 Fix G_snprintf() to allow for bug in Windows vsnprintf() 15 years ago
spawn.c a049ea0396 Close handles after spawning child process 13 years ago
state27 db49180dd7 welcome to GRASS 7.0.svn 17 years ago
state83 db49180dd7 welcome to GRASS 7.0.svn 17 years ago
strings.c fdecd8f1be gislib: add G_strcasestr() 14 years ago
tempfile.c 2f2f700343 gislib: add some extra debug messages 12 years ago
timestamp.c 6ad43043a2 Timestamp support for vector layers added. 13 years ago
token.c b830d6a857 libgis: tokenize string using strtok() 11 years ago
trim_dec.c 8c1f95a84c Remove bogus return value from G_trim_decimal() 15 years ago
units.c 2ffbfcfe51 Fixed wrong plural unit definition 13 years ago
user_config.c 623c7b94ec simplify wingrass LFS 12 years ago
verbose.c 40a647c08a libgis: doxygen cosmetics (verbose.c) 12 years ago
view.c c7041e9ca3 Remove unnecessary return values 16 years ago
whoami.c 5d366eb05b major gislib.dox update (still not complete, https://trac.osgeo.org/grass/changeset/37744) 16 years ago
win32_pipes.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 years ago
wind_2_box.c 88abdb3fab Eliminate G_copy(); replace with memcpy() or assignment 15 years ago
wind_format.c 687a3466a8 output correct precision for different projection types (bugs https://trac.osgeo.org/grass/ticket/654 and https://trac.osgeo.org/grass/ticket/335; merge from devbr6) 16 years ago
wind_in.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 years ago
wind_limits.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 years ago
wind_overlap.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 years ago
wind_scan.c e96e0a6521 gislib: cosmetics in doxygen documentation 14 years ago
window_map.c e028cffb66 gislib: define G_unset_window() 14 years ago
worker.c e4164ed7e4 Add --with-pthread etc to configure script 16 years ago
wr_cellhd.c b96b38bfb6 Fixed wrong precision of top and bottom region storage. 13 years ago
writ_zeros.c c7041e9ca3 Remove unnecessary return values 16 years ago
xdr.c e493bb768f Add XDR functions for int 12 years ago
zero.c b06b8a0105 vectorlib: 16 years ago
zone.c bc702cc96b major gislib.dox update (still not complete) 16 years ago

README.TYPE

.\" use -ms
.LP
There were two flavors of changes made to structures in gis.h
and to calls to routines in the library:

.IP 1.
Variables in structures, parameters in argument lists to library routines,
and return values from library routines that really represented
CELL data but were declared as int have been changed to CELL.

The following structures were changed:

.DS
Categories [gis.h]
Cell_stats
Colors
Histogram
Range
Reclass
.DE

The argument type for some parameters for the following routines was changed:

.DS
G_init_cats [cats.c]
G_get_cats
G_set_cats
G_get_color [color.c]
G_set_color
G_make_random_colors [make_colr2.c]
G_make_color_wave
G_make_grey_scale
G_make_color_ramp
G_make_aspect_colors
G_add_histogram [histogram.c]
G_set_histogram
G_update_range [range.c]
.DE

The return value for the following routines was changed:

.DS
G_number_of_cats [cats.c]
G_get_histogram_cat [histogram.c]
.DE

This change does not, at present, require changes to existing code since
the CELL type is currently defined as int.

In the future, if we (or someone else) want to
redefine CELL to long (say on a 16 bit machine), the application code
will compile ok, but will not run correctly since the calling seqences
(including printf and scanf) will not match anymore.
To upgrade GRASS code for this is a big deal.
It consists of
finding all places that ints are used in assignments with
CELL variables,
modifying all the calls to the above routines,
and modifying all calls to other routines that don't know about the CELL
type (in particular printf, scanf, and Vask code).

The way to handle printf for CELL data is to use %ld and cast the
CELL value to long:
.DS
CELL x
printf ("%ld", (long) x);
.DE
The way to handle scanf for CELL data is to use %ld into a long
and assign to the CELL varaible:
.DS
CELL x;
long t;

scanf ("%ld", &t);
x = (CELL) t;
.DE
For Vask calls, assign the CELL value to a long, call Vask will the long,
then assign the long to the CELL variable:
.DS
CELL x;
long t;

t = x;
V_clear();
V_ques (&t, 'l', ...);
V_call();
x = t;
.DE

The long vs int issue for CELL also presents a subtle, but
potentially fatal, problem with malloc(n) which requires n to be int.

Suppose we want to allocate an array for reclass, from
cats min to max. What we do now is

.DS
char *table;
CELL min,max;
int len;

len = max - min + 1;
table = malloc (len);
.DE
This will fail if CELL is long and the expression max-min+1 yields
a value which overflows an int. Therefore, we should do
.DS
long len;

len = max - min + 1;
if (len != (int)len)
error("Too many categories");
table = malloc ((int)len);
.DE
.IP 2.
Variables in structures, parameters in argument lists to library routines,
and return values from library routines that should have been long
but were declared as int have been changed to long.

The following structures were changed:

.DS
Cell_stats [gis.h]
Histogram
.DE

The argument type for some parameters for the following routines was changed:

.DS
G_add_histogram [histogram.c]
G_set_histogram
G_find_cell_stat [cell_stats.c]
G_next_cell_stat
.DE

The return value for the following routines was changed:

.DS
G_get_histogram_count [histogram.c]
.DE


These changes required immediate upgrade.
I think this update is done, but I want to review it again.