🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4031

Re: Binary includes

#4031
From: Dik T. Winter
Date: Tue, 19 Sep 1995 00:31
22 lines
1330 bytes
In article <43kt1g$ig@boson.epita.fr> j@the_one.epita.fr (Jedi/Sector One) writes:
 >   What about a syntax like :
 >      static char table[] = {
 >     #incbin "table.dat"
 >      };
 > 
 >   Even if this is fully managed by the preprocessor (so that the compilation
 > time won't be increased), this would save lotsa developpment time.

But what would the compiler do with all that garbage once it is included?
The compiler expects tokens, so this would mean a new kind of token is
invented that stands for binary data.
 > 
 >   Another problemes with the actual ANSI C revision is that there is no way of
 > knowing how many items an array contains without an end mark. Just look at the
 > first example I gave : how is it possible to know that there are 4 items at
 > run-time ?

sizeof(char_table) will give the expected value.
-- 
dik t. winter, cwi, kruislaan 413, 1098 sj  amsterdam, nederland, +31205924098
home: bovenover 215, 1025 jn  amsterdam, nederland; e-mail: dik@cwi.nl
Technical Details
Message-ID: <DF4Mt0.Cvw@cwi.nl>
Path: arc1-ca.pugleaf.net!cwi.nl!dik
References: <43kt1g$ig@boson.epita.fr>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!cwi.nl!dik
From: dik@cwi.nl (Dik T. Winter)
Subject: Re: Binary includes
Message-ID: <DF4Mt0.Cvw@cwi.nl>
Sender: news@cwi.nl (The Daily Dross)
Nntp-Posting-Host: bever.cwi.nl
Organization: CWI, Amsterdam
References: <43kt1g$ig@boson.epita.fr>
Date: Tue, 19 Sep 1995 00:31:48 GMT