Contents of /tags/mkinitrd-6_5_1/busybox/shell/match.h
Parent Directory | Revision Log
Revision 1519 -
(show annotations)
(download)
Wed Sep 7 17:51:16 2011 UTC (13 years ago) by niro
File MIME type: text/plain
File size: 762 byte(s)
Wed Sep 7 17:51:16 2011 UTC (13 years ago) by niro
File MIME type: text/plain
File size: 762 byte(s)
tagged 'mkinitrd-6_5_1'
1 | /* match.h - interface to shell ##/%% matching code */ |
2 | |
3 | #ifndef SHELL_MATCH_H |
4 | #define SHELL_MATCH_H 1 |
5 | |
6 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN |
7 | |
8 | //TODO! Why ash.c still uses internal version?! |
9 | |
10 | typedef char *(*scan_t)(char *string, char *match, bool match_at_left); |
11 | |
12 | char *scanleft(char *string, char *match, bool match_at_left); |
13 | char *scanright(char *string, char *match, bool match_at_left); |
14 | |
15 | static inline scan_t pick_scan(char op1, char op2, bool *match_at_left) |
16 | { |
17 | /* # - scanleft |
18 | * ## - scanright |
19 | * % - scanright |
20 | * %% - scanleft |
21 | */ |
22 | if (op1 == '#') { |
23 | *match_at_left = true; |
24 | return op1 == op2 ? scanright : scanleft; |
25 | } else { |
26 | *match_at_left = false; |
27 | return op1 == op2 ? scanleft : scanright; |
28 | } |
29 | } |
30 | |
31 | POP_SAVED_FUNCTION_VISIBILITY |
32 | |
33 | #endif |