summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-10-05 23:32:16 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-10-05 23:32:16 +0000
commitb72daf00698c44b8d902f7da7813cc890258fa88 (patch)
tree33732494b641245c2ef3bd8e07ddd3d3ba68df58
parent784d47042dc86484369a8c40ff75751e8d4f57ab (diff)
Remove EXTERN from lex.h and put the definitions in lex.c, from Michael
McConville.
-rw-r--r--bin/ksh/lex.c11
-rw-r--r--bin/ksh/lex.h17
2 files changed, 19 insertions, 9 deletions
diff --git a/bin/ksh/lex.c b/bin/ksh/lex.c
index ce833b7ff83..d6cfa5d5f51 100644
--- a/bin/ksh/lex.c
+++ b/bin/ksh/lex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.c,v 1.56 2015/09/30 14:33:41 tedu Exp $ */
+/* $OpenBSD: lex.c,v 1.57 2015/10/05 23:32:15 nicm Exp $ */
/*
* lexical analysis and source input
@@ -70,6 +70,15 @@ int promptlen(const char *cp, const char **spp);
static int backslash_skip;
static int ignore_backslash_newline;
+Source *source; /* yyparse/yylex source */
+YYSTYPE yylval; /* result from yylex */
+struct ioword *heres[HERES], **herep;
+char ident[IDENT+1];
+
+char **history; /* saved commands */
+char **histptr; /* last history item */
+int histsize; /* history size */
+
/* optimized getsc_bn() */
#define getsc() (*source->str != '\0' && *source->str != '\\' \
&& !backslash_skip ? *source->str++ : getsc_bn())
diff --git a/bin/ksh/lex.h b/bin/ksh/lex.h
index 12d76769e46..114ea70bf8d 100644
--- a/bin/ksh/lex.h
+++ b/bin/ksh/lex.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.h,v 1.13 2013/03/03 19:11:34 guenther Exp $ */
+/* $OpenBSD: lex.h,v 1.14 2015/10/05 23:32:15 nicm Exp $ */
/*
* Source input, lexer and parser
@@ -118,15 +118,16 @@ typedef union {
#define HERES 10 /* max << in line */
-EXTERN Source *source; /* yyparse/yylex source */
-EXTERN YYSTYPE yylval; /* result from yylex */
-EXTERN struct ioword *heres [HERES], **herep;
-EXTERN char ident [IDENT+1];
+extern Source *source; /* yyparse/yylex source */
+extern YYSTYPE yylval; /* result from yylex */
+extern struct ioword *heres[HERES], **herep;
+extern char ident[IDENT+1];
#ifdef HISTORY
# define HISTORYSIZE 500 /* size of saved history */
-EXTERN char **history; /* saved commands */
-EXTERN char **histptr; /* last history item */
-EXTERN int histsize; /* history size */
+extern char **history; /* saved commands */
+extern char **histptr; /* last history item */
+extern int histsize; /* history size */
+
#endif /* HISTORY */