1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

r7071: allow access to the current mpr memory context from ejs calls

This commit is contained in:
Andrew Tridgell 2005-05-29 11:32:29 +00:00 committed by Gerald (Jerry) Carter
parent ccc4d51927
commit a58531dcf3
2 changed files with 8 additions and 0 deletions

View File

@ -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);

View 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
}