shell: unify endofname() in hush and ash
function old new delta builtin_umask 132 133 +1 changepath 195 194 -1 expand_and_evaluate_arith 77 69 -8 ash_arith 143 135 -8 expand_one_var 1551 1515 -36 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/4 up/down: 1/-53) Total: -52 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
@ -87,14 +87,19 @@ typedef long arith_t;
|
||||
#define strto_arith_t strtoul
|
||||
#endif
|
||||
|
||||
/* ash's and hush's endofname is the same, so... */
|
||||
# define is_name(c) ((c) == '_' || isalpha((unsigned char)(c)))
|
||||
# define is_in_name(c) ((c) == '_' || isalnum((unsigned char)(c)))
|
||||
const char* FAST_FUNC endofname(const char *name);
|
||||
|
||||
typedef const char* FAST_FUNC (*arith_var_lookup_t)(const char *name);
|
||||
typedef void FAST_FUNC (*arith_var_set_t)(const char *name, const char *val);
|
||||
typedef char* FAST_FUNC (*arith_var_endofname_t)(const char *name);
|
||||
//typedef const char* FAST_FUNC (*arith_var_endofname_t)(const char *name);
|
||||
|
||||
typedef struct arith_eval_hooks {
|
||||
arith_var_lookup_t lookupvar;
|
||||
arith_var_set_t setvar;
|
||||
arith_var_endofname_t endofname;
|
||||
// arith_var_endofname_t endofname;
|
||||
} arith_eval_hooks_t;
|
||||
|
||||
arith_t arith(const char *expr, int *perrcode, arith_eval_hooks_t*);
|
||||
|
Reference in New Issue
Block a user