static rwpipe *rwpipe_open( int argc, char *argv[] )

{

    rwpipe *this = av_mallocz( sizeof( rwpipe ) );



    if ( this != NULL )

    {

        int input[ 2 ];

        int output[ 2 ];



        pipe( input );

        pipe( output );



        this->pid = fork();



        if ( this->pid == 0 )

        {

#define COMMAND_SIZE 10240

            char *command = av_mallocz( COMMAND_SIZE );

            int i;



            strcpy( command, "" );

            for ( i = 0; i < argc; i ++ )

            {

                av_strlcat( command, argv[ i ], COMMAND_SIZE );

                av_strlcat( command, " ", COMMAND_SIZE );

            }



            dup2( output[ 0 ], STDIN_FILENO );

            dup2( input[ 1 ], STDOUT_FILENO );



            close( input[ 0 ] );

            close( input[ 1 ] );

            close( output[ 0 ] );

            close( output[ 1 ] );



            execl("/bin/sh", "sh", "-c", command, (char*)NULL );

            _exit( 255 );

        }

        else

        {

            close( input[ 1 ] );

            close( output[ 0 ] );



            this->reader = fdopen( input[ 0 ], "r" );

            this->writer = fdopen( output[ 1 ], "w" );

        }

    }



    return this;

}

static rwpipe *rwpipe_open( int argc, char *argv[] )

{

    rwpipe *this = av_mallocz( sizeof( rwpipe ) );



    if ( this != NULL )

    {

        int input[ 2 ];

        int output[ 2 ];



        pipe( input );

        pipe( output );



        this->pid = fork();



        if ( this->pid == 0 )

        {

#define COMMAND_SIZE 10240

            char *command = av_mallocz( COMMAND_SIZE );

            int i;



            strcpy( command, "" );

            for ( i = 0; i < argc; i ++ )

            {

                av_strlcat( command, argv[ i ], COMMAND_SIZE );

                av_strlcat( command, " ", COMMAND_SIZE );

            }



            dup2( output[ 0 ], STDIN_FILENO );

            dup2( input[ 1 ], STDOUT_FILENO );



            close( input[ 0 ] );

            close( input[ 1 ] );

            close( output[ 0 ] );

            close( output[ 1 ] );



            execl("/bin/sh", "sh", "-c", command, (char*)NULL );

            _exit( 255 );

        }

        else

        {

            close( input[ 1 ] );

            close( output[ 0 ] );



            this->reader = fdopen( input[ 0 ], "r" );

            this->writer = fdopen( output[ 1 ], "w" );

        }

    }



    return this;

}

static rwpipe *FUNC_0( int argc, char *argv[] )

{

    rwpipe *this = av_mallocz( sizeof( rwpipe ) );



    if ( this != NULL )

    {

        int VAR_0[ 2 ];

        int VAR_1[ 2 ];



        pipe( VAR_0 );

        pipe( VAR_1 );



        this->pid = fork();



        if ( this->pid == 0 )

        {

#define COMMAND_SIZE 10240

            char *VAR_2 = av_mallocz( COMMAND_SIZE );

            int VAR_3;



            strcpy( VAR_2, "" );

            for ( VAR_3 = 0; VAR_3 < argc; VAR_3 ++ )

            {

                av_strlcat( VAR_2, argv[ VAR_3 ], COMMAND_SIZE );

                av_strlcat( VAR_2, " ", COMMAND_SIZE );

            }



            dup2( VAR_1[ 0 ], STDIN_FILENO );

            dup2( VAR_0[ 1 ], STDOUT_FILENO );



            close( VAR_0[ 0 ] );

            close( VAR_0[ 1 ] );

            close( VAR_1[ 0 ] );

            close( VAR_1[ 1 ] );



            execl("/bin/sh", "sh", "-c", VAR_2, (char*)NULL );

            _exit( 255 );

        }

        else

        {

            close( VAR_0[ 1 ] );

            close( VAR_1[ 0 ] );



            this->reader = fdopen( VAR_0[ 0 ], "r" );

            this->writer = fdopen( VAR_1[ 1 ], "w" );

        }

    }



    return this;

}

static rwpipe *FUNC_0( int argc, char *argv[] )
{ rwpipe *this = av_mallocz( sizeof( rwpipe ) ); if ( this != NULL )
{ int VAR_0[ 2 ]; int VAR_1[ 2 ]; pipe( VAR_0 ); pipe( VAR_1 ); this->pid = fork(); if ( this->pid == 0 )
{ #define COMMAND_SIZE 10240
char *VAR_2 = av_mallocz( COMMAND_SIZE ); int VAR_3; strcpy( VAR_2, "" ); for ( VAR_3 = 0; VAR_3 < argc; VAR_3 ++ ) { av_strlcat( VAR_2, argv[ VAR_3 ], COMMAND_SIZE ); av_strlcat( VAR_2, " ", COMMAND_SIZE ); } dup2( VAR_1[ 0 ], STDIN_FILENO ); dup2( VAR_0[ 1 ], STDOUT_FILENO ); close( VAR_0[ 0 ] ); close( VAR_0[ 1 ] ); close( VAR_1[ 0 ] ); close( VAR_1[ 1 ] ); execl("/bin/sh", "sh", "-c", VAR_2, (char*)NULL ); _exit( 255 ); } else
{ close( VAR_0[ 1 ] ); close( VAR_1[ 0 ] ); this->reader = fdopen( VAR_0[ 0 ], "r" ); this->writer = fdopen( VAR_1[ 1 ], "w" ); } } return this; }