/**********************************************************************
 
	Copyright (C) 2003 Hirohisa MORI <joshua@nichibun.ac.jp>
 
	This program is free software; you can redistribute it 
	and/or modify it under the terms of the GLOBALBASE 
	Library General Public License (G-LGPL) as published by 

	http://www.globalbase.org/
 
	This program is distributed in the hope that it will be 
	useful, but WITHOUT ANY WARRANTY; without even the 
	implied warranty of MERCHANTABILITY or FITNESS FOR A 
	PARTICULAR PURPOSE.

**********************************************************************/




#include	"stream.h"


int
s_open_pipe(STREAM * p[2])
{
	HANDLE read_pipe,write_pipe;
	/* DEBUG */
/*	er_panic("s_open_pipe"); */
	
	if(!CreatePipe(&read_pipe,&write_pipe,NULL,0)){
		return -1;
	}
	p[0] = s_open_file_descripter(read_pipe, O_RDONLY, TRUE);
	p[1] = s_open_file_descripter(write_pipe, O_WRONLY, TRUE);
	return 0;
}

