]> diplodocus.org Git - nmh/commitdiff
sbr/unquote.c: Move prototype from h/prototypes.h to new header.
authorRalph Corderoy <ralph@inputplus.co.uk>
Tue, 16 May 2017 10:21:50 +0000 (11:21 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Tue, 16 May 2017 10:21:50 +0000 (11:21 +0100)
Makefile.am
h/prototypes.h
sbr/datetime.c
sbr/encode_rfc2047.c
sbr/fmt_scan.c
sbr/unquote.c
sbr/unquote.h [new file with mode: 0644]

index 53eb99e7cda499aed81a50879f2f6a41c6ce7b87..5ac9ea545a668aec614d6ef695e0eb5303e6808f 100644 (file)
@@ -366,6 +366,7 @@ noinst_HEADERS = \
     sbr/makedir.h \
     sbr/message_id.h \
     sbr/mime_type.h \
+    sbr/unquote.h \
     thirdparty/jsmn/jsmn.h \
     uip/mhfree.h \
     uip/mhoutsbr.h \
index 9a2b41a426bb6a5dcf46e2418f35f6160b677134..97c6cc13891a0d8a7b6ae6ae1a75ef49ca81406a 100644 (file)
@@ -345,22 +345,6 @@ int ssequal (const char *, const char *);
 int stringdex (char *, char *);
 char *trimcpy (char *);
 
-/*
- * Remove quotes and quoted-pair sequences from RFC-5322 atoms.
- *
- * Currently the actual algorithm is simpler than it technically should
- * be: any quotes are simply eaten, unless they're preceded by the escape
- * character (\).  This seems to be sufficient for our needs for now.
- *
- * Arguments:
- *
- * input       - The input string
- * output      - The output string; is assumed to have at least as much
- *               room as the input string.  At worst the output string will
- *               be the same size as the input string; it might be smaller.
- *
- */
-void unquote_string(const char *input, char *output);
 int uprf (const char *, const char *);
 int vfgets (FILE *, char **);
 
index a3e0e7a39515861c27ec99ea041523e73ccc769b..a5f6c77b02bd02eed1197afd05dd831650551100 100644 (file)
@@ -10,6 +10,7 @@
 #include <h/fmt_scan.h>
 #include "h/tws.h"
 #include "h/utils.h"
+#include "unquote.h"
 
 /*
  * This doesn't try to support all of the myriad date-time formats
index 238882dc2cbd6998c1499260593a819632cb6239..75b5808f26313bfee356889c074522ce1c655349 100644 (file)
@@ -9,6 +9,7 @@
 #include <h/mhparse.h>
 #include <h/addrsbr.h>
 #include <h/utils.h>
+#include "unquote.h"
 
 /*
  * List of headers that contain addresses and as a result require special
index 39d549a5911e8c38eb877684cee1aa2a9bb6d121..c75db3ec95fb0c6953dad86efd7d9e259b667e74 100644 (file)
@@ -14,6 +14,7 @@
 #include <h/tws.h>
 #include <h/fmt_compile.h>
 #include <h/utils.h>
+#include "unquote.h"
 
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
index b20c829cb9f8e6e4002901f7400f01e148dfdc27..b6411e11257ab01d5b598910a309ad11603120cb 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <h/mh.h>
+#include "unquote.h"
 
 /*
  * Remove quotes (and handle escape strings) from RFC 5322 quoted-strings.
diff --git a/sbr/unquote.h b/sbr/unquote.h
new file mode 100644 (file)
index 0000000..bd76e8e
--- /dev/null
@@ -0,0 +1,22 @@
+/* unquote.h -- Handle quote removal and quoted-pair strings on
+ * RFC 2822-5322 atoms.
+ *
+ * This code is Copyright (c) 2017, by the authors of nmh.  See the
+ * COPYRIGHT file in the root directory of the nmh distribution for
+ * complete copyright information.
+ */
+
+/* Remove quotes and quoted-pair sequences from RFC-5322 atoms.
+ *
+ * Currently the actual algorithm is simpler than it technically should
+ * be: any quotes are simply eaten, unless they're preceded by the escape
+ * character (\).  This seems to be sufficient for our needs for now.
+ *
+ * Arguments:
+ *
+ * input       - The input string
+ * output      - The output string; is assumed to have at least as much
+ *               room as the input string.  At worst the output string
+ *               will be the same size as the input string; it might be
+ *               smaller. */
+void unquote_string(const char *input, char *output);