Re: Resources and Euphoria

new topic     » topic index » view thread      » older message » newer message

I wrote:

>It would not be that difficult to write a pre-processor=20
> that could do this for you. Something along the lines of=20
> DOT, that recursively scans all the include files, but
>then builds a single resulting file. All the references to=20
> datafiles would be replaced with a reference to the INI file=20
> with the correct offset. Of course, it would need to
>rename all the non-global functions, procedures and types in=20
> the bundled file so there wouldn't be local namespace collisions.

Ooops. I've got this OOP/namespace thing on my mind. When you've got a =
hammer, everything looks like a nail.

When the program runs, it only needs to check for a DAT file. If there =
is one, it uses it. Otherwise, it defaults to the "real" paths. So all =
you need then is a program to recursively build the DAT file. The DAT =
file would probably be set up like a linked list of files.

If you really only wanted to send out *only* an EXE, it's possible to do =
that as well. You would need a constant in your main program, something =
like:

   DATAFILE_OFFSET =3D 000000

If this constant was non-zero, the program would know that the INI was =
bound to the EXE. To bind the INI to the EXE, the packing program would:

   1. Build the DAT file.
   2. Bind the EX file, and get the size.
   3. Change the constant to the size of the EXE.
   4. Bind the EX file again.
   5. Attach the INI file to the EXE
   6. Change the constant in the main program back to '000000'

I think this is a *much* better scheme.

Comments?

-- David Cuny

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu