]> diplodocus.org Git - nmh/commitdiff
getcpy.c: Move interface to own file.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sat, 11 Nov 2017 16:12:02 +0000 (16:12 +0000)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 12 Nov 2017 12:25:30 +0000 (12:25 +0000)
31 files changed:
Makefile.am
h/prototypes.h
sbr/addrsbr.c
sbr/context_replace.c
sbr/fmt_compile.c
sbr/fmt_new.c
sbr/getcpy.c
sbr/getcpy.h [new file with mode: 0644]
sbr/netsec.c
sbr/oauth.c
sbr/oauth_prof.c
sbr/readconfig.c
sbr/refile.c
sbr/seq_read.c
uip/ali.c
uip/aliasbr.c
uip/ap.c
uip/fmttest.c
uip/folder.c
uip/forwsbr.c
uip/imaptest.c
uip/mhbuildsbr.c
uip/mhlsbr.c
uip/mhparse.c
uip/mhshowsbr.c
uip/mhstoresbr.c
uip/new.c
uip/scansbr.c
uip/sendsbr.c
uip/slocal.c
uip/whatnowsbr.c

index a467d25..54d342b 100644 (file)
@@ -384,6 +384,7 @@ noinst_HEADERS = \
     sbr/folder_pack.h \
     sbr/folder_read.h \
     sbr/folder_realloc.h \
+    sbr/getcpy.h \
     sbr/geteditor.h \
     sbr/getfolder.h \
     sbr/lock_file.h \
index f12bf37..c0a12b5 100644 (file)
@@ -110,9 +110,6 @@ char **getarguments (char *, int, char **, int);
  */
 char *get_charset(void);
 
-/* Return malloc'd copy of str, or of "" if NULL, exit on failure. */
-char *getcpy(const char *str);
-
 m_getfld_state_t m_getfld_state_init(FILE *iob);
 void m_getfld_state_reset (m_getfld_state_t *);
 void m_getfld_state_destroy (m_getfld_state_t *);
index 7f961c4..62abfb9 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "getcpy.h"
 #include "context_find.h"
 #include "error.h"
 #include "h/addrsbr.h"
index 96ce05e..eccb472 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "getcpy.h"
 #include "context_replace.h"
 #include "error.h"
 #include "h/utils.h"
index 27af937..e8a8027 100644 (file)
@@ -40,6 +40,7 @@
  */
 
 #include "h/mh.h"
+#include "getcpy.h"
 #include "error.h"
 #include "h/addrsbr.h"
 #include "h/tws.h"
index 97e2a7a..c78e62d 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "getcpy.h"
 #include "error.h"
 #include "h/utils.h"
 
index 7182c7c..42779e0 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include "h/mh.h"
+#include "getcpy.h"
 #include "h/utils.h"
 
 /* Return malloc'd copy of str, or of "" if NULL, exit on failure. */
diff --git a/sbr/getcpy.h b/sbr/getcpy.h
new file mode 100644 (file)
index 0000000..c98146e
--- /dev/null
@@ -0,0 +1,12 @@
+/* getcpy.h -- copy a string in managed memory
+ *
+ * THIS IS OBSOLETE.  NEED TO REPLACE ALL OCCURRENCES
+ * OF GETCPY WITH STRDUP.  BUT THIS WILL REQUIRE
+ * CHANGING PARTS OF THE CODE TO DEAL WITH NULL VALUES.
+ *
+ * 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. */
+
+/* Return malloc'd copy of str, or of "" if NULL, exit on failure. */
+char *getcpy(const char *str);
index 6a72495..98a221a 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include "h/mh.h"
+#include "getcpy.h"
 #include "brkstring.h"
 #include "h/utils.h"
 #include "h/netsec.h"
index 718a688..8061c28 100755 (executable)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "getcpy.h"
 #include "error.h"
 
 #ifdef OAUTH_SUPPORT
index 5bedadc..4d91b8b 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "getcpy.h"
 #include "context_find.h"
 
 #ifdef OAUTH_SUPPORT
index c744a3e..2df4c8e 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include "h/mh.h"
+#include "getcpy.h"
 #include "readconfig.h"
 #include "error.h"
 #include "h/utils.h"
index 15f016d..de6bd92 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include "h/mh.h"
+#include "getcpy.h"
 #include "context_save.h"
 #include "arglist.h"
 #include "error.h"
index c4f11a6..1670aac 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include "h/mh.h"
+#include "getcpy.h"
 #include "m_atoi.h"
 #include "brkstring.h"
 #include "error.h"
index d7ce492..229831b 100644 (file)
--- a/uip/ali.c
+++ b/uip/ali.c
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/context_find.h"
 #include "sbr/brkstring.h"
 #include "sbr/ambigsw.h"
index 754a4d1..b5935f6 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "h/aliasbr.h"
 #include "h/addrsbr.h"
 #include "h/utils.h"
index fa2b871..b9a49cd 100644 (file)
--- a/uip/ap.c
+++ b/uip/ap.c
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/ambigsw.h"
 #include "sbr/print_version.h"
 #include "sbr/print_help.h"
index 4613794..8d5423f 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/m_convert.h"
 #include "sbr/getfolder.h"
 #include "sbr/folder_read.h"
index 2b231bb..9800607 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/m_convert.h"
 #include "sbr/getfolder.h"
 #include "sbr/folder_read.h"
index 6978d18..7e86244 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/error.h"
 #include <fcntl.h>
 #include "h/fmt_scan.h"
index 6c5d004..7a119cd 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/brkstring.h"
 #include "sbr/ambigsw.h"
 #include "sbr/print_version.h"
index 9730e60..309f298 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/m_convert.h"
 #include "sbr/getfolder.h"
 #include "sbr/folder_read.h"
index 8224980..b35d366 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/brkstring.h"
 #include "sbr/ambigsw.h"
 #include "sbr/pidstatus.h"
index 9b8eb97..efa47fa 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/context_find.h"
 #include "sbr/pidstatus.h"
 #include "sbr/arglist.h"
index 7716de4..92c2097 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/context_find.h"
 #include "sbr/pidstatus.h"
 #include "sbr/arglist.h"
index f2164e3..a48d4b6 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/getfolder.h"
 #include "sbr/folder_read.h"
 #include "sbr/folder_free.h"
index 5de05d4..2d7c070 100644 (file)
--- a/uip/new.c
+++ b/uip/new.c
@@ -12,6 +12,7 @@
 #include <sys/types.h>
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/m_atoi.h"
 #include "sbr/context_save.h"
 #include "sbr/context_replace.h"
index b82c3c5..e7cad88 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/error.h"
 #include "h/addrsbr.h"
 #include "h/fmt_scan.h"
index 8bb04fa..ec7b441 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/m_convert.h"
 #include "sbr/m_backup.h"
 #include "sbr/folder_read.h"
index 9f784f8..6cace00 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/ambigsw.h"
 #include "sbr/pidstatus.h"
 #include "sbr/print_version.h"
index c4549f1..f405721 100644 (file)
@@ -38,6 +38,7 @@
  */
 
 #include "h/mh.h"
+#include "sbr/getcpy.h"
 #include "sbr/m_draft.h"
 #include "sbr/m_backup.h"
 #include "sbr/geteditor.h"