From 0ee297eaef992265e8ccbf2cd4f8bde9a217a9fe Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 29 Dec 2018 19:27:30 +0100 Subject: Experimantal C API: add a proj_assign_context() for advanced usage --- src/ctx.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/ctx.cpp') diff --git a/src/ctx.cpp b/src/ctx.cpp index ab51d6c1..1742ee87 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -29,6 +29,7 @@ #include #include +#include "proj_experimental.h" #include "proj_internal.h" #include "projects.h" @@ -63,6 +64,22 @@ void pj_set_ctx( projPJ pj, projCtx ctx ) pj->ctx = ctx; } +/************************************************************************/ +/* proj_assign_context() */ +/************************************************************************/ + +/** \brief Re-assign a context to a PJ* object. + * + * This may be useful if the PJ* has been created with a context that is + * thread-specific, and is later used in another thread. In that case, + * the user may want to assign another thread-specific context to the + * object. + */ +void proj_assign_context( PJ* pj, PJ_CONTEXT* ctx ) +{ + pj_set_ctx( pj, ctx ); +} + /************************************************************************/ /* pj_get_default_ctx() */ /************************************************************************/ -- cgit v1.2.3