ucx/utils.h

changeset 147
1aa598f36872
parent 146
aa376dba1ba8
child 150
1cf2eabf94ed
     1.1 --- a/ucx/utils.h	Fri Aug 16 13:40:10 2013 +0200
     1.2 +++ b/ucx/utils.h	Fri Aug 16 14:48:58 2013 +0200
     1.3 @@ -29,7 +29,7 @@
     1.4  /**
     1.5   * @file utils.h
     1.6   * 
     1.7 - * Common utilities like compare and copy functions.
     1.8 + * Compare, copy and printf functions.
     1.9   * 
    1.10   * @author Mike Becker
    1.11   * @author Olaf Wintermann
    1.12 @@ -230,6 +230,18 @@
    1.13   */
    1.14  sstr_t ucx_vasprintf(UcxAllocator *allocator, const char *fmt, va_list ap);
    1.15  
    1.16 +/**
    1.17 + * A <code>printf()</code> like function which writes the output to an
    1.18 + * UcxBuffer.
    1.19 + * 
    1.20 + * @param buffer the buffer the data is written to
    1.21 + * @param ... format string and additional arguments
    1.22 + * @return the total number of bytes written
    1.23 + * @see ucx_fprintf()
    1.24 + */
    1.25 +#define ucx_bprintf(buffer, ...) ucx_fprintf((UcxBuffer*)buffer, \
    1.26 +        (write_func)ucx_buffer_write, __VA_ARGS__)
    1.27 +
    1.28  #ifdef	__cplusplus
    1.29  }
    1.30  #endif

mercurial