hf_process function

Process headers/footers