MCPcopy Create free account
hub / github.com/acl-dev/acl / tpl_get_content

Function tpl_get_content

app/wizard/tpllib.cpp:1122–1169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1120}
1121
1122void tpl_get_content(const tpl_t* tpl, char* buffer)
1123{
1124 tpl_node_t *n = tpl->head;
1125 tpl_tcell_t *s = tpl->first;
1126
1127 for (; s != NULL; s = s->next)
1128 {
1129 tpl_node_t *an = s->tpl->added_head;
1130
1131 /* Copy part until beginning of section */
1132 for (; n != *s->preceding; n = n->next)
1133 {
1134 if (n->val)
1135 {
1136 (void)memcpy(buffer, n->val, n->len);
1137 buffer += n->len;
1138 }
1139 else
1140 {
1141 (void)memcpy(buffer, n->fval->val, n->fval->len);
1142 buffer += n->fval->len;
1143 }
1144 }
1145
1146 /* Copy content appended in section */
1147 for (; an != NULL; an = an->next)
1148 {
1149 (void)memcpy(buffer, an->val, an->len);
1150 buffer += an->len;
1151 }
1152 }
1153
1154 /* Copy the rest */
1155 for (; n != NULL; n = n->next)
1156 {
1157 if (n->val)
1158 {
1159 (void)memcpy(buffer, n->val, n->len);
1160 buffer += n->len;
1161 }
1162 else
1163 {
1164 (void)memcpy(buffer, n->fval->val, n->fval->len);
1165 buffer += n->fval->len;
1166 }
1167 }
1168 *buffer = 0;
1169}
1170
1171void tpl_get_section_content(const tpl_t* tpl, char* buffer)
1172{

Callers 5

tpl_get_section_contentFunction · 0.70
tpl_save_asFunction · 0.70
tpl_writeFunction · 0.70
tpl_http_writeFunction · 0.70
tpl_outFunction · 0.70

Calls 1

memcpyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…