projects
/
tedtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add some comments, fix cleanup, improve tests
[tedtools.git]
/
template.h
diff --git
a/template.h
b/template.h
index
6f88989
..
7953de4
100644
(file)
--- a/
template.h
+++ b/
template.h
@@
-38,7
+38,7
@@
* for all other. Currently, bool values have only "true"/"false"
* string values
* <@IF EXPRESSION @>
* for all other. Currently, bool values have only "true"/"false"
* string values
* <@IF EXPRESSION @>
- *
<@ELSE@>
+ *
[ <@ELSE@> ]
* <@ENDIF@>
*
* Expression is classical with support following:
* <@ENDIF@>
*
* Expression is classical with support following:
@@
-63,7
+63,7
@@
* C-level.
*
* <@LOOP MARKNAME@>
* C-level.
*
* <@LOOP MARKNAME@>
- *
<@ SELF @>
+ *
[ <@ SELF @> ]
* <@ENDLOOP@>
* Loop has predefined variables:
* __FIRST - true for first iteration
* <@ENDLOOP@>
* Loop has predefined variables:
* __FIRST - true for first iteration
@@
-102,6
+102,12
@@
* setTemplateValueBool("outerLoop.var1");
* addTemplateRow("innerLoop");
* setTemplateValueBool("outerLoop.innerLoop.var2");
* 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 *
*
******************************************************************************
* Memory management *
@@
-109,8
+115,8
@@
* 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).
* 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
tempr
orary memory context for usual work.
+ * To work with library it's needed to allocate persi
s
tent memory context
+ * for initTemplate() call and
provide temp
orary memory context for usual work.
* after printTemplate is called it's needed to call resetTemplate() and
* then resetMemoryContext() for second context.
*
* after printTemplate is called it's needed to call resetTemplate() and
* then resetMemoryContext() for second context.
*
@@
-251,7
+257,7
@@
typedef struct TemplateNodeData {
struct {
TemplateNode loop;
LoopRow savedRowData;
struct {
TemplateNode loop;
LoopRow savedRowData;
- GList *childrenLoopAfterSelf;
+ GList *childrenLoopAfterSelf;
} nest;
/* LoopNode */
} nest;
/* LoopNode */
@@
-259,7
+265,7
@@
typedef struct TemplateNodeData {
char *varName;
int varNameLength;
TemplateNode bodyNode;
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;
GList *childrenLoop; /* to reset loop's instance */
GList *listVarValues; /* list of loop variables */
GList *listInstance;
@@
-268,7
+274,7
@@
typedef struct TemplateNodeData {
+->row
|
|
+->row
|
|
- +->row->
nestedi
nstance
+ +->row->
currentI
nstance
*/
LoopRow lastRow;
LoopInstance currentInstance;
*/
LoopRow lastRow;
LoopInstance currentInstance;