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

Function tpl_save_as

app/wizard/tpllib.cpp:1176–1201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1174}
1175
1176int tpl_save_as(const tpl_t* tpl, const char* filename)
1177{
1178 FILE *fp = fopen(filename, "wb");
1179
1180 if (fp != NULL)
1181 {
1182 int len = tpl_length(tpl);
1183 int n;
1184 char *content = (char *)acl_mymalloc(len + 1);
1185
1186 tpl_get_content(tpl, content);
1187
1188 n = (int) fwrite(content, len, 1, fp);
1189 if (n != 1)
1190 {
1191 (void)fclose(fp);
1192 acl_myfree(content);
1193 return TPL_WRITE_ERROR;
1194 }
1195 (void)fclose(fp);
1196
1197 acl_myfree(content);
1198 return TPL_OK;
1199 }
1200 return TPL_OPEN_ERROR;
1201}
1202
1203#ifdef WIN32
1204#define write _write

Callers 2

create_http_servletFunction · 0.70
copy_and_replaceMethod · 0.70

Calls 2

tpl_lengthFunction · 0.70
tpl_get_contentFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…