catched up api changes, fixed dysfunctional c++ signature api, enhanced c++ Buf class.