• E
    buf: support peeking at string contents · 9202f2c2
    Eric Blake 提交于
    Right now, the only way to get at the contents of a virBuffer is
    to destroy it.  But there are cases in my upcoming patches where
    peeking at the contents makes life easier.  I suppose this does
    open up the potential for bad code to dereference a stale pointer,
    by disregarding the docs that the return value is invalid on the
    next virBuf operation, but such is life.
    
    * src/util/buf.h (virBufferCurrentContent): New declaration.
    * src/util/buf.c (virBufferCurrentContent): Implement it.
    * src/libvirt_private.syms (buf.h): Export it.
    * tests/virbuftest.c (testBufAutoIndent): Test it.
    9202f2c2
libvirt_private.syms 34.4 KB