/* Calls the given function for each data element which is associated with the given location. Note that this function is NOT thread-safe. So unless @datalist can be protected from any modifications during invocation of this function, it should not be called.  */
void g_dataset_foreach(gconstpointer dataset_location, GDataForeachFunc func, gpointer user_data)
/* Calls the given function for each data element which is associated with the given location. Note that this function is NOT thread-safe. So unless @datalist can be protected from any modifications during invocation of this function, it should not be called.  */
void g_dataset_foreach(gconstpointer dataset_location, GDataForeachFunc func, gpointer user_data)
{
  GDataset *dataset;
  g_return_if_fail (dataset_location != NULL);
  g_return_if_fail (func != NULL);
  G_LOCK (g_dataset_global);
  if (g_dataset_location_ht)
    {
      dataset = g_dataset_lookup (dataset_location);
      G_UNLOCK (g_dataset_global);
      if (dataset)
	g_datalist_foreach (&dataset->datalist, func, user_data);
    }
  else
    {
      G_UNLOCK (g_dataset_global);
    }
}