Frees all of the atoms and sets the size to zero. This function does not perform a 'deep' free, meaning that any A_OBJ atoms will not have their object's freed. Only the references to those objects contained in the atomarray will be freed.

The function to call, specified as function pointer cast to a Max method.

arg

An argument that you would like to pass to the function being called.

Returns:

A max error code.

Remarks:

The atomarray_funall() method will call your function for every item in the list. It will pass both a pointer to the item in the list, and any argument that you provide. The following example shows a function that could be called by hashtab_funall().

void myFun(t_atom *a, void *myArg)
{
// do something with a and myArg here// a is the atom in the atom array
}

Note that atoms provided to this function will be copied. The copies stored internally to the atomarray instance. You can free the atomarray by calling object_free().

Parameters:

ac

The number of atoms to be initially contained in the atomarray.

av

A pointer to the first of an array of atoms to initially copy into the atomarray.

Returns:

Pointer to the new atomarray object.

Remarks:

Note that due to the unusual prototype of this method that you cannot instantiate this object using the object_new_typed() function. If you wish to use the dynamically bound creator to instantiate the object, you should instead should use object_new() as demonstrated below. The primary reason that you might choose to instantiate an atomarray using object_new() instead of atomarray_new() is for using the atomarray object in code that is also intended to run in Max 4.