aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/proj.def3
-rw-r--r--src/proj.h1
-rw-r--r--src/proj_4D_api.c15
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
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,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