MCPcopy Create free account
hub / github.com/OpenPrinting/cups / write_xml_string

Function write_xml_string

scheduler/printers.c:5289–5321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5287 */
5288
5289static void
5290write_xml_string(cups_file_t *fp, /* I - File to write to */
5291 const char *s) /* I - String to write */
5292{
5293 const char *start; /* Start of current sequence */
5294
5295
5296 if (!s)
5297 return;
5298
5299 for (start = s; *s; s ++)
5300 {
5301 if (*s == '&')
5302 {
5303 if (s > start)
5304 cupsFileWrite(fp, start, (size_t)(s - start));
5305
5306 cupsFilePuts(fp, "&");
5307 start = s + 1;
5308 }
5309 else if (*s == '<')
5310 {
5311 if (s > start)
5312 cupsFileWrite(fp, start, (size_t)(s - start));
5313
5314 cupsFilePuts(fp, "&lt;");
5315 start = s + 1;
5316 }
5317 }
5318
5319 if (s > start)
5320 cupsFilePuts(fp, start);
5321}

Callers 1

cupsdWritePrintcapFunction · 0.85

Calls 2

cupsFileWriteFunction · 0.85
cupsFilePutsFunction · 0.85

Tested by

no test coverage detected