Wrap some operations on struct buffer in functions.