commit bash-20210203 snapshot

This commit is contained in:
Chet Ramey
2021-02-06 18:28:36 -05:00
parent 08871a7780
commit 6110f1bc2b
8 changed files with 81 additions and 13 deletions
+10 -1
View File
@@ -106,11 +106,14 @@ extern ARRAY *array_from_string PARAMS((char *, char *));
#define set_element_value(ae, val) ((ae)->value = (val))
#define set_max_index(a, i) ((a)->max_index = (i))
#define set_num_elements(a, n) ((a)->num_elements = (n))
/* Convenience */
#define array_push(a,v) \
do { array_rshift ((a), 1, (v)); } while (0)
#define array_pop(a) \
do { array_dispose_element (array_shift ((a), 1, 0)); } while (0)
do { array_shift ((a), 1, AS_DISPOSE); } while (0)
#define GET_ARRAY_FROM_VAR(n, v, a) \
do { \
@@ -118,6 +121,12 @@ extern ARRAY *array_from_string PARAMS((char *, char *));
(a) = ((v) && array_p ((v))) ? array_cell (v) : (ARRAY *)0; \
} while (0)
#define ARRAY_ELEMENT_REPLACE(ae, v) \
do { \
free ((ae)->value); \
(ae)->value = (v); \
} while (0)
#define ALL_ELEMENT_SUB(c) ((c) == '@' || (c) == '*')
/* In eval.c, but uses ARRAY * */