diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-01-22 22:55:11 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-01-22 22:55:11 +0000 |
commit | 86f5c9906beac527f3d7966f24811b571a589e08 (patch) | |
tree | 1c9eba853c728b5d734506e1c66c269d96fe46ea /shell | |
parent | 2edf52643d3eb3d13f26d31f9678cf122f2063bc (diff) | |
download | busybox-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.c | 34 | ||||
-rw-r--r-- | shell/hush.c | 16 | ||||
-rw-r--r-- | shell/lash.c | 17 |
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 | ||
236 | static void exraise(int) __attribute__((__noreturn__)); | 224 | static void exraise(int) ATTRIBUTE_NORETURN; |
237 | static void onint(void) __attribute__((__noreturn__)); | 225 | static void onint(void) ATTRIBUTE_NORETURN; |
238 | 226 | ||
239 | static void sh_error(const char *, ...) __attribute__((__noreturn__)); | 227 | static void sh_error(const char *, ...) ATTRIBUTE_NORETURN; |
240 | static void exerror(int, const char *, ...) __attribute__((__noreturn__)); | 228 | static void exerror(int, const char *, ...) ATTRIBUTE_NORETURN; |
241 | 229 | ||
242 | static void sh_warnx(const char *, ...); | 230 | static void sh_warnx(const char *, ...); |
243 | 231 | ||
@@ -1400,7 +1388,7 @@ struct cmdentry { | |||
1400 | static const char *pathopt; /* set by padvance */ | 1388 | static const char *pathopt; /* set by padvance */ |
1401 | 1389 | ||
1402 | static void shellexec(char **, const char *, int) | 1390 | static void shellexec(char **, const char *, int) |
1403 | __attribute__((__noreturn__)); | 1391 | ATTRIBUTE_NORETURN; |
1404 | static char *padvance(const char **, const char *); | 1392 | static char *padvance(const char **, const char *); |
1405 | static void find_command(char *, struct cmdentry *, int, const char *); | 1393 | static void find_command(char *, struct cmdentry *, int, const char *); |
1406 | static struct builtincmd *find_builtin(const char *); | 1394 | static struct builtincmd *find_builtin(const char *); |
@@ -2026,7 +2014,7 @@ static void ignoresig(int); | |||
2026 | static void onsig(int); | 2014 | static void onsig(int); |
2027 | static int dotrap(void); | 2015 | static int dotrap(void); |
2028 | static void setinteractive(int); | 2016 | static void setinteractive(int); |
2029 | static void exitshell(void) __attribute__((__noreturn__)); | 2017 | static void exitshell(void) ATTRIBUTE_NORETURN; |
2030 | static int decode_signal(const char *, int); | 2018 | static int decode_signal(const char *, int); |
2031 | 2019 | ||
2032 | /* | 2020 | /* |
@@ -2504,7 +2492,7 @@ setpwd(const char *val, int setold) | |||
2504 | 2492 | ||
2505 | 2493 | ||
2506 | static void exverror(int, const char *, va_list) | 2494 | static 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 *); | |||
4518 | static char *scanleft(char *, char *, char *, char *, int, int); | 4506 | static char *scanleft(char *, char *, char *, char *, int, int); |
4519 | static char *scanright(char *, char *, char *, char *, int, int); | 4507 | static char *scanright(char *, char *, char *, char *, int, int); |
4520 | static void varunset(const char *, const char *, const char *, int) | 4508 | static 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); | |||
9325 | static int xxreadtoken(void); | 9313 | static int xxreadtoken(void); |
9326 | static int readtoken1(int firstc, int syntax, char *eofmark, int striptabs); | 9314 | static int readtoken1(int firstc, int syntax, char *eofmark, int striptabs); |
9327 | static int noexpand(char *); | 9315 | static int noexpand(char *); |
9328 | static void synexpect(int) __attribute__((__noreturn__)); | 9316 | static void synexpect(int) ATTRIBUTE_NORETURN; |
9329 | static void synerror(const char *) __attribute__((__noreturn__)); | 9317 | static void synerror(const char *) ATTRIBUTE_NORETURN; |
9330 | static void setprompt(int); | 9318 | static 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: */ |
370 | static int setup_redirects(struct child_prog *prog, int squirrel[]); | 358 | static int setup_redirects(struct child_prog *prog, int squirrel[]); |
371 | static int run_list_real(struct pipe *pi); | 359 | static int run_list_real(struct pipe *pi); |
372 | static void pseudo_exec(struct child_prog *child) __attribute__ ((noreturn)); | 360 | static void pseudo_exec(struct child_prog *child) ATTRIBUTE_NORETURN; |
373 | static int run_pipe_real(struct pipe *pi); | 361 | static int run_pipe_real(struct pipe *pi); |
374 | /* extended glob support: */ | 362 | /* extended glob support: */ |
375 | static int globhack(const char *src, int flags, glob_t *pglob); | 363 | static 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); | |||
148 | static int get_command(FILE * source, char *command); | 135 | static int get_command(FILE * source, char *command); |
149 | static int parse_command(char **command_ptr, struct job *job, int *inbg); | 136 | static int parse_command(char **command_ptr, struct job *job, int *inbg); |
150 | static int run_command(struct job *newjob, int inbg, int outpipe[2]); | 137 | static int run_command(struct job *newjob, int inbg, int outpipe[2]); |
151 | static int pseudo_exec(struct child_prog *cmd) __attribute__ ((noreturn)); | 138 | static int pseudo_exec(struct child_prog *cmd) ATTRIBUTE_NORETURN; |
152 | static int busy_loop(FILE * input); | 139 | static int busy_loop(FILE * input); |
153 | 140 | ||
154 | 141 | ||