summaryrefslogtreecommitdiff
path: root/3rd-party/xfpt/src/literal.c
diff options
context:
space:
mode:
Diffstat (limited to '3rd-party/xfpt/src/literal.c')
-rw-r--r--3rd-party/xfpt/src/literal.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/3rd-party/xfpt/src/literal.c b/3rd-party/xfpt/src/literal.c
new file mode 100644
index 000000000..74b90663f
--- /dev/null
+++ b/3rd-party/xfpt/src/literal.c
@@ -0,0 +1,39 @@
+/*************************************************
+* xfpt - Simple ASCII->Docbook processor *
+*************************************************/
+
+/* Copyright (c) University of Cambridge, 2006 */
+/* Written by Philip Hazel. */
+
+/* This module contains code for processing lines of literal text. */
+
+#include "xfpt.h"
+
+
+
+/*************************************************
+* Process a line of literal text *
+*************************************************/
+
+/* All we need to do is make sure that any & < and > characters are correctly
+escaped.
+
+Argument: the line to be processed
+Returns: nothing
+*/
+
+void
+literal_process(uschar *p)
+{
+while (*p != 0)
+ {
+ int c = *p++;
+ if (c == '&') (void)fprintf(outfile, "&amp;");
+ else if (c == '<') (void)fprintf(outfile, "&lt;");
+ else if (c == '>') (void)fprintf(outfile, "&gt;");
+ else (void)fputc(c, outfile);
+ }
+}
+
+
+/* End of literal.c */