From bbb826bdac54e3fec3426fe6d8e23790abbbc44f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 17 Apr 2008 01:37:42 +0200 Subject: Add convenience function for getting at event context from ejs code. (This used to be commit b659e83cd6b627dd0ae04064bccff7220a5bd1ce) --- source4/lib/appweb/mpr/miniMpr.c | 6 ++++++ source4/lib/appweb/mpr/miniMpr.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'source4/lib/appweb/mpr') diff --git a/source4/lib/appweb/mpr/miniMpr.c b/source4/lib/appweb/mpr/miniMpr.c index 52b23608aa..381815eb23 100644 --- a/source4/lib/appweb/mpr/miniMpr.c +++ b/source4/lib/appweb/mpr/miniMpr.c @@ -31,6 +31,7 @@ #include "miniMpr.h" #include "param/param.h" +#include "lib/events/events.h" /************************************ Code ************************************/ #if !BLD_APPWEB @@ -50,6 +51,11 @@ void *mprMemCtx(void) return mpr_ctx; } +struct event_context *mprEventCtx(void) +{ + return event_context_find(mprMemCtx()); +} + /* return the loadparm context being used for all ejs variables */ struct loadparm_context *mprLpCtx(void) { diff --git a/source4/lib/appweb/mpr/miniMpr.h b/source4/lib/appweb/mpr/miniMpr.h index 15ce30c8df..2b8ff0af6a 100644 --- a/source4/lib/appweb/mpr/miniMpr.h +++ b/source4/lib/appweb/mpr/miniMpr.h @@ -274,6 +274,8 @@ extern void mprSetCtx(void *ctx); extern void *mprMemCtx(void); struct loadparm_context; extern struct loadparm_context *mprLpCtx(void); +struct event_context; +extern struct event_context *mprEventCtx(void); /* This function needs to be provided by anyone using ejs */ void ejs_exception(const char *reason); -- cgit