00001 00008 /* 00009 * COPYRIGHT (c) 1989-2006. 00010 * On-Line Applications Research Corporation (OAR). 00011 * 00012 * The license and distribution terms for this file may be 00013 * found in the file LICENSE in this distribution or at 00014 * http://www.rtems.com/license/LICENSE. 00015 * 00016 * $Id: chain.h,v 1.22 2007/03/13 05:17:12 ralf Exp $ 00017 */ 00018 00019 #ifndef _RTEMS_SCORE_CHAIN_H 00020 #define _RTEMS_SCORE_CHAIN_H 00021 00033 #ifdef __cplusplus 00034 extern "C" { 00035 #endif 00036 00037 #include <rtems/score/address.h> 00038 00047 typedef struct Chain_Node_struct Chain_Node; 00048 00064 struct Chain_Node_struct { 00066 Chain_Node *next; 00068 Chain_Node *previous; 00069 }; 00070 00087 typedef struct { 00089 Chain_Node *first; 00091 Chain_Node *permanent_null; 00093 Chain_Node *last; 00094 } Chain_Control; 00095 00109 void _Chain_Initialize( 00110 Chain_Control *the_chain, 00111 void *starting_address, 00112 size_t number_nodes, 00113 size_t node_size 00114 ); 00115 00125 void _Chain_Extract( 00126 Chain_Node *the_node 00127 ); 00128 00141 Chain_Node *_Chain_Get( 00142 Chain_Control *the_chain 00143 ); 00144 00154 void _Chain_Insert( 00155 Chain_Node *after_node, 00156 Chain_Node *the_node 00157 ); 00158 00167 void _Chain_Append( 00168 Chain_Control *the_chain, 00169 Chain_Node *the_node 00170 ); 00171 00172 #ifndef __RTEMS_APPLICATION__ 00173 #include <rtems/score/chain.inl> 00174 #endif 00175 00176 #ifdef __cplusplus 00177 } 00178 #endif 00179 00182 #endif 00183 /* end of include file */
1.5.6