Special Functions and Generalized Sturm-Liouville Problems