Add '3rd-party/xfpt/' from commit '24eaa721effcf2f56d1da62344ee27ac9721d3ec'
[exim.git] / 3rd-party / xfpt / src / literal.c
1 /*************************************************
2 *     xfpt - Simple ASCII->Docbook processor     *
3 *************************************************/
4
5 /* Copyright (c) University of Cambridge, 2006 */
6 /* Written by Philip Hazel. */
7
8 /* This module contains code for processing lines of literal text. */
9
10 #include "xfpt.h"
11
12
13
14 /*************************************************
15 *         Process a line of literal text         *
16 *************************************************/
17
18 /* All we need to do is make sure that any & < and > characters are correctly
19 escaped.
20
21 Argument:   the line to be processed
22 Returns:    nothing
23 */
24
25 void
26 literal_process(uschar *p)
27 {
28 while (*p != 0)
29   {
30   int c = *p++;
31   if (c == '&')      (void)fprintf(outfile, "&amp;");
32   else if (c == '<') (void)fprintf(outfile, "&lt;");
33   else if (c == '>') (void)fprintf(outfile, "&gt;");
34   else (void)fputc(c, outfile);
35   }
36 }
37
38
39 /* End of literal.c */