summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwlemb <wlemb>2003-11-20 15:21:05 +0000
committerwlemb <wlemb>2003-11-20 15:21:05 +0000
commit08a6464316954c18cf07ced3f3fb58c7c01764df (patch)
tree65fff9637c6a592109dbe35cc16cfd93719323ef
parentd26bf8fbb90b789607b02b46102996e8f87e45fd (diff)
downloadgroff-08a6464316954c18cf07ced3f3fb58c7c01764df.tar.gz
* src/roff/groff/pipeline.c (P): Removed. Updated all function
declarations. (i_to_a): Removed. libgroff already provides this function. (run_pipeline) [_WIN32]: Don't use itoa but i_to_a.
-rw-r--r--ChangeLog7
-rw-r--r--src/roff/groff/pipeline.c58
2 files changed, 23 insertions, 42 deletions
diff --git a/ChangeLog b/ChangeLog
index 186cff00..6fdc4e63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-11-19 Werner LEMBERG <wl@gnu.org>
+
+ * src/roff/groff/pipeline.c (P): Removed. Updated all function
+ declarations.
+ (i_to_a): Removed. libgroff already provides this function.
+ (run_pipeline) [_WIN32]: Don't use itoa but i_to_a.
+
2003-11-18 Keith Marshall <keith.d.marshall@ntlworld.com>
* src/roff/groff/pipeline.c (xstrsignal): Fix usage of
diff --git a/src/roff/groff/pipeline.c b/src/roff/groff/pipeline.c
index cb35a80f..f8804d11 100644
--- a/src/roff/groff/pipeline.c
+++ b/src/roff/groff/pipeline.c
@@ -39,7 +39,6 @@ extern char *strerror();
#ifdef _POSIX_VERSION
#include <sys/wait.h>
-
#define PID_T pid_t
#else /* not _POSIX_VERSION */
@@ -78,22 +77,13 @@ extern char *strerror();
#include "pipeline.h"
-#ifdef __STDC__
-#define P(parms) parms
-#else
-#define P(parms) ()
-#ifndef _WIN32
-#define const /* as nothing */
-#endif
-#endif
-
#define error c_error
-extern void error P((const char *, const char *, const char *, const char *));
-extern void c_fatal P((const char *, const char *, const char *, const char *));
+extern void error(const char *, const char *, const char *, const char *);
+extern void c_fatal(const char *, const char *, const char *, const char *);
-static void sys_fatal P((const char *));
-static const char *xstrsignal P((int));
-static char *i_to_a P((int));
+static void sys_fatal(const char *);
+static const char *xstrsignal(int);
+const char *i_to_a(int); // from libgroff
/* MSVC can support asynchronous processes, but it's unlikely to have
fork(). So, until someone writes an emulation, let them at least
@@ -123,8 +113,7 @@ static RETSIGTYPE signal_catcher(int signo)
static const char *sh = "sh";
static const char *command = "command";
-const char *
-system_shell_name(void)
+const char *system_shell_name(void)
{
static const char *shell_name;
@@ -142,8 +131,7 @@ system_shell_name(void)
return shell_name;
}
-const char *
-system_shell_dash_c(void)
+const char *system_shell_dash_c(void)
{
if (strcmp(system_shell_name(), sh) == 0)
return "-c";
@@ -151,8 +139,7 @@ system_shell_dash_c(void)
return "/c";
}
-int
-is_system_shell(const char *shell)
+int is_system_shell(const char *shell)
{
size_t shlen;
size_t ibase = 0, idot, i;
@@ -181,8 +168,7 @@ is_system_shell(const char *shell)
/* Windows 32 doesn't have fork() */
-int
-run_pipeline(int ncommands, char ***commands, int no_pipe)
+int run_pipeline(int ncommands, char ***commands, int no_pipe)
{
int save_stdin, save_stdout;
int i;
@@ -290,22 +276,21 @@ run_pipeline(int ncommands, char ***commands, int no_pipe)
ret |= 1;
}
else
- error("unexpected status %1", itoa(status), (char *)0, (char *)0);
+ error("unexpected status %1", i_to_a(status), (char *)0, (char *)0);
break;
}
}
return ret;
}
-#else /* _WIN32 */
+#else /* not _WIN32 */
/* MSDOS doesn't have `fork', so we need to simulate the pipe by running
the programs in sequence with standard streams redirected fot and
from temporary files.
*/
-int
-run_pipeline(int ncommands, char ***commands, int no_pipe)
+int run_pipeline(int ncommands, char ***commands, int no_pipe)
{
int save_stdin = dup(0);
int save_stdout = dup(1);
@@ -389,12 +374,11 @@ run_pipeline(int ncommands, char ***commands, int no_pipe)
return ret;
}
-#endif /* MS-DOS */
+#endif /* not _WIN32 */
#else /* not __MSDOS__, not _WIN32 */
-int
-run_pipeline(int ncommands, char ***commands, int no_pipe)
+int run_pipeline(int ncommands, char ***commands, int no_pipe)
{
int i;
int last_input = 0;
@@ -509,22 +493,12 @@ run_pipeline(int ncommands, char ***commands, int no_pipe)
#endif /* not __MSDOS__, not _WIN32 */
-static void
-sys_fatal(const char *s)
+static void sys_fatal(const char *s)
{
c_fatal("%1: %2", s, strerror(errno), (char *)0);
}
-static char *
-i_to_a(int n)
-{
- static char buf[12];
- sprintf(buf, "%d", n);
- return buf;
-}
-
-static const char *
-xstrsignal(int n)
+static const char *xstrsignal(int n)
{
static char buf[sizeof("Signal ") + 1 + sizeof(int) * 3];