aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc/renderer.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2020-04-22 02:06:37 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2020-04-22 02:06:37 +0200
commit8404096582103dccb8885b0c404f0a756685e913 (patch)
tree97d74ba2dd9591f55bd4284de6d40ba673eb8bec /src/blogc/renderer.c
parent67c856608a746b5205300d3f8141a6a29d3cc89e (diff)
downloadblogc-8404096582103dccb8885b0c404f0a756685e913.tar.gz
blogc-8404096582103dccb8885b0c404f0a756685e913.tar.bz2
blogc-8404096582103dccb8885b0c404f0a756685e913.zip
blogc: allow passing multiple -e options
Diffstat (limited to 'src/blogc/renderer.c')
-rw-r--r--src/blogc/renderer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/blogc/renderer.c b/src/blogc/renderer.c
index 87b3f5a..140a86e 100644
--- a/src/blogc/renderer.c
+++ b/src/blogc/renderer.c
@@ -166,7 +166,8 @@ blogc_split_list_variable(const char *name, bc_trie_t *global, bc_trie_t *local)
char*
-blogc_render(bc_slist_t *tmpl, bc_slist_t *sources, bc_trie_t *listing_entry, bc_trie_t *config, bool listing)
+blogc_render(bc_slist_t *tmpl, bc_slist_t *sources, bc_slist_t *listing_entries,
+ bc_trie_t *config, bool listing)
{
if (tmpl == NULL)
return NULL;
@@ -194,6 +195,7 @@ blogc_render(bc_slist_t *tmpl, bc_slist_t *sources, bc_trie_t *listing_entry, bc
int cmp = 0;
bc_slist_t *tmp = tmpl;
+ bc_slist_t *current_listing_entry = listing_entries;
while (tmp != NULL) {
blogc_template_node_t *node = tmp->data;
@@ -222,8 +224,12 @@ blogc_render(bc_slist_t *tmpl, bc_slist_t *sources, bc_trie_t *listing_entry, bc
tmp_source = current_source != NULL ? current_source->data : NULL;
}
if (0 == strcmp("listing_entry", node->data[0])) {
+ bc_trie_t *listing_entry = NULL;
+ if (current_listing_entry != NULL) {
+ listing_entry = current_listing_entry->data;
+ current_listing_entry = current_listing_entry->next;
+ }
if (listing_entry == NULL || !listing) {
-
// we can just skip anything and walk until the next
// 'endblock'
while (node->type != BLOGC_TEMPLATE_NODE_ENDBLOCK) {