// the list can be initialized to NULL, // it does not have to be assigned the result of a CreateList(). // this allows the list to only be allocated if it is used. PLIST list = NULL; AddLink( &list, (POINTER)user_pointer ); { POINTER p; // this should be USER_DATA_TYPE *p; INDEX idx; // just a generic counter. LIST_FORALL( list, idx, POINTER, p ) { // for each item in the list, p will be not null. if( p->something == some_other_thing ) break; } // p will be NULL if the list is empty // p will be NULL if the LIST_FORALL loop completes to termination. // p will be not NULL if the LIST_FORALL loop executed a 'break;' }