- ret = 0;
- for_node_child(image_node, child) {
- if (!node_is_element(child))
- continue;
- if (node_name_is(child, "DIRCOUNT"))
- image_info->dir_count = node_get_u64(child);
- else if (node_name_is(child, "FILECOUNT"))
- image_info->file_count = node_get_u64(child);
- else if (node_name_is(child, "TOTALBYTES"))
- image_info->total_bytes = node_get_u64(child);
- else if (node_name_is(child, "HARDLINKBYTES"))
- image_info->hard_link_bytes = node_get_u64(child);
- else if (node_name_is(child, "CREATIONTIME"))
- image_info->creation_time = node_get_timestamp(child);
- else if (node_name_is(child, "LASTMODIFICATIONTIME"))
- image_info->last_modification_time = node_get_timestamp(child);
- else if (node_name_is(child, "WINDOWS")) {
- DEBUG("Found <WINDOWS> tag");
- ret = xml_read_windows_info(child,
- &image_info->windows_info);
- image_info->windows_info_exists = true;
- } else if (node_name_is(child, "NAME")) {
- ret = node_get_string(child, &image_info->name);
- } else if (node_name_is(child, "DESCRIPTION")) {
- ret = node_get_string(child, &image_info->description);
- } else if (node_name_is(child, "FLAGS")) {
- ret = node_get_string(child, &image_info->flags);
- } else if (node_name_is(child, "DISPLAYNAME")) {
- ret = node_get_string(child, &image_info->display_name);
- } else if (node_name_is(child, "DISPLAYDESCRIPTION")) {
- ret = node_get_string(child, &image_info->display_description);
- }
- if (ret != 0)
- return ret;
- }
- if (!image_info->name) {
- WARNING("Image with index %"PRIu64" has no name",
- image_info->index);
- image_info->name = MALLOC(1);
- if (!image_info->name) {
- ERROR("Out of memory");
- return WIMLIB_ERR_NOMEM;
- }
- image_info->name[0] = '\0';
- }
- return ret;
+ node = xmlNewNode(NULL, name);
+ if (!node)
+ goto err;
+
+ sprintf(buf, "0x%08"PRIX32, (u32)(timestamp >> 32));
+ if (!new_element_with_text(node, "HIGHPART", buf))
+ goto err;
+
+ sprintf(buf, "0x%08"PRIX32, (u32)timestamp);
+ if (!new_element_with_text(node, "LOWPART", buf))
+ goto err;
+
+ if (parent)
+ xmlAddChild(parent, node);
+ return node;
+
+err:
+ xmlFreeNode(node);
+ return NULL;