eyBuildLib API Reference : eyBuildLib
ebpipe - eybuild pipe operation library
ebPipeCreate( ) - create a pipe with a specified the size
ebPipeRead( ) - read data from pipe
ebPipeWrite( ) - write data into pipe
ebPipeClose( ) - close one side of pipe
eybuild pipe operation library
ebpipe.h
ebPipeCreate( ) - create a pipe with a specified the size
EBPIPE * ebPipeCreate ( size_t size )
This routine is to create a pipe with a specified the size. If parameter size is zero, it will create a pipe with default buffer size 4096 bytes.
pointer to new created pipe, or NULL if lack memory
ebPipeRead( ) - read data from pipe
int ebPipeRead ( EBPIPE * ppipe, void * pbuf, size_t size )
This routine is to read data into pipe. If pipe is empty, it will not return until some data has been read from pipe. It returns 0 length if write side has been close, and the pending threads will be wake up.
length of data has been read, or ERROR if read side has been closed
ebPipeWrite( ) - write data into pipe
int ebPipeWrite ( EBPIPE * ppipe, const void * data, size_t size )
This routine is to write data into pipe. If pipe is full, it will not return until some data has been write into pipe.
length of data has been writen, or ERROR if either side has been closed
ebPipeClose( ) - close one side of pipe
int ebPipeClose ( EBPIPE * ppipe, BOOL blwrt )
This routine is to close one side of pipe. Pipe has two sides, parameter blwrt is to specify close read or write side. It will inform peer side refuse read or write if either side of pipe is closed. It will also wake up all threads which is pending on read or write this pipe.
OK/ERROR