summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-01-22 22:55:11 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-01-22 22:55:11 +0000
commit86f5c9906beac527f3d7966f24811b571a589e08 (patch)
tree1c9eba853c728b5d734506e1c66c269d96fe46ea /shell
parent2edf52643d3eb3d13f26d31f9678cf122f2063bc (diff)
downloadbusybox-w32-86f5c9906beac527f3d7966f24811b571a589e08.tar.gz
busybox-w32-86f5c9906beac527f3d7966f24811b571a589e08.tar.bz2
busybox-w32-86f5c9906beac527f3d7966f24811b571a589e08.zip
- add platform.h.
- use shorter boilerplate while at it.
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c34
-rw-r--r--shell/hush.c16
-rw-r--r--shell/lash.c17
3 files changed, 15 insertions, 52 deletions
diff --git a/shell/ash.c b/shell/ash.c
index db537c44d..ef1fe0af7 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12,19 +12,7 @@
12 * This code is derived from software contributed to Berkeley by 12 * This code is derived from software contributed to Berkeley by
13 * Kenneth Almquist. 13 * Kenneth Almquist.
14 * 14 *
15 * This program is free software; you can redistribute it and/or modify 15 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 * 16 *
29 * Original BSD copyright notice is retained at the end of this file. 17 * Original BSD copyright notice is retained at the end of this file.
30 */ 18 */
@@ -233,11 +221,11 @@ static volatile sig_atomic_t pendingsigs;
233/* EXSIG is turned off by evalbltin(). */ 221/* EXSIG is turned off by evalbltin(). */
234 222
235 223
236static void exraise(int) __attribute__((__noreturn__)); 224static void exraise(int) ATTRIBUTE_NORETURN;
237static void onint(void) __attribute__((__noreturn__)); 225static void onint(void) ATTRIBUTE_NORETURN;
238 226
239static void sh_error(const char *, ...) __attribute__((__noreturn__)); 227static void sh_error(const char *, ...) ATTRIBUTE_NORETURN;
240static void exerror(int, const char *, ...) __attribute__((__noreturn__)); 228static void exerror(int, const char *, ...) ATTRIBUTE_NORETURN;
241 229
242static void sh_warnx(const char *, ...); 230static void sh_warnx(const char *, ...);
243 231
@@ -1400,7 +1388,7 @@ struct cmdentry {
1400static const char *pathopt; /* set by padvance */ 1388static const char *pathopt; /* set by padvance */
1401 1389
1402static void shellexec(char **, const char *, int) 1390static void shellexec(char **, const char *, int)
1403 __attribute__((__noreturn__)); 1391 ATTRIBUTE_NORETURN;
1404static char *padvance(const char **, const char *); 1392static char *padvance(const char **, const char *);
1405static void find_command(char *, struct cmdentry *, int, const char *); 1393static void find_command(char *, struct cmdentry *, int, const char *);
1406static struct builtincmd *find_builtin(const char *); 1394static struct builtincmd *find_builtin(const char *);
@@ -2026,7 +2014,7 @@ static void ignoresig(int);
2026static void onsig(int); 2014static void onsig(int);
2027static int dotrap(void); 2015static int dotrap(void);
2028static void setinteractive(int); 2016static void setinteractive(int);
2029static void exitshell(void) __attribute__((__noreturn__)); 2017static void exitshell(void) ATTRIBUTE_NORETURN;
2030static int decode_signal(const char *, int); 2018static int decode_signal(const char *, int);
2031 2019
2032/* 2020/*
@@ -2504,7 +2492,7 @@ setpwd(const char *val, int setold)
2504 2492
2505 2493
2506static void exverror(int, const char *, va_list) 2494static void exverror(int, const char *, va_list)
2507 __attribute__((__noreturn__)); 2495 ATTRIBUTE_NORETURN;
2508 2496
2509/* 2497/*
2510 * Called to raise an exception. Since C doesn't include exceptions, we 2498 * Called to raise an exception. Since C doesn't include exceptions, we
@@ -4518,7 +4506,7 @@ static size_t esclen(const char *, const char *);
4518static char *scanleft(char *, char *, char *, char *, int, int); 4506static char *scanleft(char *, char *, char *, char *, int, int);
4519static char *scanright(char *, char *, char *, char *, int, int); 4507static char *scanright(char *, char *, char *, char *, int, int);
4520static void varunset(const char *, const char *, const char *, int) 4508static void varunset(const char *, const char *, const char *, int)
4521 __attribute__((__noreturn__)); 4509 ATTRIBUTE_NORETURN;
4522 4510
4523 4511
4524#define pmatch(a, b) !fnmatch((a), (b), 0) 4512#define pmatch(a, b) !fnmatch((a), (b), 0)
@@ -9325,8 +9313,8 @@ static int readtoken(void);
9325static int xxreadtoken(void); 9313static int xxreadtoken(void);
9326static int readtoken1(int firstc, int syntax, char *eofmark, int striptabs); 9314static int readtoken1(int firstc, int syntax, char *eofmark, int striptabs);
9327static int noexpand(char *); 9315static int noexpand(char *);
9328static void synexpect(int) __attribute__((__noreturn__)); 9316static void synexpect(int) ATTRIBUTE_NORETURN;
9329static void synerror(const char *) __attribute__((__noreturn__)); 9317static void synerror(const char *) ATTRIBUTE_NORETURN;
9330static void setprompt(int); 9318static void setprompt(int);
9331 9319
9332 9320
diff --git a/shell/hush.c b/shell/hush.c
index e83d49a86..70533a2b0 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -75,19 +75,7 @@
75 * maybe change map[] to use 2-bit entries 75 * maybe change map[] to use 2-bit entries
76 * (eventually) remove all the printf's 76 * (eventually) remove all the printf's
77 * 77 *
78 * This program is free software; you can redistribute it and/or modify 78 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
79 * it under the terms of the GNU General Public License as published by
80 * the Free Software Foundation; either version 2 of the License, or
81 * (at your option) any later version.
82 *
83 * This program is distributed in the hope that it will be useful,
84 * but WITHOUT ANY WARRANTY; without even the implied warranty of
85 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
86 * General Public License for more details.
87 *
88 * You should have received a copy of the GNU General Public License
89 * along with this program; if not, write to the Free Software
90 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
91 */ 79 */
92#include <ctype.h> /* isalpha, isdigit */ 80#include <ctype.h> /* isalpha, isdigit */
93#include <unistd.h> /* getpid */ 81#include <unistd.h> /* getpid */
@@ -369,7 +357,7 @@ static int free_pipe(struct pipe *pi, int indent);
369/* really run the final data structures: */ 357/* really run the final data structures: */
370static int setup_redirects(struct child_prog *prog, int squirrel[]); 358static int setup_redirects(struct child_prog *prog, int squirrel[]);
371static int run_list_real(struct pipe *pi); 359static int run_list_real(struct pipe *pi);
372static void pseudo_exec(struct child_prog *child) __attribute__ ((noreturn)); 360static void pseudo_exec(struct child_prog *child) ATTRIBUTE_NORETURN;
373static int run_pipe_real(struct pipe *pi); 361static int run_pipe_real(struct pipe *pi);
374/* extended glob support: */ 362/* extended glob support: */
375static int globhack(const char *src, int flags, glob_t *pglob); 363static int globhack(const char *src, int flags, glob_t *pglob);
diff --git a/shell/lash.c b/shell/lash.c
index f4cadde14..a23f5f4d4 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -8,20 +8,7 @@
8 * under the following liberal license: "We have placed this source code in the 8 * under the following liberal license: "We have placed this source code in the
9 * public domain. Use it in any project, free or commercial." 9 * public domain. Use it in any project, free or commercial."
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 */ 12 */
26 13
27/* This shell's parsing engine is officially at a dead-end. Future 14/* This shell's parsing engine is officially at a dead-end. Future
@@ -148,7 +135,7 @@ static void remove_job(struct jobset *j_list, struct job *job);
148static int get_command(FILE * source, char *command); 135static int get_command(FILE * source, char *command);
149static int parse_command(char **command_ptr, struct job *job, int *inbg); 136static int parse_command(char **command_ptr, struct job *job, int *inbg);
150static int run_command(struct job *newjob, int inbg, int outpipe[2]); 137static int run_command(struct job *newjob, int inbg, int outpipe[2]);
151static int pseudo_exec(struct child_prog *cmd) __attribute__ ((noreturn)); 138static int pseudo_exec(struct child_prog *cmd) ATTRIBUTE_NORETURN;
152static int busy_loop(FILE * input); 139static int busy_loop(FILE * input);
153 140
154 141