+struct WCTemplputParams {
+ ContextFilter Filter;
+ void *Context;
+ int nArgs;
+ WCTemplateToken *Tokens;
+ WCTemplputParams *Sub, *Super;
+ WCConditionalFunc ExitCtx;
+ long ExitCTXID;
+};
+
+
+
+typedef struct _ConditionalStruct {
+ ContextFilter Filter;
+ const char *PlainName;
+ WCConditionalFunc CondF;
+ WCConditionalFunc CondExitCtx;
+} ConditionalStruct;
+
+
+typedef void (*SubTemplFunc)(StrBuf *TemplBuffer, WCTemplputParams *TP);
+typedef HashList *(*RetrieveHashlistFunc)(StrBuf *Target, WCTemplputParams *TP);
+typedef void (*HashDestructorFunc) (HashList **KillMe);
+typedef int (*FilterByParamFunc)(const char* key, long len, void *Context, StrBuf *Target, WCTemplputParams *TP);
+
+extern WCTemplputParams NoCtx;
+
+#define HAVE_PARAM(a) (TP->Tokens->nParameters > a)
+
+
+#define ERR_NAME 0
+#define ERR_PARM1 1
+#define ERR_PARM2 2
+/**
+ * @ingroup subst
+ * @brief log an error while evaluating a token; print it to the actual template
+ * @param Target your Target Buffer to print the error message next to the log
+ * @param Type What sort of thing are we talking about? Tokens? Conditionals?
+ * @param TP grab our set of default information here
+ * @param Format for the custom error message
+ */
+void LogTemplateError (StrBuf *Target,
+ const char *Type,
+ int ErrorPos,
+ WCTemplputParams *TP,
+ const char *Format, ...)__attribute__((__format__(__printf__,5,6)));
+
+
+/**
+ * @ingroup subst
+ * @brief log an error while in global context; print it to Wildfire / Target
+ * @param Target your Target Buffer to print the error message next to the log
+ * @param Type What sort of thing are we talking about? Tokens? Conditionals?
+ * @param Format for the custom error message
+ */
+void LogError (StrBuf *Target, const char *Type, const char *Format, ...);
+
+/**
+ * @ingroup subst
+ * @brief get the actual value of a token parameter
+ * in your tmplputs or conditionals use this function to access parameters that can also be
+ * retrieved from dynamic facilities:
+ * _ -> Gettext; retrieve this token from the i18n facilities
+ * : -> lookup a setting of that name
+ * B -> bstr; an URL-Parameter
+ * = -> subtemplate; parse a template by this name, and treat its content as this tokens value
+ *
+ * @param N which token do you want to lookup?
+ * @param Value reference to the string of the token; don't free me.
+ * @param len the length of Value
+ */
+void GetTemplateTokenString(StrBuf *Target,
+ WCTemplputParams *TP,
+ int N,
+ const char **Value,
+ long *len);
+/**
+ * @ingroup subst
+ * @return whether @ref GetTemplateTokenString would be able to give you a string