Zebediah Figura (@zfigura) commented about tools/widl/write_sltg.c:
- for (i = 0; i < sltg->n_file_blocks - 1; i++)
- {
assert(block->next != NULL);
entry.length = block->length;
entry.index_string = block->index_string;
entry.next = header.first_blk + i;
put_data(&entry, sizeof(entry));
block = block->next;
- }
- assert(block->next == NULL);
- /* library block length includes helpstrings and name table */
- entry.length = block->length + 0x40 + 2 + 4 + 6 + 12 + 0x200 + sltg->name_table.size + 12;
This is a lot of magic numbers, and I can't immediately figure out what any of them even are. Is there a better way we can calculate this?
(Perhaps by setting this to the value of output_buffer_pos after we write the rest of the block, like you do with name_table_offset below?)