Port buffer functions to GLib basic types