Edit
Thank you for your suggestions. I have updated the code to reflect most suggestions I got. The latest code (at the time of writing).
The messy main method now looks like this:
/* Main logic */
read_markdown(ib, number_of_sources, file, in);
render_markdown(ib, ob);
write_html_to_tmp_file(tmp_html_file_path, tmp_html_file_protocol_path, ob, verbose, stylesheet_file_path);
generate_pdf(tmp_html_file_protocol_path, output_pdf_file_path);
/* Cleanup */
unlink(tmp_html_file_path);
return EXIT_SUCCESS;
I would say it's a great improvement.