* move _all_ #include stuff into sh.h

* sort out #include stuff which isn't necessary on MirOS into compat.h
This commit is contained in:
tg 2005-10-25 19:53:29 +00:00
parent 91303fe9d1
commit 9b97d72d5e
13 changed files with 37 additions and 69 deletions

8
edit.c
View File

@ -1,16 +1,12 @@
/** $MirOS: src/bin/mksh/edit.c,v 1.15 2005/10/07 18:34:18 tg Exp $ */
/** $MirOS: src/bin/mksh/edit.c,v 1.16 2005/10/25 19:53:26 tg Exp $ */
/* $OpenBSD: edit.c,v 1.30 2005/09/11 18:08:47 otto Exp $ */
/* $OpenBSD: edit.h,v 1.8 2005/03/28 21:28:22 deraadt Exp $ */
/* $OpenBSD: emacs.c,v 1.39 2005/09/26 19:25:22 otto Exp $ */
/* $OpenBSD: vi.c,v 1.21 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h"
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <ctype.h>
#include <libgen.h>
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.15 2005/10/07 18:34:18 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.16 2005/10/25 19:53:26 tg Exp $");
/* tty driver characters we are interested in */
typedef struct {

7
eval.c
View File

@ -1,12 +1,9 @@
/** $MirOS: src/bin/mksh/eval.c,v 1.7 2005/07/12 13:30:38 tg Exp $ */
/** $MirOS: src/bin/mksh/eval.c,v 1.8 2005/10/25 19:53:27 tg Exp $ */
/* $OpenBSD: eval.c,v 1.27 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h"
#include <sys/stat.h>
#include <dirent.h>
#include <pwd.h>
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.7 2005/07/12 13:30:38 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.8 2005/10/25 19:53:27 tg Exp $");
/*
* string expansion

6
exec.c
View File

@ -1,11 +1,9 @@
/** $MirOS: src/bin/mksh/exec.c,v 1.9 2005/10/08 19:30:58 tg Exp $ */
/** $MirOS: src/bin/mksh/exec.c,v 1.10 2005/10/25 19:53:27 tg Exp $ */
/* $OpenBSD: exec.c,v 1.41 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h"
#include <sys/stat.h>
#include <ctype.h>
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.9 2005/10/08 19:30:58 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.10 2005/10/25 19:53:27 tg Exp $");
static int comexec(struct op *, struct tbl *volatile, char **,
int volatile);

5
expr.c
View File

@ -1,10 +1,9 @@
/** $MirOS: src/bin/mksh/expr.c,v 1.1 2005/05/23 03:06:07 tg Exp $ */
/** $MirOS: src/bin/mksh/expr.c,v 1.2 2005/10/25 19:53:27 tg Exp $ */
/* $OpenBSD: expr.c,v 1.18 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h"
#include <ctype.h>
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.1 2005/05/23 03:06:07 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.2 2005/10/25 19:53:27 tg Exp $");
/* The order of these enums is constrained by the order of opinfo[] */
enum token {

14
funcs.c
View File

@ -1,22 +1,12 @@
/** $MirOS: src/bin/mksh/funcs.c,v 1.22 2005/10/25 19:35:14 tg Exp $ */
/** $MirOS: src/bin/mksh/funcs.c,v 1.23 2005/10/25 19:53:27 tg Exp $ */
/* $OpenBSD: c_ksh.c,v 1.27 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: c_sh.c,v 1.31 2005/10/08 18:07:31 otto Exp $ */
/* $OpenBSD: c_test.c,v 1.17 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: c_ulimit.c,v 1.14 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h"
#include <sys/time.h>
#if defined(__sun__)
#include <sys/mkdev.h>
#endif
#include <sys/stat.h>
#include <sys/resource.h>
#include <ctype.h>
#if !defined(__OpenBSD__) && !defined(__CYGWIN__)
#include <ulimit.h>
#endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.22 2005/10/25 19:35:14 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.23 2005/10/25 19:53:27 tg Exp $");
int
c_cd(char **wp)

View File

@ -1,13 +1,10 @@
/** $MirOS: src/bin/mksh/histrap.c,v 1.11 2005/08/02 12:26:17 tg Exp $ */
/** $MirOS: src/bin/mksh/histrap.c,v 1.12 2005/10/25 19:53:28 tg Exp $ */
/* $OpenBSD: history.c,v 1.31 2005/07/31 16:12:52 espie Exp $ */
/* $OpenBSD: trap.c,v 1.22 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h"
#include <sys/file.h>
#include <sys/mman.h>
#include <sys/stat.h>
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.11 2005/08/02 12:26:17 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.12 2005/10/25 19:53:28 tg Exp $");
static int histfd;
static int hsize;

8
jobs.c
View File

@ -1,13 +1,9 @@
/** $MirOS: src/bin/mksh/jobs.c,v 1.4 2005/08/21 12:43:55 bsiegert Exp $ */
/** $MirOS: src/bin/mksh/jobs.c,v 1.5 2005/10/25 19:53:28 tg Exp $ */
/* $OpenBSD: jobs.c,v 1.34 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h"
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/wait.h>
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.4 2005/08/21 12:43:55 bsiegert Exp $");
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.5 2005/10/25 19:53:28 tg Exp $");
/* Order important! */
#define PRUNNING 0

6
lex.c
View File

@ -1,11 +1,9 @@
/** $MirOS: src/bin/mksh/lex.c,v 1.7 2005/07/04 12:47:13 tg Exp $ */
/** $MirOS: src/bin/mksh/lex.c,v 1.8 2005/10/25 19:53:28 tg Exp $ */
/* $OpenBSD: lex.c,v 1.36 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h"
#include <ctype.h>
#include <libgen.h>
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.7 2005/07/04 12:47:13 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.8 2005/10/25 19:53:28 tg Exp $");
/* Structure to keep track of the lexing state and the various pieces of info
* needed for each particular state. */

10
main.c
View File

@ -1,4 +1,4 @@
/** $MirOS: src/bin/mksh/main.c,v 1.28 2005/10/21 12:41:55 tg Exp $ */
/** $MirOS: src/bin/mksh/main.c,v 1.29 2005/10/25 19:53:28 tg Exp $ */
/* $OpenBSD: main.c,v 1.38 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: tty.c,v 1.8 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: io.c,v 1.21 2005/03/30 17:16:37 deraadt Exp $ */
@ -6,14 +6,8 @@
#define EXTERN /* define EXTERNs in sh.h */
#include "sh.h"
#include <sys/stat.h>
#include <ctype.h>
#include <pwd.h>
#if !HAVE_ARC4RANDOM
#include <time.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.28 2005/10/21 12:41:55 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.29 2005/10/25 19:53:28 tg Exp $");
#define MKSH_VERSION "@(#)MIRBSD KSH R24 2005/10/21"

6
misc.c
View File

@ -1,12 +1,10 @@
/** $MirOS: src/bin/mksh/misc.c,v 1.7 2005/07/07 23:27:52 tg Exp $ */
/** $MirOS: src/bin/mksh/misc.c,v 1.8 2005/10/25 19:53:28 tg Exp $ */
/* $OpenBSD: misc.c,v 1.28 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: path.c,v 1.12 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h"
#include <sys/ioctl.h>
#include <sys/stat.h>
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.7 2005/07/07 23:27:52 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.8 2005/10/25 19:53:28 tg Exp $");
short chtypes[UCHAR_MAX+1]; /* type bits for unsigned char */

17
sh.h
View File

@ -1,4 +1,4 @@
/** $MirOS: src/bin/mksh/sh.h,v 1.20 2005/10/25 19:46:11 tg Exp $ */
/** $MirOS: src/bin/mksh/sh.h,v 1.21 2005/10/25 19:53:28 tg Exp $ */
/* $OpenBSD: sh.h,v 1.28 2005/10/04 20:35:11 otto Exp $ */
/* $OpenBSD: shf.h,v 1.5 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: table.h,v 1.6 2004/12/18 20:55:52 millert Exp $ */
@ -23,12 +23,23 @@
#define __RCSID(x) static const char __rcsid[] __attribute__((used)) = (x)
#endif
#include <sys/time.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <libgen.h>
#include <limits.h>
#if !defined(__sun__)
#include <paths.h>
#endif
#include <pwd.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
@ -38,10 +49,8 @@
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>
#if defined(__sun__) || defined(__gnu_linux__)
#include <values.h>
#endif
#if defined(NEED_COMPAT)
#include "compat.h"
#endif

5
shf.c
View File

@ -1,10 +1,9 @@
/** $MirOS: src/bin/mksh/shf.c,v 1.1 2005/05/23 03:06:10 tg Exp $ */
/** $MirOS: src/bin/mksh/shf.c,v 1.2 2005/10/25 19:53:29 tg Exp $ */
/* $OpenBSD: shf.c,v 1.13 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h"
#include <sys/stat.h>
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.1 2005/05/23 03:06:10 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.2 2005/10/25 19:53:29 tg Exp $");
/* flags to shf_emptybuf() */
#define EB_READSW 0x01 /* about to switch to reading */

7
var.c
View File

@ -1,12 +1,9 @@
/** $MirOS: src/bin/mksh/var.c,v 1.9 2005/10/21 11:55:23 tg Exp $ */
/** $MirOS: src/bin/mksh/var.c,v 1.10 2005/10/25 19:53:29 tg Exp $ */
/* $OpenBSD: var.c,v 1.27 2005/10/08 18:02:59 otto Exp $ */
#include "sh.h"
#include <sys/stat.h>
#include <ctype.h>
#include <time.h>
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.9 2005/10/21 11:55:23 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.10 2005/10/25 19:53:29 tg Exp $");
/*
* Variables