On Fri, May 30, 2003 at 08:24:31AM -0700, Alex Deucher wrote:
> If that's the case then's what's the best way to iterate through the
> mode list without getting stuck in an endless loop?  It's probably
> somehting simple, but it's just not coming to me...

For a circular list, you need to keep the original pointer around, and
then travel the list until you get NULL (for the non circular list) or
the original pointer, Something like :

for (test=FALSE, p=modes; p!=NULL && (test && p != modes); test=TRUE, p = p->next);

Fully untested, and may contain typos, but you get the idea.

Friendly,

Sven Luther
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to