/* Return value: the user data previously attached or NULL.  */
void* _cairo_user_data_array_get_data(cairo_user_data_array_t *array, const cairo_user_data_key_t *key)
/* Return value: the user data previously attached or NULL.  */
void* _cairo_user_data_array_get_data(cairo_user_data_array_t *array, const cairo_user_data_key_t *key)
{
    int i, num_slots;
    cairo_user_data_slot_t *slots;
    if (array == NULL)
	return NULL;
    num_slots = array->num_elements;
    slots = _cairo_array_index (array, 0);
    for (i = 0; i < num_slots; i++) {
	if (slots[i].key == key)
	    return slots[i].user_data;
    }
    return NULL;
}