Liste des Groupes | Revenir à cl c |
On 27/05/2024 01:44, Lawrence D'Oliveiro wrote:On Sun, 26 May 2024 13:09:36 +0200, David Brown wrote:
People have always managed to embed binary source files into their
binary output files - using linker tricks, or using xxd or other tools
(common or specialised) to turn binary files into initialisers for
constant arrays (or structs).
Don’t call them “tricks”. Call them “linker scripts” and “build
procedures”. They can do some quite complex things.
#embed has two purposes. One is to save you from using external tools
for that kind of thing.
But it can only be a partial solution to that. It cannot replace the
procedures needed to construct the binary data format.
The binary data already exists, or has been created.
The problem is getting it into your program as ready-to-use data rather
than have to bundle an unwieldy collection of files in a folder
somewhere and then have assorted routines to read them into memory.
It only solves the easy part: including that binary data in the build.
Apparently that is not so easy as you seem to think.
Or maybe you think
that 'embedding a file' just means adding it to a zip file?
Embedding applies also to text files not just binaries.
Les messages affichés proviennent d'usenet.