-/* $OpenBSD: main.c,v 1.70 2015/10/21 14:30:43 mmcc Exp $ */
+/* $OpenBSD: main.c,v 1.71 2015/10/22 15:37:04 mmcc Exp $ */
/*
* startup, main loop, environments and error handling
*/
-#define EXTERN /* define EXTERNs in sh.h */
-
#include <sys/stat.h>
#include <paths.h>
Getopt builtin_opt;
Getopt user_opt;
+struct coproc coproc;
+sigset_t sm_default, sm_sigchld;
+
+char *builtin_argv0;
+int builtin_flag;
+
+char *current_wd;
+int current_wd_size;
+
+#ifdef EDIT
+int x_cols = 80;
+#endif /* EDIT */
+
/*
* shell initialization
*/
-/* $OpenBSD: sh.h,v 1.47 2015/10/21 14:30:43 mmcc Exp $ */
+/* $OpenBSD: sh.h,v 1.48 2015/10/22 15:37:04 mmcc Exp $ */
/*
* Public Domain Bourne/Korn shell
/* end of common headers */
-/* some useful #defines */
-#ifdef EXTERN
-# define I__(i) = i
-#else
-# define I__(i)
-# define EXTERN extern
-# define EXTERN_DEFINED
-#endif
-
#define NELEM(a) (sizeof(a) / sizeof((a)[0]))
#define sizeofN(type, n) (sizeof(type) * (n))
#define BIT(i) (1<<(i)) /* define bit in flag */
int njobs; /* number of live jobs using output pipe */
void *job; /* 0 or job of co-process using input pipe */
};
-EXTERN struct coproc coproc;
+extern struct coproc coproc;
/* Used in jobs.c and by coprocess stuff in exec.c */
-EXTERN sigset_t sm_default, sm_sigchld;
+extern sigset_t sm_default, sm_sigchld;
extern const char ksh_version[];
/* name of called builtin function (used by error functions) */
-EXTERN char *builtin_argv0;
-EXTERN int builtin_flag; /* flags of called builtin (SPEC_BI, etc.) */
+extern char *builtin_argv0;
+extern int builtin_flag; /* flags of called builtin (SPEC_BI, etc.) */
/* current working directory, and size of memory allocated for same */
-EXTERN char *current_wd;
-EXTERN int current_wd_size;
+extern char *current_wd;
+extern int current_wd_size;
#ifdef EDIT
/* Minimum required space to work with on a line - if the prompt leaves less
/* Minimum allowed value for x_cols: 2 for prompt, 3 for " < " at end of line
*/
# define MIN_COLS (2 + MIN_EDIT_SPACE + 3)
-EXTERN int x_cols I__(80); /* tty columns */
+extern int x_cols; /* tty columns */
#else
# define x_cols 80 /* for pr_menu(exec.c) */
#endif
#include "expand.h"
#include "lex.h"
#include "proto.h"
-
-/* be sure not to interfere with anyone else's idea about EXTERN */
-#ifdef EXTERN_DEFINED
-# undef EXTERN_DEFINED
-# undef EXTERN
-#endif
-#undef I__