]> diplodocus.org Git - nmh/commitdiff
fmt_new.c: Move interface to own file.
authorRalph Corderoy <ralph@inputplus.co.uk>
Thu, 16 Nov 2017 00:14:35 +0000 (00:14 +0000)
committerRalph Corderoy <ralph@inputplus.co.uk>
Thu, 16 Nov 2017 00:14:35 +0000 (00:14 +0000)
19 files changed:
Makefile.am
h/fmt_scan.h
sbr/fmt_new.c
sbr/fmt_new.h [new file with mode: 0644]
uip/ap.c
uip/comp.c
uip/dp.c
uip/fmtdump.c
uip/fmttest.c
uip/forwsbr.c
uip/inc.c
uip/mhical.c
uip/mhlsbr.c
uip/mhshowsbr.c
uip/rcvdist.c
uip/rcvtty.c
uip/replsbr.c
uip/scan.c
uip/sendsbr.c

index 865b70a..1b7c286 100644 (file)
@@ -387,6 +387,7 @@ noinst_HEADERS = \
     sbr/ext_hook.h \
     sbr/fdcompare.h \
     sbr/fmt_addr.h \
+    sbr/fmt_new.h \
     sbr/fmt_rfc2047.h \
     sbr/folder_addmsg.h \
     sbr/folder_delmsgs.h \
index dc945ef..40ef9c0 100644 (file)
@@ -96,28 +96,6 @@ struct fmt_callbacks {
     void *             trace_context;
 };
 
-/*
- * Create a new format string.  Arguments are:
- *
- * form                - Name of format file.  Will be searched by etcpath(), see that
- *               function for details.
- * format      - The format string to be used if no format file is given
- * default_fs  - The default format string to be used if neither form nor
- *               format is given
- *
- * This function also takes care of processing \ escapes like \n, \t, etc.
- *
- * Returns an allocated format string.
- */
-
-char *new_fs (char *form, char *format, char *default_fs);
-
-/*
- * Free memory allocated by new_fs().  It allocates to a static so
- * no argument is necessary.
- */
-void free_fs(void);
-
 /*
  * Compile a format string into a set of format instructions.  Arguments are:
  *
index c78e62d..2407cc6 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "fmt_new.h"
 #include "getcpy.h"
 #include "error.h"
 #include "h/utils.h"
diff --git a/sbr/fmt_new.h b/sbr/fmt_new.h
new file mode 100644 (file)
index 0000000..0860365
--- /dev/null
@@ -0,0 +1,26 @@
+/* fmt_new.h -- read format file/string and normalize
+ *
+ * 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. */
+
+/*
+ * Create a new format string.  Arguments are:
+ *
+ * form                - Name of format file.  Will be searched by etcpath(), see that
+ *               function for details.
+ * format      - The format string to be used if no format file is given
+ * default_fs  - The default format string to be used if neither form nor
+ *               format is given
+ *
+ * This function also takes care of processing \ escapes like \n, \t, etc.
+ *
+ * Returns an allocated format string.
+ */
+char *new_fs(char *, char *, char *);
+
+/*
+ * Free memory allocated by new_fs().  It allocates to a static so
+ * no argument is necessary.
+ */
+void free_fs(void);
index 83295af..8be42a0 100644 (file)
--- a/uip/ap.c
+++ b/uip/ap.c
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "sbr/getarguments.h"
 #include "sbr/smatch.h"
 #include "sbr/getcpy.h"
index 759d005..00aa1c2 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "whatnowproc.h"
 #include "sbr/m_name.h"
 #include "sbr/m_gmprot.h"
index 00edef0..7b6ad83 100644 (file)
--- a/uip/dp.c
+++ b/uip/dp.c
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "sbr/getarguments.h"
 #include "sbr/smatch.h"
 #include "sbr/context_save.h"
index 9f1f162..b5a4660 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "scansbr.h"
 #include "sbr/getarguments.h"
 #include "sbr/smatch.h"
index 72f60f9..db16ae7 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "scansbr.h"
 #include "sbr/m_name.h"
 #include "sbr/m_getfld.h"
index 005bc9c..2cdfb30 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "sbr/dtime.h"
 #include "sbr/m_getfld.h"
 #include "sbr/getcpy.h"
index 7484d34..0344307 100644 (file)
--- a/uip/inc.c
+++ b/uip/inc.c
@@ -31,6 +31,7 @@
 #endif
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "sbr/dtime.h"
 #include "scansbr.h"
 #include "sbr/m_name.h"
index 9618b2b..8025c02 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "sbr/getarguments.h"
 #include "sbr/concat.h"
 #include "sbr/smatch.h"
index 9af4b8e..86bae54 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "mhlsbr.h"
 #include "sbr/m_getfld.h"
 #include "sbr/getarguments.h"
index 909506e..fccf3c1 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "sbr/concat.h"
 #include "sbr/trimcpy.h"
 #include "sbr/check_charset.h"
index c8a1d95..f065ad1 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "distsbr.h"
 #include "sbr/m_gmprot.h"
 #include "sbr/m_getfld.h"
index 90994bf..4098d70 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "scansbr.h"
 #include "sbr/getarguments.h"
 #include "sbr/smatch.h"
index a76444b..55bcd6c 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "sbr/m_name.h"
 #include "sbr/m_gmprot.h"
 #include "sbr/m_getfld.h"
index 8a2e8dc..b682ddd 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "sbr/dtime.h"
 #include "scansbr.h"
 #include "sbr/m_name.h"
index a044a62..f369f08 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/fmt_new.h"
 #include "sendsbr.h"
 #include "distsbr.h"
 #include "annosbr.h"