]> code.citadel.org Git - citadel.git/blobdiff - webcit/subst.c
* iteratorstruct private again
[citadel.git] / webcit / subst.c
index f6008386702124207d2e09fc5c5190750ad22df2..547aa945175c1fff38caeca33dff7f1a219ca482 100644 (file)
@@ -1741,14 +1741,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,19 +1830,19 @@ 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) {
                StopAt = GetCount(List);
        }
-       it = GetNewHashPos(List, StepWidth);
        while (GetNextHashPos(List, it, &Status.KeyLen, &Status.Key, &vContext)) {
                if ((Status.n >= StartAt) && (Status.n <= StopAt)) {
                        if (DetectGroupChange && Status.n > 0) {