From 973ea5feb1952a6be443b66d5b49ca6c908a2c92 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 29 May 2005 11:32:29 +0000 Subject: r7071: allow access to the current mpr memory context from ejs calls (This used to be commit a58531dcf30b091913563ca2b8ce5e5843896441) --- source4/lib/ejs/miniMpr.c | 7 +++++++ source4/lib/ejs/miniMpr.h | 1 + 2 files changed, 8 insertions(+) (limited to 'source4/lib/ejs') diff --git a/source4/lib/ejs/miniMpr.c b/source4/lib/ejs/miniMpr.c index 2094052b39..8b969289b0 100644 --- a/source4/lib/ejs/miniMpr.c +++ b/source4/lib/ejs/miniMpr.c @@ -37,11 +37,18 @@ static void *mpr_ctx; +/* set the memory context to be used for all ejs variables */ void mprSetCtx(TALLOC_CTX *ctx) { mpr_ctx = ctx; } +/* return the memory context being used for all ejs variables */ +void *mprMemCtx(void) +{ + return mpr_ctx; +} + void mprFree(void *ptr) { talloc_free(ptr); diff --git a/source4/lib/ejs/miniMpr.h b/source4/lib/ejs/miniMpr.h index b34fb2e293..b74c734728 100644 --- a/source4/lib/ejs/miniMpr.h +++ b/source4/lib/ejs/miniMpr.h @@ -270,6 +270,7 @@ extern int mprStrcpy(char *dest, int destMax, const char *src); extern int mprMemcpy(char *dest, int destMax, const char *src, int nbytes); extern void mprSetCtx(void *ctx); +extern void *mprMemCtx(void); #ifdef __cplusplus } -- cgit