aboutsummaryrefslogtreecommitdiff
path: root/shell/math.h
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-09-07 12:19:33 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-09-07 12:19:33 +0200
commit8b2f13d84def87b4ebd0901bf0c3157bc1f6dee3 (patch)
tree0bf072d3612c77dd8b0720973e46e8dbc37a040a /shell/math.h
parent27c56f12670295286a881bbb87d506f0a5bfd40e (diff)
downloadbusybox-w32-8b2f13d84def87b4ebd0901bf0c3157bc1f6dee3.tar.gz
busybox-w32-8b2f13d84def87b4ebd0901bf0c3157bc1f6dee3.tar.bz2
busybox-w32-8b2f13d84def87b4ebd0901bf0c3157bc1f6dee3.zip
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>
Diffstat (limited to 'shell/math.h')
-rw-r--r--shell/math.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/shell/math.h b/shell/math.h
index 2b0b2b89d..96088b4d2 100644
--- a/shell/math.h
+++ b/shell/math.h
@@ -87,14 +87,19 @@ typedef long arith_t;
87#define strto_arith_t strtoul 87#define strto_arith_t strtoul
88#endif 88#endif
89 89
90/* ash's and hush's endofname is the same, so... */
91# define is_name(c) ((c) == '_' || isalpha((unsigned char)(c)))
92# define is_in_name(c) ((c) == '_' || isalnum((unsigned char)(c)))
93const char* FAST_FUNC endofname(const char *name);
94
90typedef const char* FAST_FUNC (*arith_var_lookup_t)(const char *name); 95typedef const char* FAST_FUNC (*arith_var_lookup_t)(const char *name);
91typedef void FAST_FUNC (*arith_var_set_t)(const char *name, const char *val); 96typedef void FAST_FUNC (*arith_var_set_t)(const char *name, const char *val);
92typedef char* FAST_FUNC (*arith_var_endofname_t)(const char *name); 97//typedef const char* FAST_FUNC (*arith_var_endofname_t)(const char *name);
93 98
94typedef struct arith_eval_hooks { 99typedef struct arith_eval_hooks {
95 arith_var_lookup_t lookupvar; 100 arith_var_lookup_t lookupvar;
96 arith_var_set_t setvar; 101 arith_var_set_t setvar;
97 arith_var_endofname_t endofname; 102// arith_var_endofname_t endofname;
98} arith_eval_hooks_t; 103} arith_eval_hooks_t;
99 104
100arith_t arith(const char *expr, int *perrcode, arith_eval_hooks_t*); 105arith_t arith(const char *expr, int *perrcode, arith_eval_hooks_t*);