MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlSaveCtxtInit

Function xmlSaveCtxtInit

ThirdParty/libxml2/vtklibxml2/xmlsave.c:280–304  ·  view source on GitHub ↗

* * * Allocation and deallocation * * * ************************************************************************/ * xmlSaveCtxtInit: * @ctxt: the saving context * * Initialize a saving context */

Source from the content-addressed store, hash-verified

278 * Initialize a saving context
279 */
280static void
281xmlSaveCtxtInit(xmlSaveCtxtPtr ctxt)
282{
283 int i;
284 int len;
285
286 if (ctxt == NULL) return;
287 if ((ctxt->encoding == NULL) && (ctxt->escape == NULL))
288 ctxt->escape = xmlEscapeEntities;
289 len = xmlStrlen((xmlChar *)xmlTreeIndentString);
290 if ((xmlTreeIndentString == NULL) || (len == 0)) {
291 memset(&ctxt->indent[0], 0, MAX_INDENT + 1);
292 } else {
293 ctxt->indent_size = len;
294 ctxt->indent_nr = MAX_INDENT / ctxt->indent_size;
295 for (i = 0;i < ctxt->indent_nr;i++)
296 memcpy(&ctxt->indent[i * ctxt->indent_size], xmlTreeIndentString,
297 ctxt->indent_size);
298 ctxt->indent[ctxt->indent_nr * ctxt->indent_size] = 0;
299 }
300
301 if (xmlSaveNoEmptyTags) {
302 ctxt->options |= XML_SAVE_NO_EMPTY;
303 }
304}
305
306/**
307 * xmlFreeSaveCtxt:

Callers 7

xmlNewSaveCtxtFunction · 0.85
xmlNodeDumpOutputFunction · 0.85
xmlDocFormatDumpFunction · 0.85
xmlSaveFileToFunction · 0.85
xmlSaveFormatFileToFunction · 0.85
xmlSaveFormatFileEncFunction · 0.85

Calls 1

xmlStrlenFunction · 0.85

Tested by

no test coverage detected