aboutsummaryrefslogtreecommitdiff
path: root/src/proj_4D_api.c
diff options
context:
space:
mode:
authorThomas Knudsen <busstoptaktik@users.noreply.github.com>2018-02-11 00:42:05 +0100
committerGitHub <noreply@github.com>2018-02-11 00:42:05 +0100
commite1a213b2d9a29d86b89547781a2e27d5fd01f111 (patch)
tree0e7fc98a751e16cef732cfe5e07a7d37900165e8 /src/proj_4D_api.c
parent2cca9ead11be47f6efd0ab504cf2e9020b85fa80 (diff)
downloadPROJ-e1a213b2d9a29d86b89547781a2e27d5fd01f111.tar.gz
PROJ-e1a213b2d9a29d86b89547781a2e27d5fd01f111.zip
Add proj_context_errno to API and missing proj_geod to proj.def (#791)
Diffstat (limited to 'src/proj_4D_api.c')
-rw-r--r--src/proj_4D_api.c15
1 files changed, 15 insertions, 0 deletions
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