diff options
| author | Thomas Knudsen <busstoptaktik@users.noreply.github.com> | 2018-02-11 00:42:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-11 00:42:05 +0100 |
| commit | e1a213b2d9a29d86b89547781a2e27d5fd01f111 (patch) | |
| tree | 0e7fc98a751e16cef732cfe5e07a7d37900165e8 | |
| parent | 2cca9ead11be47f6efd0ab504cf2e9020b85fa80 (diff) | |
| download | PROJ-e1a213b2d9a29d86b89547781a2e27d5fd01f111.tar.gz PROJ-e1a213b2d9a29d86b89547781a2e27d5fd01f111.zip | |
Add proj_context_errno to API and missing proj_geod to proj.def (#791)
| -rw-r--r-- | src/proj.def | 3 | ||||
| -rw-r--r-- | src/proj.h | 1 | ||||
| -rw-r--r-- | src/proj_4D_api.c | 15 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/proj.def b/src/proj.def index f2936edb..d6c84dc3 100644 --- a/src/proj.def +++ b/src/proj.def @@ -152,3 +152,6 @@ EXPORTS proj_angular_input @138 proj_angular_output @139 + + proj_geod @140 + proj_context_errno @141 @@ -344,6 +344,7 @@ PJ_COORD proj_geod (const PJ *P, PJ_COORD a, PJ_COORD b); /* Set or read error level */ +int proj_context_errno (PJ_CONTEXT *ctx); int proj_errno (const PJ *P); int proj_errno_set (const PJ *P, int err); int proj_errno_reset (const PJ *P); diff --git a/src/proj_4D_api.c b/src/proj_4D_api.c index 2f689085..796e5769 100644 --- a/src/proj_4D_api.c +++ b/src/proj_4D_api.c @@ -649,11 +649,26 @@ PJ *proj_destroy (PJ *P) { return 0; } +/*****************************************************************************/ int proj_errno (const PJ *P) { +/****************************************************************************** + Read an error level from the context of a PJ. +******************************************************************************/ return pj_ctx_get_errno (pj_get_ctx ((PJ *) P)); } /*****************************************************************************/ +int proj_context_errno (PJ_CONTEXT *ctx) { +/****************************************************************************** + Read an error directly from a context, without going through a PJ + belonging to that context. +******************************************************************************/ + if (0==ctx) + ctx = pj_get_default_ctx(); + return pj_ctx_get_errno (ctx); +} + +/*****************************************************************************/ int proj_errno_set (const PJ *P, int err) { /****************************************************************************** Set context-errno, bubble it up to the thread local errno, return err |
