/* Sets @mask on @info to match specific attribute types.  */
void g_file_info_set_attribute_mask(GFileInfo *info, GFileAttributeMatcher *mask)
/* Sets @mask on @info to match specific attribute types.  */
void g_file_info_set_attribute_mask(GFileInfo *info, GFileAttributeMatcher *mask)
{
  GFileAttribute *attr;
  int i;
  g_return_if_fail (G_IS_FILE_INFO (info));
  if (mask != info->mask)
    {
      if (info->mask != NO_ATTRIBUTE_MASK)
	g_file_attribute_matcher_unref (info->mask);
      info->mask = g_file_attribute_matcher_ref (mask);
      for (i = 0; i < info->attributes->len; i++)
	{
	  attr = &g_array_index (info->attributes, GFileAttribute, i);
	  if (!_g_file_attribute_matcher_matches_id (mask,
						    attr->attribute))
	    {
	      _g_file_attribute_value_clear (&attr->value);
	      g_array_remove_index (info->attributes, i);
	      i--;
	    }
	}
    }
}