From d928db15d53805d9b728b440079756081961c536 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 14 Nov 2018 17:40:42 +0100 Subject: Implement RFC 2: Initial integration of "GDAL SRS barn" work This work mostly consists of: - a C++ implementation of the ISO-19111:2018 / OGC Topic 2 "Referencing by coordinates" classes to represent Datums, Coordinate systems, CRSs (Coordinate Reference Systems) and Coordinate Operations. - methods to convert between this C++ modeling and WKT1, WKT2 and PROJ string representations of those objects - management and query of a SQLite3 database of CRS and Coordinate Operation definition - a C API binding part of those capabilities This is all-in-one squashed commit of the work of https://github.com/OSGeo/proj.4/pull/1040 --- src/projects.h | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) (limited to 'src/projects.h') diff --git a/src/projects.h b/src/projects.h index 409702c4..e34fc9e0 100644 --- a/src/projects.h +++ b/src/projects.h @@ -46,6 +46,10 @@ # endif #endif +#ifdef PROJ_RENAME_SYMBOLS +#include "proj_symbol_rename.h" +#endif + /* standard inclusions */ #include #include @@ -53,6 +57,18 @@ #include #include +#ifndef PROJ_DLL +#ifdef PROJ_MSVC_DLL_EXPORT +#define PROJ_DLL __declspec(dllexport) +#elif defined(PROJ_MSVC_DLL_IMPORT) +#define PROJ_DLL __declspec(dllimport) +#elif defined(__GNUC__) +#define PROJ_DLL __attribute__ ((visibility("default"))) +#else +#define PROJ_DLL +#endif +#endif + #ifdef __cplusplus #define C_NAMESPACE extern "C" #define C_NAMESPACE_VAR extern "C" @@ -570,6 +586,8 @@ struct FACTORS { struct projFileAPI_t; +struct projCppContext; + /* proj thread context */ struct projCtx_t { int last_errno; @@ -577,6 +595,7 @@ struct projCtx_t { void (*logger)(void *, int, const char *); void *app_data; struct projFileAPI_t *fileapi; + struct projCppContext* cpp_context; /* internal context for C++ code */ }; /* classic public API */ @@ -678,20 +697,20 @@ typedef struct _PJ_GridCatalog { } PJ_GridCatalog; /* procedure prototypes */ -double dmstor(const char *, char **); +double PROJ_DLL dmstor(const char *, char **); double dmstor_ctx(projCtx ctx, const char *, char **); -void set_rtodms(int, int); -char *rtodms(char *, double, int, int); -double adjlon(double); +void PROJ_DLL set_rtodms(int, int); +char PROJ_DLL *rtodms(char *, double, int, int); +double PROJ_DLL adjlon(double); double aacos(projCtx,double), aasin(projCtx,double), asqrt(double), aatan2(double, double); -PROJVALUE pj_param(projCtx ctx, paralist *, const char *); -paralist *pj_param_exists (paralist *list, const char *parameter); -paralist *pj_mkparam(const char *); +PROJVALUE PROJ_DLL pj_param(projCtx ctx, paralist *, const char *); +paralist PROJ_DLL *pj_param_exists (paralist *list, const char *parameter); +paralist PROJ_DLL *pj_mkparam(const char *); paralist *pj_mkparam_ws (const char *str); -int pj_ell_set(projCtx ctx, paralist *, double *, double *); +int PROJ_DLL pj_ell_set(projCtx ctx, paralist *, double *, double *); int pj_datum_set(projCtx,paralist *, PJ *); int pj_angular_units_set(paralist *, PJ *); @@ -709,7 +728,7 @@ double pj_inv_mlfn(projCtx, double, double, double *); double pj_qsfn(double, double, double); double pj_tsfn(double, double, double); double pj_msfn(double, double, double); -double pj_phi2(projCtx, double, double); +double PROJ_DLL pj_phi2(projCtx, double, double); double pj_qsfn_(double, PJ *); double *pj_authset(double); double pj_authlat(double, double *); @@ -734,7 +753,7 @@ typedef struct { /* Chebyshev or Power series structure */ int power; /* != 0 if power series, else Chebyshev */ } Tseries; -Tseries *mk_cheby(projUV, projUV, double, projUV *, projUV (*)(projUV), int, int, int); +Tseries PROJ_DLL *mk_cheby(projUV, projUV, double, projUV *, projUV (*)(projUV), int, int, int); projUV bpseval(projUV, Tseries *); projUV bcheval(projUV, Tseries *); projUV biveval(projUV, Tseries *); @@ -771,7 +790,7 @@ int pj_apply_gridshift_3( projCtx ctx, double *x, double *y, double *z ); PJ_GRIDINFO **pj_gridlist_from_nadgrids( projCtx, const char *, int * ); -void pj_deallocate_grids(); +void PROJ_DLL pj_deallocate_grids(); PJ_GRIDINFO *pj_gridinfo_init( projCtx, const char * ); int pj_gridinfo_load( projCtx, PJ_GRIDINFO * ); @@ -802,13 +821,13 @@ void *pj_gauss_ini(double, double, double *,double *); LP pj_gauss(projCtx, LP, const void *); LP pj_inv_gauss(projCtx, LP, const void *); -extern char const pj_release[]; +extern char const PROJ_DLL pj_release[]; -struct PJ_DATUMS *pj_get_datums_ref( void ); +struct PJ_DATUMS PROJ_DLL *pj_get_datums_ref( void ); void *pj_default_destructor (PJ *P, int errlev); -double pj_atof( const char* nptr ); +double PROJ_DLL pj_atof( const char* nptr ); double pj_strtod( const char *nptr, char **endptr ); void pj_freeup_plain (PJ *P); -- cgit v1.2.3