1 /* match.h - interface to shell ##/%% matching code */
4 #define SHELL_MATCH_H 1
6 PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
8 //TODO! Why ash.c still uses internal version?!
11 SCAN_MOVE_FROM_LEFT
= (1 << 0),
12 SCAN_MOVE_FROM_RIGHT
= (1 << 1),
13 SCAN_MATCH_LEFT_HALF
= (1 << 2),
14 SCAN_MATCH_RIGHT_HALF
= (1 << 3),
17 char* FAST_FUNC
scan_and_match(char *string
, const char *pattern
, unsigned flags
);
19 static inline unsigned pick_scan(char op1
, char op2
)
23 scan_flags
= SCAN_MATCH_LEFT_HALF
+
24 (op1
== op2
? SCAN_MOVE_FROM_RIGHT
: SCAN_MOVE_FROM_LEFT
);
26 scan_flags
= SCAN_MATCH_RIGHT_HALF
+
27 (op1
== op2
? SCAN_MOVE_FROM_LEFT
: SCAN_MOVE_FROM_RIGHT
);
32 POP_SAVED_FUNCTION_VISIBILITY