- 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) {
- tchar *empty_name;
- /*WARNING("Image with index %d has no name", image_info->index);*/
- empty_name = MALLOC(sizeof(tchar));
- if (!empty_name)
- return WIMLIB_ERR_NOMEM;
- *empty_name = T('\0');
- image_info->name = empty_name;
- }
- return ret;