Martin Landa ee734e99fb gislib: document error handlers 13 gadi atpakaļ
..
colors cd7507a4b7 prettified 13 gadi atpakaļ
FIPS.code db49180dd7 welcome to GRASS 7.0.svn 17 gadi atpakaļ
G.h 0b7dc05f0d Split G__ between lib/gis and lib/raster 16 gadi atpakaļ
Makefile 97fe635c5c libgis: G__script(), respect current year in the script-like output 13 gadi atpakaļ
README.TYPE db49180dd7 welcome to GRASS 7.0.svn 17 gadi atpakaļ
adj_cellhd.c 7088a02761 Generate fatal errors rather than returning a status, for: 15 gadi atpakaļ
alloc.c 7c8c38685b Optimisations: 15 gadi atpakaļ
area.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
area_ellipse.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
area_poly1.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
area_poly2.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
area_sphere.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
ascii_chk.c c7041e9ca3 Remove unnecessary return values 16 gadi atpakaļ
asprintf.c 06ad8336d1 Fix G_snprintf() to allow for bug in Windows vsnprintf() 15 gadi atpakaļ
basename.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
bres_line.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
clicker.c c313e28597 Bundle static variables into per-file structures 16 gadi atpakaļ
color_rules.c 4edb71ac75 gislib: G_list_color_rules() and G_find_color_rule() added 14 gadi atpakaļ
color_str.c 8db528aa65 color_str.c moved back to libgis (modules fixed) 16 gadi atpakaļ
colors.desc 0e21177bc4 fwd port from 6.4 14 gadi atpakaļ
commas.c c7041e9ca3 Remove unnecessary return values 16 gadi atpakaļ
copy_dir.c 01ed48535c Fix bogus inclusion of <grass/config.h> 14 gadi atpakaļ
copy_file.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
counter.c aff756a341 Fix G_is_initialized() for case of concurrent initialisation attempts 16 gadi atpakaļ
date.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
datum.c ab082da4e0 Add "const" where appropriate to libgis return types 16 gadi atpakaļ
datum.table 72e1e2bf11 Add Swedish datum rt90 15 gadi atpakaļ
datumtransform.table 1b30489425 datumtransform.table: fix url (5) 14 gadi atpakaļ
debug.c 0b7dc05f0d Split G__ between lib/gis and lib/raster 16 gadi atpakaļ
distance.c 9b9f640694 gislib: cosmetics in doxygen documentation 14 gadi atpakaļ
done_msg.c c7041e9ca3 Remove unnecessary return values 16 gadi atpakaļ
ellipse.table db49180dd7 welcome to GRASS 7.0.svn 17 gadi atpakaļ
ellipse.table.solar.system 03d8a0a99a Planetary ellipsoids from Alessandro Frigeri 13 gadi atpakaļ
endian.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
env.c f54da971c3 gislib: update env.c doxygen documentation 14 gadi atpakaļ
error.c ee857eab2a respect the error log file (merge from devbr6) 14 gadi atpakaļ
file_name.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 gadi atpakaļ
find_etc.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
find_file.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 gadi atpakaļ
find_rast.c dc7822aafa G_find_grid3 moved from raster3d to gislib 13 gadi atpakaļ
find_rast3d.c dc7822aafa G_find_grid3 moved from raster3d to gislib 13 gadi atpakaļ
find_vect.c 3e65212312 libgis: debug G_find_raster/vector() 15 gadi atpakaļ
flate.c 4c00de6892 Fix signedness mismatch 15 gadi atpakaļ
fmode.c 1acdd0be01 Build system clean-up 16 gadi atpakaļ
geodesic.c c7041e9ca3 Remove unnecessary return values 16 gadi atpakaļ
geodist.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
get_ellipse.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 gadi atpakaļ
get_projinfo.c cb83f2c216 gislib: update doxygen docs for get_projinfo.c 13 gadi atpakaļ
get_window.c e028cffb66 gislib: define G_unset_window() 14 gadi atpakaļ
getl.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
gisbase.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
gisdbase.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
gisinit.c 10d86ecd93 gislib: update dox for gisinit.c 14 gadi atpakaļ
gislib.dox fdecd8f1be gislib: add G_strcasestr() 14 gadi atpakaļ
handler.c ee734e99fb gislib: document error handlers 13 gadi atpakaļ
home.c 384d7f7b04 remove useless comment, we have to return something. probably the doxygen comments need adjustment 16 gadi atpakaļ
intersect.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
is.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
key_value1.c 4a29361f14 Generate fatal errors rather than returning a status, for: 15 gadi atpakaļ
key_value2.c 4a29361f14 Generate fatal errors rather than returning a status, for: 15 gadi atpakaļ
key_value3.c 4a29361f14 Generate fatal errors rather than returning a status, for: 15 gadi atpakaļ
key_value4.c 4a29361f14 Generate fatal errors rather than returning a status, for: 15 gadi atpakaļ
legal_name.c b2a54a6471 gislib: G_find_cell renamed to G_find_raster 16 gadi atpakaļ
line_dist.c c7041e9ca3 Remove unnecessary return values 16 gadi atpakaļ
list.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 gadi atpakaļ
ll_format.c ab082da4e0 Add "const" where appropriate to libgis return types 16 gadi atpakaļ
ll_scan.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
locale.c 474402cb81 Various MinGW bugfixes from Rosen Matev 16 gadi atpakaļ
location.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
ls.c c7041e9ca3 Remove unnecessary return values 16 gadi atpakaļ
ls_filter.c af2133adf1 Move regex/glob G__ls() filters into lib/gis 15 gadi atpakaļ
mach_name.c 474402cb81 Various MinGW bugfixes from Rosen Matev 16 gadi atpakaļ
make_loc.c ba63aa9662 update FSF mailing address (https://trac.osgeo.org/grass/ticket/1422) 13 gadi atpakaļ
make_mapset.c ba63aa9662 update FSF mailing address (https://trac.osgeo.org/grass/ticket/1422) 13 gadi atpakaļ
mapcase.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
mapset.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
mapset_msc.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 gadi atpakaļ
mapset_nme.c 61e81887d6 Force current mapset to appear at front of mapset search path 14 gadi atpakaļ
myname.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 gadi atpakaļ
named_colr.c 671e44225a Fix formatting of array initialisers 17 gadi atpakaļ
new_des db49180dd7 welcome to GRASS 7.0.svn 17 gadi atpakaļ
nl_to_spaces.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
nme_in_mps.c e09ca9b4fc libgis: G_fully_qualified_name() don't report mapset if empty string 15 gadi atpakaļ
open.c a9748b5f2d gislib: check name only if defined 14 gadi atpakaļ
open_misc.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 gadi atpakaļ
overwrite.c 8ae109e2b9 vectlib: very initial direct OGR write support (v.external.out) 14 gadi atpakaļ
pager.c 1e26c862c8 Fix pager/mail functions 15 gadi atpakaļ
parser.c a2eb66c742 gislib: allow opt='-' also for multiple options (reserved for standard input/output) 13 gadi atpakaļ
parser_help.c 256a79d5f7 libgis: avoid segfault when opt->key is not defined 14 gadi atpakaļ
parser_html.c 604a1fe33e Move header inclusions, macros into appropriate files 15 gadi atpakaļ
parser_interface.c b449f53816 Add suppress_required field to flags 14 gadi atpakaļ
parser_local_proto.h f87e1ca829 gislib: G_parser() - print usage and then errors 14 gadi atpakaļ
parser_script.c 97fe635c5c libgis: G__script(), respect current year in the script-like output 13 gadi atpakaļ
parser_standard_options.c c09474f454 gislib: introduce G_define_standard_flag() 13 gadi atpakaļ
parser_wps.c f21e7c665b Correct input type in r.walk. Additional mime types for WPS output. 14 gadi atpakaļ
paths.c 0d1953da13 lib/gis: LFS for wingrass 15 gadi atpakaļ
percent.c 6618b33b4f libgis: add G_progress() 13 gadi atpakaļ
pi.h db49180dd7 welcome to GRASS 7.0.svn 17 gadi atpakaļ
plot.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
pole_in_poly.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
popen.c 770e798241 G_spawn_ex() expects descriptors as "int"s, not "char*". 15 gadi atpakaļ
progrm_nme.c 5d366eb05b major gislib.dox update (still not complete, https://trac.osgeo.org/grass/changeset/37744) 16 gadi atpakaļ
proj1.c 225171cd49 libgis: G_database_unit_name() should return localized unit name 14 gadi atpakaļ
proj2.c 225171cd49 libgis: G_database_unit_name() should return localized unit name 14 gadi atpakaļ
proj3.c 225171cd49 libgis: G_database_unit_name() should return localized unit name 14 gadi atpakaļ
projections c7478c69d3 enable Geostationary Satellite View (merge from devbr6) 15 gadi atpakaļ
put_window.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
putenv.c 5c454c7ad2 gislib: cosmetics in doxygen documentation 14 gadi atpakaļ
radii.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
rd_cellhd.c a4f42ffa5e Fix allocation bug (wrong pointer type in "sizeof") 13 gadi atpakaļ
remove.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 gadi atpakaļ
rename.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 gadi atpakaļ
rhumbline.c c7041e9ca3 Remove unnecessary return values 16 gadi atpakaļ
rotate.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
seek.c 7cc2db1d68 libgis: cosmetics in doxygen desc 14 gadi atpakaļ
set_window.c e028cffb66 gislib: define G_unset_window() 14 gadi atpakaļ
short_way.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ
sleep.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
snprintf.c 06ad8336d1 Fix G_snprintf() to allow for bug in Windows vsnprintf() 15 gadi atpakaļ
spawn.c 0ef89abb41 Don't warn about not close()ing descriptors other than std{in,out,err} on Windows 15 gadi atpakaļ
state27 db49180dd7 welcome to GRASS 7.0.svn 17 gadi atpakaļ
state83 db49180dd7 welcome to GRASS 7.0.svn 17 gadi atpakaļ
strings.c fdecd8f1be gislib: add G_strcasestr() 14 gadi atpakaļ
tempfile.c 13a759b8fc G__find_name* renamed to G_find_file* (used outside of the library) 14 gadi atpakaļ
timestamp.c 5d366eb05b major gislib.dox update (still not complete, https://trac.osgeo.org/grass/changeset/37744) 16 gadi atpakaļ
token.c e468146f3e gislib: introduce G_tokenize2() 13 gadi atpakaļ
trim_dec.c 8c1f95a84c Remove bogus return value from G_trim_decimal() 15 gadi atpakaļ
units.c d99616d7c5 m.measure: length is measured in LL locations in meters by default 15 gadi atpakaļ
user_config.c 0d1953da13 lib/gis: LFS for wingrass 15 gadi atpakaļ
verbose.c 0fb91788d7 Add, use G_is_initialized(), G_initialize_done() for one-shot initialisation 16 gadi atpakaļ
view.c c7041e9ca3 Remove unnecessary return values 16 gadi atpakaļ
whoami.c 5d366eb05b major gislib.dox update (still not complete, https://trac.osgeo.org/grass/changeset/37744) 16 gadi atpakaļ
win32_pipes.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
wind_2_box.c 88abdb3fab Eliminate G_copy(); replace with memcpy() or assignment 15 gadi atpakaļ
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 gadi atpakaļ
wind_in.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
wind_limits.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
wind_overlap.c 8868d4b686 indent -bad -bap -bbb -br -bli0 -bls -cli0 -ncs -fc1 -hnl -i4 \ 17 gadi atpakaļ
wind_scan.c e96e0a6521 gislib: cosmetics in doxygen documentation 14 gadi atpakaļ
window_map.c e028cffb66 gislib: define G_unset_window() 14 gadi atpakaļ
worker.c e4164ed7e4 Add --with-pthread etc to configure script 16 gadi atpakaļ
wr_cellhd.c 0172a80e98 tbres is not measured in degrees (bug https://trac.osgeo.org/grass/ticket/821; merge from devbr6) 15 gadi atpakaļ
writ_zeros.c c7041e9ca3 Remove unnecessary return values 16 gadi atpakaļ
zero.c b06b8a0105 vectorlib: 16 gadi atpakaļ
zone.c bc702cc96b major gislib.dox update (still not complete) 16 gadi atpakaļ

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("To 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.