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:
parent
ccc4d51927
commit
a58531dcf3
@ -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);
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user