On Wed, 07 May 2003 23:31:06 +0900, Brian Candler wrote:

[snip popen talk]

Sorry.. I never thought it would be that hard to explain 
my problem :-)


I embed ruby into C++.  The "void main" is located in the frontend.
Right now everything is running in the same process. 

User supplyed ruby-code is executed in the same process...
its NOT executed as a child-process, thus popen3 is not possible.
The only thing which is possible right now is the flawed Redirector class
technique.

Setting up the redirection will occur within c++!

My setup routine looks like this

void lib_begin() {
	if(lib_running)
		return;
	
	// initialize ruby itself
	ruby_init();
	ruby_init_loadpath();
	ruby_script("embed");

	// setup our own environment
	objects = new RUBY_CPP::Objects;
	Redirect::RubyInit();

	/* ---------------------------
           todo: setup capture here!
	--------------------------- */

	RUBY_CPP::Require("test");

	lib_running = true;
	cout << "aeditorlib: started (" << 
		(use_swig ? "with" : "no") << "-swig)" << endl;
} 


--
Simon Strandgaard