dapl_llist.c revision 9e39c5ba00a55fa05777cc94b148296af305e135
1N/A * The contents of this file are subject to the terms of the 1N/A * Common Development and Distribution License (the "License"). 1N/A * You may not use this file except in compliance with the License. 1N/A * See the License for the specific language governing permissions 1N/A * and limitations under the License. 1N/A * When distributing Covered Code, include this CDDL HEADER in each 1N/A * If applicable, add the following below this CDDL HEADER, with the 1N/A * fields enclosed by brackets "[]" replaced with your own identifying 1N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1N/A * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved. 1N/A * Copyright 2003 Sun Microsystems, Inc. All rights reserved. 1N/A * Use is subject to license terms. 1N/A * PURPOSE: Manage doubly linked lists within the DAPL Reference Implementation 1N/A * A link list head points to the first member of a linked list, but 1N/A * is itself not a member of the list. 1N/A * +---------------------------------------------+ 1N/A * | entry entry entry | 1N/A * HEAD -> | +-------+ +-------+ +-------+ | 1N/A * +--> | flink | --> | flink | --> | flink | >--+ 1N/A * | data | | data | | data | 1N/A * +--< | blink | <-- | blink | <-- | blink | <--| 1N/A * | +-------+ +-------+ +-------+ | 1N/A * +---------------------------------------------+ 1N/A * Note: Each of the remove functions takes an assertion failure if 1N/A * an element cannot be removed from the list. 1N/A * dapl_llist_init_head() 1N/A * Purpose: initialize a linked list head 1N/A * dapl_llist_init_entry() 1N/A * Purpose: initialize a linked list entry 1N/A * dapl_llist_is_empty() 1N/A * Purpose: returns TRUE if the linked list is empty 1N/A * dapl_llist_add_head() 1N/A * Purpose: Add an entry to the head of a linked list 1N/A /* deal with empty list */ 1N/A * dapl_llist_add_tail() 1N/A * Purpose: Add an entry to the tail of a linked list /* deal with empty list */ * Purpose: Add an entry before an element in the list /* deal with empty list */ * dapl_llist_remove_head() * Purpose: Remove the first entry of a linked list /* clean up the links for good measure */ * dapl_llist_remove_tail() * Purpose: Remove the last entry of a linked list /* clean up the links for good measure */ * dapl_llist_remove_entry() * Purpose: Remove the specified entry from a linked list /* if it's the first entry, pull it off */ /* if it was the only entry, kill the list */ * not finding the element on the list #
endif /* VERIFY_LINKED_LIST */ * Obtain the next entry in the list, return NULL when we get to the * dapl_llist_debug_print_list() * Purpose: Prints the linked list for debugging