From e1a213b2d9a29d86b89547781a2e27d5fd01f111 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Sun, 11 Feb 2018 00:42:05 +0100 Subject: Add proj_context_errno to API and missing proj_geod to proj.def (#791) --- src/proj.def | 3 +++ src/proj.h | 1 + src/proj_4D_api.c | 15 +++++++++++++++ 3 files changed, 19 insertions(+) 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 diff --git a/src/proj.h b/src/proj.h index 8997965e..133f1412 100644 --- a/src/proj.h +++ b/src/proj.h @@ -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,10 +649,25 @@ 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) { /****************************************************************************** -- cgit v1.2.3