* for all other. Currently, bool values have only "true"/"false"
* string values
* <@IF EXPRESSION @>
- * <@ELSE@>
+ * [ <@ELSE@> ]
* <@ENDIF@>
*
* Expression is classical with support following:
* C-level.
*
* <@LOOP MARKNAME@>
- * <@ SELF @>
+ * [ <@ SELF @> ]
* <@ENDLOOP@>
* Loop has predefined variables:
* __FIRST - true for first iteration
* setTemplateValueBool("outerLoop.var1");
* addTemplateRow("innerLoop");
* setTemplateValueBool("outerLoop.innerLoop.var2");
+ * - addTemplateNestedLoop
+ * returnTemplateNestedLoop
+ * Manage self-nested loops ( ie tree-like structures ).
+ * Loop's template should contains one <@ SELF @> pointer.
+ *
+ * Examplaes of usage are in data/template.html used for test.
*
******************************************************************************
* Memory management *
* Unfortunatly, I'm too lazy to unify memory usage by several pieces
* in library. So, library uses mixed plain malloc and memory context
* concepts (tmalloc.h).
- * To work with library it's needed to allocate persitent memory context
- * for initTemplate() call and temprorary memory context for usual work.
+ * To work with library it's needed to allocate persistent memory context
+ * for initTemplate() call and provide temporary memory context for usual work.
* after printTemplate is called it's needed to call resetTemplate() and
* then resetMemoryContext() for second context.
*
struct {
TemplateNode loop;
LoopRow savedRowData;
- GList *childrenLoopAfterSelf;
+ GList *childrenLoopAfterSelf;
} nest;
/* LoopNode */
char *varName;
int varNameLength;
TemplateNode bodyNode;
- TemplateNode selfNode;
+ TemplateNode selfNode; /* pointer to self-nested plase to insert */
GList *childrenLoop; /* to reset loop's instance */
GList *listVarValues; /* list of loop variables */
GList *listInstance;
+->row
|
|
- +->row->nestedinstance
+ +->row->currentInstance
*/
LoopRow lastRow;
LoopInstance currentInstance;