aboutsummaryrefslogtreecommitdiff
path: root/src/ctx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ctx.cpp')
-rw-r--r--src/ctx.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ctx.cpp b/src/ctx.cpp
index 5575d3aa..6dbe0de5 100644
--- a/src/ctx.cpp
+++ b/src/ctx.cpp
@@ -226,6 +226,19 @@ projCtx pj_ctx_alloc()
}
/************************************************************************/
+/* proj_context_clone() */
+/* Create a new context based on a custom context */
+/************************************************************************/
+
+PJ_CONTEXT *proj_context_clone (PJ_CONTEXT *ctx)
+{
+ if (nullptr==ctx)
+ return pj_ctx_alloc ();
+
+ return new (std::nothrow) projCtx_t(*ctx);
+}
+
+/************************************************************************/
/* pj_ctx_free() */
/************************************************************************/