www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/06/16:08:23

To: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
Cc: DJGPP AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Calling an overlay in Gnu C/C++
Date: Mon, 06 Feb 95 18:45:09 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>

> the run. I suppose that these needed-once-only bits of program could be called
> as child processes; I know how to make Gnu C program X.CC call Gnu C program
> Y.CC; but how can Y.CC write to an array declared within X.CC?

How about calling these programs with popen() instead of spawnXXX()?
If you can arrange for these one-timers to write their output to
standard output, you can then popen("xyzzy.exe", "r") in the main
program and read into your array whatever comes from the stream
which popen() returns.  If you care about portability, this is the
way to go.

Alternatively, you could allocate a buffer in low memory by calling
_go32_dpmi_allocate_dos_memory() in the main program, then pass the
address of the buffer to the child process (via command line).  The
child can then put its output there with a call to movedata() or
dosmemput().

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019