Semiclassical approximation for low-degree stellar p modes — I. The classical eigenfrequency equation