From: Ralph Corderoy Date: Tue, 16 May 2017 09:36:02 +0000 (+0100) Subject: sbr/m_popen.c: Move prototypes from h/prototypes.h to new header. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/3f9555fc48a36599d3f9bd6ac68773338886c0b5?ds=inline;hp=--cc sbr/m_popen.c: Move prototypes from h/prototypes.h to new header. --- 3f9555fc48a36599d3f9bd6ac68773338886c0b5 diff --git a/Makefile.am b/Makefile.am index 6d2488e0..32bcb6e1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -361,6 +361,7 @@ noinst_HEADERS = \ sbr/lock_file.h \ sbr/m_maildir.h \ sbr/m_mktemp.h \ + sbr/m_popen.h \ sbr/m_rand.h \ thirdparty/jsmn/jsmn.h \ uip/mhfree.h \ diff --git a/h/prototypes.h b/h/prototypes.h index c9bac8d8..452e6a16 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -232,22 +232,6 @@ int m_getfld (m_getfld_state_t *, char[NAMESZ], char *, int *, FILE *); int m_gmprot (void); char *m_name (int); -/* - * Create a subprocess and redirect our standard output to it. - * - * Arguments are: - * - * name - Name of process to create - * savestdout - If true, will save the current stdout file descriptor and - * m_pclose() will close it at the appropriate time. - */ -void m_popen(char *name, int savestdout); - -/* - * Wait for the last process opened by m_popen(). - */ -void m_pclose(void); - void m_unknown(m_getfld_state_t *, FILE *); int makedir (const char *); char *message_id (time_t, int); diff --git a/sbr/m_popen.c b/sbr/m_popen.c index 17203de8..1fb0cfb4 100644 --- a/sbr/m_popen.c +++ b/sbr/m_popen.c @@ -8,6 +8,7 @@ #include #include +#include "m_popen.h" static int m_pid = NOTOK; /* Process we're waiting for */ static int sd = NOTOK; /* Original standard output */ diff --git a/sbr/m_popen.h b/sbr/m_popen.h new file mode 100644 index 00000000..09d8ade7 --- /dev/null +++ b/sbr/m_popen.h @@ -0,0 +1,22 @@ +/* m_popen.h -- redirect standard output to a popen(3)'d process. + * + * 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 subprocess and redirect our standard output to it. + * + * Arguments are: + * + * name - Name of process to create + * savestdout - If true, will save the current stdout file descriptor and + * m_pclose() will close it at the appropriate time. + */ +void m_popen(char *name, int savestdout); + +/* + * Wait for the last process opened by m_popen(). + */ +void m_pclose(void); diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index 3967c634..a4402c56 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -11,6 +11,7 @@ #include #include #include +#include "../sbr/m_popen.h" #include #include diff --git a/uip/mhshow.c b/uip/mhshow.c index cf3940b4..07590911 100644 --- a/uip/mhshow.c +++ b/uip/mhshow.c @@ -17,6 +17,7 @@ #include #include #include "../sbr/m_maildir.h" +#include "../sbr/m_popen.h" #include "mhfree.h" #include "mhshowsbr.h"