use inline function to speed header walks (and reduce exports)

As promised, here's what I meant when I said inline functions could improve the code.