pan: move query_formats() to avoid forward declarations.