/* Returns: a string containing the next attribute or NULL if no more attribute exist.  */
const char* g_file_attribute_matcher_enumerate_next(GFileAttributeMatcher *matcher)
/* Returns: a string containing the next attribute or NULL if no more attribute exist.  */
const char* g_file_attribute_matcher_enumerate_next(GFileAttributeMatcher *matcher)
{
  int i;
  SubMatcher *sub_matcher;
  if (matcher == NULL)
    return NULL;
  while (1)
    {
      i = matcher->iterator_pos++;
      if (matcher->sub_matchers == NULL)
        return NULL;
      if (i < matcher->sub_matchers->len)
        sub_matcher = &g_array_index (matcher->sub_matchers, SubMatcher, i);
      else
        return NULL;
      if (sub_matcher->mask == 0xffffffff &&
	  (sub_matcher->id & (NS_MASK << NS_POS)) == matcher->iterator_ns)
	return get_attribute_for_id (sub_matcher->id);
    }
}