"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "util/xmlutils.c" between
gvm-libs-10.0.1.tar.gz and gvm-libs-11.0.0.tar.gz

About: GVM Libraries for the Greenbone Vulnerability Management (GVM-10) framework (derived from the former openvas-libraries).

xmlutils.c  (gvm-libs-10.0.1):xmlutils.c  (gvm-libs-11.0.0)
skipping to change at line 248 skipping to change at line 248
/** /**
* @brief Add attributes from an XML callback to an entity. * @brief Add attributes from an XML callback to an entity.
* *
* @param[in] entity The entity. * @param[in] entity The entity.
* @param[in] names List of attribute names. * @param[in] names List of attribute names.
* @param[in] values List of attribute values. * @param[in] values List of attribute values.
*/ */
void void
add_attributes (entity_t entity, const gchar **names, const gchar **values) add_attributes (entity_t entity, const gchar **names, const gchar **values)
{ {
if (*names && *values) if (names && values && *names && *values)
{ {
if (entity->attributes == NULL) if (entity->attributes == NULL)
entity->attributes = entity->attributes =
g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
while (*names && *values) while (*names && *values)
{ {
if (*values) if (*values)
g_hash_table_insert (entity->attributes, g_strdup (*names), g_hash_table_insert (entity->attributes, g_strdup (*names),
g_strdup (*values)); g_strdup (*values));
names++; names++;
skipping to change at line 1194 skipping to change at line 1194
{ {
g_string_append_printf ((GString *) string, " %s=\"%s\"", (char *) name, g_string_append_printf ((GString *) string, " %s=\"%s\"", (char *) name,
(char *) value); (char *) value);
} }
/** /**
* @brief Print an XML entity tree to a GString, appending it if string is not * @brief Print an XML entity tree to a GString, appending it if string is not
* @brief empty. * @brief empty.
* *
* @param[in] entity Entity tree to print to string. * @param[in] entity Entity tree to print to string.
* @param[in,out] string String to write to (will be created if NULL). * @param[in,out] string String to write to.
*/ */
void void
print_entity_to_string (entity_t entity, GString *string) print_entity_to_string (entity_t entity, GString *string)
{ {
gchar *text_escaped = NULL; gchar *text_escaped = NULL;
g_string_append_printf (string, "<%s", entity->name); g_string_append_printf (string, "<%s", entity->name);
if (entity->attributes && g_hash_table_size (entity->attributes)) if (entity->attributes && g_hash_table_size (entity->attributes))
g_hash_table_foreach (entity->attributes, foreach_print_attribute_to_string, g_hash_table_foreach (entity->attributes, foreach_print_attribute_to_string,
string); string);
g_string_append_printf (string, ">"); g_string_append_printf (string, ">");
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)