- off_t lookup_table_offset = ftello(w->out_fp);
- int ret;
- struct wim_lookup_table_entry *lte;
-
- list_for_each_entry(lte, lte_list, staging_list) {
- ret = write_lookup_table_entry(lte, w->out_fp);
- if (ret != 0)
- return ret;
- }
-
- off_t xml_data_offset = ftello(w->out_fp);
-
- if (lookup_table_offset == -1 || xml_data_offset == -1)
- return WIMLIB_ERR_WRITE;
- w->hdr.lookup_table_res_entry.offset = lookup_table_offset;
- w->hdr.lookup_table_res_entry.size =
- xml_data_offset - lookup_table_offset;
- w->hdr.lookup_table_res_entry.original_size =
- xml_data_offset - lookup_table_offset;
- w->hdr.lookup_table_res_entry.flags = WIM_RESHDR_FLAG_METADATA;
- return finish_write(w, WIMLIB_ALL_IMAGES,
- write_flags | WIMLIB_WRITE_FLAG_NO_LOOKUP_TABLE,
- progress_func);