X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsubst.h;fp=webcit%2Fsubst.h;h=f0aa90c2407ffcc96ad4870369492d5e9413dd55;hb=3841dfefb6b086720b6d5d9af39aaf8b19730e6d;hp=b44b33a5217061a3a01a8753d3d1a748a46d2070;hpb=7cabeea6da9a3197dcb61eca4f7c2886b33d6257;p=citadel.git diff --git a/webcit/subst.h b/webcit/subst.h index b44b33a52..f0aa90c24 100644 --- a/webcit/subst.h +++ b/webcit/subst.h @@ -35,9 +35,6 @@ enum { WCS_LONG /* its an integer */ }; -#define CTX TP->Context -#define CCTX TP->ControlContext - #define CTX_NONE 0 #define CTX_SITECFG 1 #define CTX_SESSION 2 @@ -78,7 +75,6 @@ enum { */ typedef struct _contexts { int ContextType; /* do we require a User Context ? */ - int ControlContextType; /* are we inside of a control structure? */ int nMinArgs; /* How many arguments do we need at least? */ int nMaxArgs; /* up to how many arguments can we handle? */ } ContextFilter; @@ -97,6 +93,9 @@ typedef int (*WCPreevalFunc)(WCTemplateToken *Token); /* make a template token a lookup key: */ #define TKEY(a) TP->Tokens->Params[a]->Start, TP->Tokens->Params[a]->len +void *GetContextPayload(WCTemplputParams *TP, int ContextType); +#define CTX(a) GetContextPayload(TP, a) + /** * @ingroup subst * this is the signature of a conditional function @@ -165,9 +164,9 @@ struct WCTemplateToken { struct WCTemplputParams { ContextFilter Filter; void *Context; - void *ControlContext; int nArgs; WCTemplateToken *Tokens; + WCTemplputParams *Sub, *Super; }; @@ -363,6 +362,14 @@ void RegisterITERATOR(const char *Name, long len, /* Our identifier */ +void StackContext(WCTemplputParams *Super, + WCTemplputParams *Sub, + void *Context, + int ContextType, + int nArgs, + WCTemplateToken *Tokens); + +void UnStackContext(WCTemplputParams *Sub);