Ha, it works!!!

Here is how you iterate through all sky entities:

Code:
int ents = 0;
ENTITY* seed = ent_createlayer("", SKY, 0);
ENTITY* ent = ptr_first(seed);
while (ent)
{
   if (ent != seed)
   {
      error(ent->type); // "skycube+6.tga"
      ents++;
   }

   ent = ent.link.next;
}

if (seed)
   ptr_remove(seed);

printf("sky entities = %d", ents);



Many thanks to you, EvilSOB!