]> code.citadel.org Git - citadel.git/blobdiff - webcit/subst.c
* made wc_subst private. todo solved.
[citadel.git] / webcit / subst.c
index f4fde0edb9787d7c2e8c1d3d1bbc5aeb40ddb043..3231c931e086dfd5157eaf35f6b95b107ef81612 100644 (file)
@@ -43,6 +43,20 @@ WCTemplputParams NoCtx;
 #define SV_SUBTEMPL 5
 #define SV_PREEVALUATED 6
 
+
+/*
+ * \brief Dynamic content for variable substitution in templates
+ */
+typedef struct _wcsubst {
+       ContextFilter Filter;
+       int wcs_type;                       /* which type of Substitution are we */
+       char wcs_key[32];                   /* copy of our hashkey for debugging */
+       StrBuf *wcs_value;                  /* if we're a string, keep it here */
+       long lvalue;                        /* type long? keep data here */
+       WCHandlerFunc wcs_function; /* funcion hook ???*/
+} wcsubst;
+
+
 typedef struct _WCTemplate {
        StrBuf *Data;
        StrBuf *FileName;
@@ -1741,14 +1755,14 @@ void RegisterITERATOR(const char *Name, long len,
        Put(Iterators, Name, len, It, NULL);
 }
 
-/* typedef struct _iteratestruct {
+typedef struct _iteratestruct {
        int GroupChange;
        int oddeven;
        const char *Key;
        long KeyLen;
        int n;
        int LastN;
-       }IterateStruct; */
+       }IterateStruct; 
 
 void tmpl_iterate_subtmpl(StrBuf *Target, WCTemplputParams *TP)
 {
@@ -1830,14 +1844,14 @@ void tmpl_iterate_subtmpl(StrBuf *Target, WCTemplputParams *TP)
        SubTP.Filter.ControlContextType = CTX_ITERATE;
        SubTP.ControlContext = &Status;
        
+       if (HAVE_PARAM(2)) {
+               StartAt = GetTemplateTokenNumber(Target, TP, 2, 0);
+       }
        if (HAVE_PARAM(3)) {
-               StartAt = GetTemplateTokenNumber(Target, TP, 3, 0);
+               StepWidth = GetTemplateTokenNumber(Target, TP, 3, 0);
        }
        if (HAVE_PARAM(4)) {
-               StepWidth = GetTemplateTokenNumber(Target, TP, 4, 0);
-       }
-       if (HAVE_PARAM(5)) {
-               StopAt = GetTemplateTokenNumber(Target, TP, 5, -1);
+               StopAt = GetTemplateTokenNumber(Target, TP, 4, -1);
        }
        it = GetNewHashPos(List, StepWidth);
        if (StopAt < 0) {