-#define DUP_ARR_D(type, obstack, arr) \
- memcpy(CLONE_ARR_D(type, (obstack), (arr)), (arr), sizeof(type) * ARR_LEN ((arr)))
-
-/**
- * Create an automatic array which will be deleted at return from function.
- * Beware, the data will be allocated on the function stack!
- *
- * @param type The element type of the new array.
- * @param var A lvalue of type (type *) which will hold the new array.
- * @param n number of elements in this array.
- *
- * This macro creates a dynamic array on the functions stack of a given type at runtime.
- * The size of the array cannot be changed later.
- */
-#define NEW_ARR_A(type, var, n) \
- do { \
- int _nelts = (n); \
- assert(_nelts >= 0); \
- (var) = (void *)((_arr_descr *)alloca(_ARR_ELTS_OFFS + sizeof(type) * _nelts))->v.elts; \
- _ARR_SET_DBGINF(_ARR_DESCR ((var)), ARR_A_MAGIC, sizeof (type)); \
- (void)(_ARR_DESCR((var))->nelts = _nelts); \
- } while (0)
-
-/**
- * Creates a new automatic array with the same number of elements as a
- * given one.
- *
- * @param type The element type of the new array.
- * @param var A lvalue of type (type *) which will hold the new array.
- * @param arr An array from which the elements will be duplicated
- *
- * This macro creates a dynamic array of a given type at runtime.
- * The size of the array cannot be changed later.
- *
- * @return A pointer to the dynamic array (can be used as a pointer to the
- * first element of this array).
- */
-#define CLONE_ARR_A(type, var, arr) \
- NEW_ARR_A(type, (var), ARR_LEN((arr)))
-
-/**
- * Duplicates an array and returns a new automatic one.
- *
- * @param type The element type of the new array.
- * @param var A lvalue of type (type *) which will hold the new array.
- * @param arr An array from with the number of elements will be taken
- *
- * This macro creates a dynamic array of a given type at runtime.
- * The size of the array cannot be changed later.
- *
- * @return A pointer to the dynamic array (can be used as a pointer to the
- * first element of this array).
- */
-#define DUP_ARR_A(type, var, arr) \
- do { CLONE_ARR_A(type, (var), (arr)); \
- memcpy((var), (arr), sizeof (type) * ARR_LEN((arr))); } \
- while (0)
-
-/**
- * Declare an initialized (zero'ed) array of fixed size.
- * This macro should be used at file scope only.
- *
- * @param type The element type of the new array.
- * @param var A lvalue of type (type *) which will hold the new array.
- * @param _nelts Number of elements in this new array.
- */
-#define DECL_ARR_S(type, var, _nelts) \
- ARR_STRUCT(type, (_nelts) ? (_nelts) : 1) _##var; \
- type *var = (_ARR_SET_DBGINF(&_##var, ARR_A_MAGIC, sizeof (type)), \
- _##var.nelts = _nelts, \
- _##var.v.elts)