How to loop though all OpenGL lights ?

How can I loop through all the lights that I have defined ?

I need something like this:
for (light = 0, light <= max_light, light++)
switch_on(light);

The Problem is that OpenGL uses the enum const GL_LIGHT0, GL_LIGHT1 and so on. And I can not rely on that GL_LIGHT1 = GL_LIGHT0 + 1

The specifications says thay GL_LIGHTn is identical to GL_LIGHT0 + n. So you can do like that to loop through all lights.

Hey that’s great. That will make it quite comfortable. Thank you for clarifying this.