convert global declarations of passes to declarations of factory functions
apply to both .c and .h files