Small utility functions used by Topdoc and Topdoc Parse