examples/pager.c
void client_list_remove(struct pager_client *c)
{
  struct pager_client **ptr;

  if (c == NULL || client_list == NULL)
    return;

  for (ptr = &client_list; *ptr != c; ptr = &((**ptr).next)) {
    if (!*ptr) {
      fprintf(stderr, "trying to remove a client that isn't in the list\n");
      return;
    }
  }
  *ptr = c->next;
}
/* 
 * this function removes an element from a linked list.  the
 * pointer-manipulation insanity below is a trick that prevents the
 * "element to be removed is the head of the list" from being a
 * special case.
 */
this function removes an element from a linked list.  the
pointer-manipulation insanity below is a trick that prevents the
"element to be removed is the head of the list" from being a
special case.
this function removes an element from a linked list . the pointer - manipulation insanity below is a trick that prevents the " element to be removed is the head of the list " from being a special case .
void client_list_remove(struct pager_client *c)
{
  struct pager_client **ptr;
  if (c == NULL || client_list == NULL)
    return;
  for (ptr = &client_list; *ptr != c; ptr = &((**ptr).next)) {
    if (!*ptr) {
      fprintf(stderr, "trying to remove a client that isn't in the list\n");
      return;
    }
  }
  *ptr = c->next;
}
void client_list_remove ( struct pager_client * c ) { struct pager_client * * ptr ; if ( c == NULL || client_list == NULL ) return ; for ( ptr = & client_list ; * ptr != c ; ptr = & ( ( * * ptr ) . next ) ) { if ( ! * ptr ) { fprintf ( stderr , " \n " ) ; return ; } } * ptr = c -> next ; }
this function removes an element from a linked list.
this function removes an element from a linked list .