eyBuildLib API Reference : eyBuildLib

ebpipe

NAME

ebpipe - eybuild pipe operation library

ROUTINES

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

DESCRIPTION

eybuild pipe operation library

INCLUDE

ebpipe.h


eyBuildLib : Routines

ebPipeCreate( )

NAME

ebPipeCreate( ) - create a pipe with a specified the size

SYNOPSIS

EBPIPE * ebPipeCreate
    (
    size_t size
    )

DESCRIPTION

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.

RETURNS

pointer to new created pipe, or NULL if lack memory

SEE ALSO

ebpipe


eyBuildLib : Routines

ebPipeRead( )

NAME

ebPipeRead( ) - read data from pipe

SYNOPSIS

int ebPipeRead
    (
    EBPIPE * ppipe,
    void *   pbuf,
    size_t   size
    )

DESCRIPTION

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.

RETURNS

length of data has been read, or ERROR if read side has been closed

SEE ALSO

ebpipe


eyBuildLib : Routines

ebPipeWrite( )

NAME

ebPipeWrite( ) - write data into pipe

SYNOPSIS

int ebPipeWrite
    (
    EBPIPE *     ppipe,
    const void * data,
    size_t       size
    )

DESCRIPTION

This routine is to write data into pipe. If pipe is full, it will not return until some data has been write into pipe.

RETURNS

length of data has been writen, or ERROR if either side has been closed

SEE ALSO

ebpipe


eyBuildLib : Routines

ebPipeClose( )

NAME

ebPipeClose( ) - close one side of pipe

SYNOPSIS

int ebPipeClose
    (
    EBPIPE * ppipe,
    BOOL     blwrt
    )

DESCRIPTION

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.

RETURNS

OK/ERROR

SEE ALSO

ebpipe