aboutsummaryrefslogtreecommitdiff
path: root/src/proj_4D_api.c
diff options
context:
space:
mode:
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