defini in buf.h