larsbrinkhoff / pdp10-its-disassembler

Disassembler and other tools for files in ITS formats
GNU General Public License v2.0
19 stars 13 forks source link

Pass parameters to file formats. #142

Open larsbrinkhoff opened 2 years ago

larsbrinkhoff commented 2 years ago

Some file formats need parameter passed in. A recent example is the Harware Read-In format which needs to know the start and end of the memory region.

My current idea is to pass in an array. It can be NULL for no parameters. Each item is a function pointer and a string.

    struct param params[] = {
        { memory_start, "1234" },
        { memory_end, "4321" },
        { NULL, NULL }
    };

    output_file_format->write (stdout, &memory, params);