Ejemplo n.º 1
0
void
split_and_copy_attributes(char **list, papi_attribute_t **attributes,
		papi_attribute_t ***in, papi_attribute_t ***out)
{
	int i;

	if ((list == NULL) || (attributes == NULL))
		return;

	for (i = 0; attributes[i] != NULL; i++)
		if (is_in_list(attributes[i]->name, list) == 0)
			copy_attribute(in, attributes[i]);
		else
			copy_attribute(out, attributes[i]);
}
Ejemplo n.º 2
0
void
copy_attributes(papi_attribute_t ***result, papi_attribute_t **attributes)
{
	int i;

	if ((result == NULL) || (attributes == NULL))
		return;

	for (i = 0; attributes[i] != NULL; i++)
		copy_attribute(result, attributes[i]);
}
static void
xml_start_element (GMarkupParseContext * ctx, const gchar * element_name,
    const gchar ** attr_names, const gchar ** attr_vals,
    gpointer user_data, GError ** error)
{
  gchar name[256];
  IsoLang lang;

  if (strcmp (element_name, "iso_639_entry") != 0)
    return;

  copy_attribute (lang.code_1, 3, attr_names, attr_vals, "iso_639_1_code");
  copy_attribute (lang.code_2t, 4, attr_names, attr_vals, "iso_639_2T_code");
  copy_attribute (lang.code_2b, 4, attr_names, attr_vals, "iso_639_2B_code");

  copy_attribute (name, sizeof (name), attr_names, attr_vals, "name");
  lang.name = g_intern_string (name);

  g_array_append_val (languages, lang);
}