|
From: Dave D. <dde...@es...> - 2004-03-01 10:31:28
|
Hans-Bernhard Broeker <br...@ph...> writes:
> On Fri, 27 Feb 2004, Ethan Merritt wrote:
>
>> It occurs to me that we might use the approach of Adobe products
>> like FrameMaker. The long PostScript prolog that is constant for
>> every output document is stored as a separate file in some appropriate
>> directory, and then copied into the output stream when a new
>> document is being generated.
>
> Yeah, that idea had been creeping around at the back of my mind, too.
>
>> 1) It doesn't take up any space in the source code module, which is
>> what your DOS compiler doesn't handle well
>
> At least part of the blame for that goes to the language itself. There's
> no syntax in C to influence where string constants are to be stored.
> If you look at the (slightly modified) definition of PS_header:
>
> static const char GPFAR * const GPFAR PS_header[] = {
> "line of text\n",
> "line of text\n",
> /*...*/
> "last line\n"
> };
>
> you'll find that there are two GPFAR markers for the array of pointers,
> i.e. it's a "far array" of "far pointers". But I can't tell the compiler
> to put the *strings* themselves into a "far data" or "far code" segment.
>
Aren't string literals merely a convenience feature. You can implement
things explicitly as
static const char label1[] = "hello world\n";
main()
{
printf(label1);
}
which probably generates identical code (apart from pollution of name space)
So, while tedious, it should be possible to force the string data
to go anywhere you want ..?
dd
--
Dave Denholm <dde...@es...> http://www.esmertec.com
|