<div dir="ltr"><div dir="ltr">Hi Ken,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 4, 2019 at 7:25 AM <<a href="mailto:ken.dickey@whidbey.com">ken.dickey@whidbey.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">> I would try two things.  One is to find out where FILE is defined by<br>
> searching the system's include files.  There has to be some kind of<br>
> definition because e.g. open answers a FILE *.  So one /has/ to be able <br>
> to<br>
> write e.g.<br>
>   FILE *f = open("foo.txt",...<br>
> <br>
> and that's all the code is doing, trying to declare a small array of <br>
> FILE<br>
> *'s.<br>
<br>
Ya.  Attached.<br>
<br>
The code array uses 'FILE', not 'FILE *', btw.<br>
   static FILE stdoutStack[STDOUT_STACK_SZ];<br>
<br>
Hey, I once used '***' in EPROM boot code -- because I had to!<br>
<br>
My ol' brain has now rotted and no longer does cdecl.  Back to the <br>
'80's.<br>
<br>
I am just confused by this. I don't know enough memory usage context to <br>
safely convert to 'FILE *'<br>
<br>
> The second thing would be to commit a change to sqVirtualMachine.c <br>
> which<br>
> simply ifdef's out push/popOutputFile if some manifest constant, such <br>
> as<br>
> CANT_USE_FILE_STAR or DONT_USE_FILE_STAR is defined in the makefile (so<br>
> that files are compiled with -DDONT_USE_FILE_STAR=1 or some such).<br>
<br>
I will continue to play around.  Thanks!<br>
<br>
Part of my confusion is lack of understanding as to why pushOutputFile() <br>
side-effects stdout rather than using a global 'output' variable <br>
universally.<br>
   *stdout = *output<br>
Just initialize 'output' global on startup an side effect that.<br></blockquote><div><br></div><div>It does this to ensure that any and all references to stdout in the system now refer to the new file as established by pushOutputFile, or the old one as restored by popOutputFile.  You could try changing it to be an array of FILE *'s and see if that works for you.  Then we could have a define that mandates that usage.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
Thanks again much for all,<br>
-KenD<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div>