Example #1
0
int vprintf( int fd, const char *format, va_list args )
{
	tPrintfWrapperFP wrapper_putc = &WRAPPER_PUTC;
	size_t pos = 0;

	return wrapper_output( (void *)fd, wrapper_putc, pos, format, args );	
}
Example #2
0
int vprintf_buffered( const char *format, va_list args )
{
    tPrintfWrapperFP wrapper_putc_buffered = &WRAPPER_BUFFER_PUTC;

    tBufferPutcData g_putcBuffer;
    g_putcBuffer.bufferPos = 0;

    void *ctx = (void *)&g_putcBuffer;
    size_t pos = 0;

    int iReturn = wrapper_output( ctx, wrapper_putc_buffered, pos, format, args );

    // Cleanup buffer
    while ( g_putcBuffer.bufferPos > 0 )
    {
        size_t tx_bytes;

        if ( transmit( STDOUT, (const void *)g_putcBuffer.szBuffer, g_putcBuffer.bufferPos, &tx_bytes ) != 0 )
            return (-1);

        if ( tx_bytes == 0 )
            return (-1);

        g_putcBuffer.bufferPos -= tx_bytes;
    }

    return iReturn;
}
Example #3
0
int vprintf( const char *format, va_list args )
{
	tPrintfWrapperFP wrapper_putc = &WRAPPER_PUTC;
	void *ctx = NULL;
	size_t pos = 0;

	return wrapper_output( ctx, wrapper_putc, pos, format, args );	
}
Example #4
0
int vsprintf( char *buf, const char *format, va_list args )
{
	tPrintfWrapperFP wrapper_outc = &WRAPPER_OUTC;
	void *ctx = buf;
	size_t pos = 0;

	int iReturnValue = wrapper_output( ctx, wrapper_outc, pos, format, args );

	(*wrapper_outc)( ctx, '\0', iReturnValue );

	return iReturnValue;
}
Example #5
0
void *wrapper_output_(void* args)
{
    wrapper_output();
}