/usr/include/hdf/linklist.h is in libhdf4-dev 4.2r4-12build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF. The full HDF copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at *
* http://hdfgroup.org/products/hdf4/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* $Id: linklist.h 4932 2007-09-07 17:17:23Z bmribler $ */
/*-----------------------------------------------------------------------------
* File: linklist.h
* Purpose: header file for linked list API
* Dependencies:
* Invokes:
* Contents:
* Structure definitions:
* Constant definitions:
*---------------------------------------------------------------------------*/
/* avoid re-inclusion */
#ifndef __LINKLIST_H
#define __LINKLIST_H
#include "hdf.h"
/* Definitions for linked-list creation flags */
#define HUL_UNSORTED_LIST 0x0000
#define HUL_SORTED_LIST 0x0001
/* Type of the function to compare objects & keys */
typedef intn (*HULsearch_func_t)(const VOIDP obj, const VOIDP key);
/* Type of the function to compare two objects */
typedef intn (*HULfind_func_t)(const VOIDP obj1, const VOIDP obj2);
/* Linked list information structure used */
typedef struct node_info_struct_tag {
VOIDP *obj_ptr; /* pointer associated with the linked list node */
struct node_info_struct_tag *next; /* link to list node */
}node_info_t;
/* Linked list head structure */
typedef struct list_head_struct_tag {
uintn count; /* # of nodes in the list */
uintn flags; /* list creation flags */
HULfind_func_t cmp_func; /* node comparison function */
node_info_t *node_list; /* pointer to a linked list of nodes */
node_info_t *curr_node; /* pointer to the current node when iterating */
}list_head_t;
#if defined LIST_MASTER | defined LIST_TESTER
/* Define this in only one place */
#ifdef LIST_MASTER
/* Pointer to the list node free list */
static node_info_t *node_free_list=NULL;
#endif /* LIST_MASTER */
/* Useful routines for generally private use */
#endif /* LIST_MASTER | LIST_TESTER */
#if defined c_plusplus || defined __cplusplus
extern "C"
{
#endif /* c_plusplus || __cplusplus */
/******************************************************************************
NAME
HULcreate_list - Create a linked list
DESCRIPTION
Creates a linked list. The list may either be sorted or un-sorted, based
on the comparison function.
RETURNS
Returns a pointer to the list if successful and NULL otherwise
*******************************************************************************/
list_head_t *HULcreate_list(HULfind_func_t find_func /* IN: object comparison function */
);
/******************************************************************************
NAME
HULdestroy_list - Destroys a linked list
DESCRIPTION
Destroys a linked list created by HULcreate_list(). This function
walks through the list and frees all the nodes, then frees the list head.
Note: this function does not (currently) free the objects in the nodes,
it just leaves 'em hanging.
RETURNS
Returns SUCCEED/FAIL.
*******************************************************************************/
intn HULdestroy_list(list_head_t *lst /* IN: list to destroy */
);
/******************************************************************************
NAME
HULadd_node - Adds an object to a linked-list
DESCRIPTION
Adds an object to the linked list. If the list is sorted, the comparison
function is used to determine where to insert the node, otherwise it is
inserted at the head of the list.
RETURNS
Returns SUCCEED/FAIL.
*******************************************************************************/
intn HULadd_node(list_head_t *lst, /* IN: list to modify */
VOIDP obj /* IN: object to add to the list */
);
/******************************************************************************
NAME
HULsearch_node - Search for an object in a linked-list
DESCRIPTION
Locate an object in a linked list using a key and comparison function.
RETURNS
Returns a pointer to the object found in the list, or NULL on failure.
*******************************************************************************/
VOIDP HULsearch_node(list_head_t *lst, /* IN: list to search */
HULsearch_func_t srch_func, /* IN: function to use to find node */
VOIDP key /* IN: key of object to search for */
);
/******************************************************************************
NAME
HULfirst_node - Get the first object in a linked-list
DESCRIPTION
Returns the first object in a linked-list and prepares the list for
interating through.
RETURNS
Returns a pointer to the first object found in the list, or NULL on failure.
*******************************************************************************/
VOIDP HULfirst_node(list_head_t *lst /* IN: list to search */
);
/******************************************************************************
NAME
HULnext_node - Get the next object in a linked-list
DESCRIPTION
Returns the next object in a linked-list by walking through the list
RETURNS
Returns a pointer to the next object found in the list, or NULL on failure.
*******************************************************************************/
VOIDP HULnext_node(list_head_t *lst /* IN: list to search */
);
/******************************************************************************
NAME
HULremove_node - Removes an object from a linked-list
DESCRIPTION
Remove an object from a linked list. The key and comparison function are
provided locate the object to delete.
RETURNS
Returns a pointer to the object deleted from the list, or NULL on failure.
*******************************************************************************/
VOIDP HULremove_node(list_head_t *lst, /* IN: list to modify */
HULsearch_func_t srch_func, /* IN: function to use to find node to remove */
VOIDP key /* IN: object to add to the list */
);
/*--------------------------------------------------------------------------
NAME
HULshutdown
PURPOSE
Terminate various global items.
USAGE
intn HULshutdown()
RETURNS
Returns SUCCEED/FAIL
DESCRIPTION
Free various buffers allocated in the HUL routines.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
Should only ever be called by the "atexit" function HDFend
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
intn
HULshutdown(void);
#if defined c_plusplus || defined __cplusplus
}
#endif /* c_plusplus || __cplusplus */
#endif /* __LINKLIST_H */
|