From 778289f2fe80977216f3167bf6beb9fa0c42bff5 Mon Sep 17 00:00:00 2001 From: mmcc Date: Wed, 21 Oct 2015 14:30:43 +0000 Subject: [PATCH] Penultimate commit to remove EXTERN. ok nicm@ --- bin/ksh/main.c | 20 +++++++++++++++++++- bin/ksh/sh.h | 24 ++++++++++++------------ 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/bin/ksh/main.c b/bin/ksh/main.c index c495256255c..998eee3d9e4 100644 --- a/bin/ksh/main.c +++ b/bin/ksh/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.69 2015/10/19 14:42:16 mmcc Exp $ */ +/* $OpenBSD: main.c,v 1.70 2015/10/21 14:30:43 mmcc Exp $ */ /* * startup, main loop, environments and error handling @@ -39,6 +39,24 @@ struct env *e; char shell_flags[FNFLAGS]; +char null[] = ""; + +int shl_stdout_ok; + +unsigned int ksh_tmout; +enum tmout_enum ksh_tmout_state = TMOUT_EXECUTING; + +int really_exit; + +int ifs0 = ' '; + +volatile sig_atomic_t trap; +volatile sig_atomic_t intrsig; +volatile sig_atomic_t fatal_trap; + +Getopt builtin_opt; +Getopt user_opt; + /* * shell initialization */ diff --git a/bin/ksh/sh.h b/bin/ksh/sh.h index d7681607ead..80c9b6fcf46 100644 --- a/bin/ksh/sh.h +++ b/bin/ksh/sh.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sh.h,v 1.46 2015/10/19 17:15:53 mmcc Exp $ */ +/* $OpenBSD: sh.h,v 1.47 2015/10/21 14:30:43 mmcc Exp $ */ /* * Public Domain Bourne/Korn shell @@ -203,7 +203,7 @@ enum sh_flag { extern char shell_flags[FNFLAGS]; -EXTERN char null [] I__(""); /* null value for variable */ +extern char null[]; /* null value for variable */ enum temp_type { TT_HEREDOC_EXP, /* expanded heredoc */ @@ -226,7 +226,7 @@ struct temp { #define shl_spare (&shf_iob[0]) /* for c_read()/c_print() */ #define shl_stdout (&shf_iob[1]) #define shl_out (&shf_iob[2]) -EXTERN int shl_stdout_ok; +extern int shl_stdout_ok; /* * trap handlers @@ -267,9 +267,9 @@ typedef struct trap { #define SIGEXIT_ 0 /* for trap EXIT */ #define SIGERR_ NSIG /* for trap ERR */ -EXTERN volatile sig_atomic_t trap; /* traps pending? */ -EXTERN volatile sig_atomic_t intrsig; /* pending trap interrupts command */ -EXTERN volatile sig_atomic_t fatal_trap;/* received a fatal signal */ +extern volatile sig_atomic_t trap; /* traps pending? */ +extern volatile sig_atomic_t intrsig; /* pending trap interrupts command */ +extern volatile sig_atomic_t fatal_trap; /* received a fatal signal */ extern volatile sig_atomic_t got_sigwinch; extern Trap sigtraps[NSIG+1]; @@ -282,11 +282,11 @@ enum tmout_enum { TMOUT_READING, /* waiting for input */ TMOUT_LEAVING /* have timed out */ }; -EXTERN unsigned int ksh_tmout; -EXTERN enum tmout_enum ksh_tmout_state I__(TMOUT_EXECUTING); +extern unsigned int ksh_tmout; +extern enum tmout_enum ksh_tmout_state; /* For "You have stopped jobs" message */ -EXTERN int really_exit; +extern int really_exit; /* * fast character classes @@ -308,7 +308,7 @@ extern short ctypes []; #define digit(c) ctype(c, C_DIGIT) #define letnum(c) ctype(c, C_ALPHA|C_DIGIT) -EXTERN int ifs0 I__(' '); /* for "$*" */ +extern int ifs0; /* for "$*" */ /* Argument parsing for built-in commands and getopts command */ @@ -332,8 +332,8 @@ typedef struct { char buf[2]; /* for bad option OPTARG value */ } Getopt; -EXTERN Getopt builtin_opt; /* for shell builtin commands */ -EXTERN Getopt user_opt; /* parsing state for getopts builtin command */ +extern Getopt builtin_opt; /* for shell builtin commands */ +extern Getopt user_opt; /* parsing state for getopts builtin command */ /* This for co-processes */ -- 2.20.1