Light position at Light function?

Is there a way to get light position(or even a direction) at light function. I guess it’s stored in some uniform or can be calculated but I haven’t yet figured out how. I would need this for Spot- and Point lights.