shuffle declarations around (all shared between even only two files go into sh.h even if they’re not supposed to be used elsewhere) and make some static; libFirm/cparser has -Wmissing-declarations against it
This commit is contained in:
parent
cf807eb83a
commit
d8a6ce41de
5
lex.c
5
lex.c
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.172 2012/11/30 20:19:12 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.173 2012/12/05 18:54:08 tg Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* states while lexing word
|
* states while lexing word
|
||||||
@ -104,12 +104,9 @@ static Lex_state *push_state_i(State_info *, Lex_state *);
|
|||||||
static Lex_state *pop_state_i(State_info *, Lex_state *);
|
static Lex_state *pop_state_i(State_info *, Lex_state *);
|
||||||
|
|
||||||
static int dopprompt(const char *, int, bool);
|
static int dopprompt(const char *, int, bool);
|
||||||
void yyskiputf8bom(void);
|
|
||||||
|
|
||||||
static int backslash_skip;
|
static int backslash_skip;
|
||||||
static int ignore_backslash_newline;
|
static int ignore_backslash_newline;
|
||||||
struct sretrace_info *retrace_info = NULL;
|
|
||||||
int subshell_nesting_type = 0;
|
|
||||||
|
|
||||||
/* optimised getsc_bn() */
|
/* optimised getsc_bn() */
|
||||||
#define o_getsc() (*source->str != '\0' && *source->str != '\\' && \
|
#define o_getsc() (*source->str != '\0' && *source->str != '\\' && \
|
||||||
|
6
sh.h
6
sh.h
@ -152,7 +152,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXTERN
|
#ifdef EXTERN
|
||||||
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.612 2012/12/04 01:18:32 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.613 2012/12/05 18:54:09 tg Exp $");
|
||||||
#endif
|
#endif
|
||||||
#define MKSH_VERSION "R41 2012/12/03"
|
#define MKSH_VERSION "R41 2012/12/03"
|
||||||
|
|
||||||
@ -651,7 +651,8 @@ enum sh_flag {
|
|||||||
struct sretrace_info;
|
struct sretrace_info;
|
||||||
struct yyrecursive_state;
|
struct yyrecursive_state;
|
||||||
|
|
||||||
extern struct sretrace_info *retrace_info;
|
EXTERN struct sretrace_info *retrace_info E_INIT(NULL);
|
||||||
|
EXTERN int subshell_nesting_type E_INIT(0);
|
||||||
|
|
||||||
extern struct env {
|
extern struct env {
|
||||||
ALLOC_ITEM alloc_INT; /* internal, do not touch */
|
ALLOC_ITEM alloc_INT; /* internal, do not touch */
|
||||||
@ -1797,6 +1798,7 @@ pid_t j_async(void);
|
|||||||
int j_stopped_running(void);
|
int j_stopped_running(void);
|
||||||
/* lex.c */
|
/* lex.c */
|
||||||
int yylex(int);
|
int yylex(int);
|
||||||
|
void yyskiputf8bom(void);
|
||||||
void yyerror(const char *, ...)
|
void yyerror(const char *, ...)
|
||||||
MKSH_A_NORETURN
|
MKSH_A_NORETURN
|
||||||
MKSH_A_FORMAT(__printf__, 1, 2);
|
MKSH_A_FORMAT(__printf__, 1, 2);
|
||||||
|
13
syn.c
13
syn.c
@ -23,10 +23,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.85 2012/11/30 20:19:15 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.86 2012/12/05 18:54:10 tg Exp $");
|
||||||
|
|
||||||
extern int subshell_nesting_type;
|
|
||||||
extern void yyskiputf8bom(void);
|
|
||||||
|
|
||||||
struct nesting_state {
|
struct nesting_state {
|
||||||
int start_token; /* token than began nesting (eg, FOR) */
|
int start_token; /* token than began nesting (eg, FOR) */
|
||||||
@ -771,7 +768,7 @@ block(int type, struct op *t1, struct op *t2, char **wp)
|
|||||||
return (t);
|
return (t);
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct tokeninfo {
|
static const struct tokeninfo {
|
||||||
const char *name;
|
const char *name;
|
||||||
short val;
|
short val;
|
||||||
short reserved;
|
short reserved;
|
||||||
@ -973,9 +970,9 @@ const char *const dbtest_tokens[] = {
|
|||||||
dbtest_or, dbtest_and, dbtest_not,
|
dbtest_or, dbtest_and, dbtest_not,
|
||||||
dbtest_oparen, dbtest_cparen
|
dbtest_oparen, dbtest_cparen
|
||||||
};
|
};
|
||||||
const char db_close[] = { CHAR, ']', CHAR, ']', EOS };
|
static const char db_close[] = { CHAR, ']', CHAR, ']', EOS };
|
||||||
const char db_lthan[] = { CHAR, '<', EOS };
|
static const char db_lthan[] = { CHAR, '<', EOS };
|
||||||
const char db_gthan[] = { CHAR, '>', EOS };
|
static const char db_gthan[] = { CHAR, '>', EOS };
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Test if the current token is a whatever. Accepts the current token if
|
* Test if the current token is a whatever. Accepts the current token if
|
||||||
|
Loading…
x
Reference in New Issue
Block a user