Rewrite hds.h to match upstream

Simpler form with the API on a single line