r7071: allow access to the current mpr memory context from ejs calls
authorAndrew Tridgell <tridge@samba.org>
Sun, 29 May 2005 11:32:29 +0000 (11:32 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:17:12 +0000 (13:17 -0500)
(This used to be commit a58531dcf30b091913563ca2b8ce5e5843896441)

source4/lib/ejs/miniMpr.c
source4/lib/ejs/miniMpr.h

index 2094052b3933b4afca98e0a73dee958e888ec29e..8b969289b02bc7fa90d9c6d81c3c4e4eba32b6e2 100644 (file)
 
 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);
index b34fb2e2930ec012a81db483e2225410c35ba0e5..b74c734728034134710b9c140aefce48c8f564c7 100644 (file)
@@ -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
 }