* we need to substitute all contexts..
HashList *MsgHeaderHandler = NULL;
HashList *MsgEvaluators = NULL;
HashList *MimeRenderHandler = NULL;
-int analyze_msg = 0;
+int dbg_analyze_msg = 0;
#define SUBJ_COL_WIDTH_PCT 50 /**< Mailbox view column width */
#define SENDER_COL_WIDTH_PCT 30 /**< Mailbox view column width */
StrBufCutLeft(Buf, StrLength(HdrToken) + 1);
#ifdef TECH_PREVIEW
- if (analyze_msg) lprintf(1, ":: [%s] = [%s]\n", ChrPtr(HdrToken), ChrPtr(Buf));
+ if (dbg_analyze_msg) lprintf(1, ":: [%s] = [%s]\n", ChrPtr(HdrToken), ChrPtr(Buf));
#endif
/* look up one of the examine_* functions to parse the content */
if (GetHash(MsgHeaderHandler, SKEY(HdrToken), &vHdr) &&
if (StrLength(HdrToken) > 0) {
StrBufCutLeft(Buf, StrLength(HdrToken) + 1);
#ifdef TECH_PREVIEW
- if (analyze_msg) lprintf(1, ":: [%s] = [%s]\n", ChrPtr(HdrToken), ChrPtr(Buf));
+ if (dbg_analyze_msg) lprintf(1, ":: [%s] = [%s]\n", ChrPtr(HdrToken), ChrPtr(Buf));
#endif
/* the examine*'s know how to do with mime headers too... */
if (GetHash(MsgHeaderHandler, SKEY(HdrToken), &vHdr) &&
HashList *SortHash;
int LoadTemplates = 0;
+int dbg_bactrace_template_errors = 0;
WCTemplputParams NoCtx;
#define SV_GETTEXT 1
Type,
ChrPtr(Error));
}
+ if (dbg_bactrace_template_errors)
+ wc_backtrace();
+
}
-void ProcessTemplate(WCTemplate *Tmpl, StrBuf *Target, void *Context, int ContextType)
+void ProcessTemplate(WCTemplate *Tmpl, StrBuf *Target, WCTemplputParams *CallingTP)
{
WCTemplate *pTmpl = Tmpl;
int done = 0;
long len;
WCTemplputParams TP;
- TP.Context = Context;
- TP.Filter.ContextType = ContextType;
+ memcpy(&TP.Filter, &CallingTP->Filter, sizeof(ContextFilter));
+
+ TP.Context = CallingTP->Context;
+ TP.ControlContext = CallingTP->ControlContext;
if (LoadTemplates != 0) {
if (LoadTemplates > 1)
*/
void DoTemplate(const char *templatename, long len, StrBuf *Target, WCTemplputParams *TP)
{
+ WCTemplputParams LocalTP;
HashList *Static;
HashList *StaticLocal;
void *vTmpl;
if (Target == NULL)
Target = WC->WBuf;
+ if (TP == NULL) {
+ memset(&LocalTP, 0, sizeof(WCTemplputParams));
+ TP = &LocalTP;
+ }
+
if (WC->is_mobile) {
Static = WirelessTemplateCache;
StaticLocal = WirelessLocalTemplateCache;
}
if (vTmpl == NULL)
return;
- ProcessTemplate(vTmpl, Target, TP->Context, TP->Filter.ContextType);
+ ProcessTemplate(vTmpl, Target, TP);
}
/*-----------------------------------------------------------------------------
const char foobuf[32];
const char *nix(void *vptr) {snprintf(foobuf, 32, "%0x", (long) vptr); return foobuf;}
#endif
-extern int analyze_msg;
+extern int dbg_analyze_msg;
+extern int dbg_bactrace_template_errors;
void InitTemplateCache(void);
extern int LoadTemplates;
extern void LoadZoneFiles(void);
break;
case 'T':
LoadTemplates = atoi(optarg);
- analyze_msg = (LoadTemplates && 0x2) != 0;
+ dbg_analyze_msg = (LoadTemplates && (1<<1)) != 0;
+ dbg_bactrace_template_errors = (LoadTemplates && (1<<2)) != 0;
break;
case 'Z':
DisableGzip = 1;