aboutsummaryrefslogtreecommitdiff
path: root/src/projects.h
diff options
context:
space:
mode:
authorThomas Knudsen <busstoptaktik@users.noreply.github.com>2018-02-07 12:15:04 +0100
committerGitHub <noreply@github.com>2018-02-07 12:15:04 +0100
commit4f00f09f1c306e87dfea3a5bc49dcaae72280e00 (patch)
tree8e1378ed32ac4f9b2badf37fd9b5ceac66d049c8 /src/projects.h
parent4cd6fe1369f52bc53c8e595a218bd0e7426b05db (diff)
downloadPROJ-4f00f09f1c306e87dfea3a5bc49dcaae72280e00.tar.gz
PROJ-4f00f09f1c306e87dfea3a5bc49dcaae72280e00.zip
Shrink PJ_XXX_INFO structs, but keep same syntax. (#775)
* Shrink PJ_XXX_INFO structs, but keep same syntax. A number of the fixed length strings in the INFO structs are simply reflections of material that already exists as static strings at a number of places in the library (or in the case of PJ_INFO, really *should* exist, and now is implemented). This PR replaces these cases of constant length strings with const char pointers. The usage syntax is unchanged, and so is the nice property of having the return value allocated on the stack, and hence not requiring explicit memory management by the caller. proj_info now only does setup once - and the searchpath entry of PJ_INFO is not arbitrarily truncated at 512 bytes. Repeated calls simply returns a copy of already prepared material. The id, description and definition entries of PJ_PROJ_INFO are now also guaranteed to hold the entire text of the corresponding static string, by being represented by a const char pointer to that actual static string. PJ_GRID_INFO and PJ_INIT_INFO (i.e. the two smallest INFO structs) are unchanged. * Eliminate pj_strlcpy - not needed anymore: Remining calls could safely be replaced by strncpy. * Extend PROJ_INFO with paths from pj_set_searchpath. NOTE: Need to call pj_set_searchpath before first call to proj_info Huge thanks to Kristian Evers and Even Rouault for comments, debugging and advice.
Diffstat (limited to 'src/projects.h')
-rw-r--r--src/projects.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/projects.h b/src/projects.h
index 41f4aa3c..60bac8a1 100644
--- a/src/projects.h
+++ b/src/projects.h
@@ -231,6 +231,7 @@ struct PJconsts {
projCtx_t *ctx;
const char *descr; /* From pj_list.h or individual PJ_*.c file */
paralist *params; /* Parameter list */
+ char *def_full; /* Full textual definition (usually 0 - set by proj_pj_info) */
char *def_size; /* Shape and size parameters extracted from params */
char *def_shape;
char *def_spherification;