From 78cb0de69c1dc8154a3893471978bc49943691eb Mon Sep 17 00:00:00 2001 From: tg Date: Tue, 15 Aug 2006 23:56:32 +0000 Subject: [PATCH] shuffle code around for better structure --- histrap.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/histrap.c b/histrap.c index f85055e..c9205f3 100644 --- a/histrap.c +++ b/histrap.c @@ -3,15 +3,30 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.23 2006/08/15 23:45:53 tg Exp $"); - -static int histfd; -static int hsize; +__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.24 2006/08/15 23:56:32 tg Exp $"); #if defined(__sun__) #define NO_HISTORY #endif +#ifndef mksh_siglist +#if defined(BSD) || defined(__APPLE__) +#define mksh_signame(x) sys_signame[(x)] +#define mksh_siglist(x) sys_siglist[(x)] +#elif defined(__INTERIX) +#define mksh_signame(x) _sys_signame[(x)] +#define mksh_siglist(x) _sys_siglist[(x)] +#elif defined(__gnu_linux__) || defined(__sun__) || defined(__CYGWIN__) +#define NEED_MKSH_SIGNAME /* sync the list above with Build.sh */ +#define mksh_siglist(x) strsignal(x) +#else +# error "Define sys_sig{name,list} for this platform!" +#endif +#endif /* ndef mksh_siglist */ + +Trap sigtraps[NSIG + 1]; +static struct sigaction Sigact_ign, Sigact_trap; + #ifdef NO_HISTORY static int hist_count_lines(unsigned char *, int); static int hist_shrink(unsigned char *, int); @@ -33,24 +48,8 @@ static char *hname; /* current name of history file */ static int hstarted; /* set after hist_init() called */ static Source *hist_source; -#ifndef mksh_siglist -#if defined(BSD) || defined(__APPLE__) -#define mksh_signame(x) sys_signame[(x)] -#define mksh_siglist(x) sys_siglist[(x)] -#elif defined(__INTERIX) -#define mksh_signame(x) _sys_signame[(x)] -#define mksh_siglist(x) _sys_siglist[(x)] -#elif defined(__gnu_linux__) || defined(__sun__) || defined(__CYGWIN__) -#define NEED_MKSH_SIGNAME /* sync the list above with Build.sh */ -#define mksh_siglist(x) strsignal(x) -#else -# error "Define sys_sig{name,list} for this platform!" -#endif -#endif /* ndef mksh_siglist */ - -Trap sigtraps[NSIG + 1]; - -static struct sigaction Sigact_ign, Sigact_trap; +static int histfd; +static int hsize; int c_fc(char **wp)