00001 00009 /* 00010 * ============================================================================ 00011 * 00012 * Copyright (c) 2008-2012, Texas Instruments Incorporated 00013 * 00014 * Redistribution and use in source and binary forms, with or without 00015 * modification, are permitted provided that the following conditions 00016 * are met: 00017 * 00018 * * Redistributions of source code must retain the above copyright 00019 * notice, this list of conditions and the following disclaimer. 00020 * 00021 * * Redistributions in binary form must reproduce the above copyright 00022 * notice, this list of conditions and the following disclaimer in the 00023 * documentation and/or other materials provided with the distribution. 00024 * 00025 * * Neither the name of Texas Instruments Incorporated nor the names of 00026 * its contributors may be used to endorse or promote products derived 00027 * from this software without specific prior written permission. 00028 * 00029 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00030 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00031 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00032 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00033 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00034 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00035 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00036 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00037 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00038 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00039 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00040 * Contact information for paper mail: 00041 * Texas Instruments 00042 * Post Office Box 655303 00043 * Dallas, Texas 75265 00044 * Contact information: 00045 * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm? 00046 * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact 00047 * ============================================================================ 00048 * 00049 */ 00050 00051 00052 00053 #ifndef LIST_H_0XB734 00054 #define LIST_H_0XB734 00055 00056 00057 00058 #if defined (__cplusplus) 00059 extern "C" { 00060 #endif 00061 00062 00063 /* ============================================================================= 00064 * Macros and types 00065 * ============================================================================= 00066 */ 00071 #define List_traverse(x,y) for(x = (List_Elem *)((List_Object *)y)->elem.next; \ 00072 (UInt32) x != (UInt32)&((List_Object *)y)->elem;\ 00073 x = x->next) 00074 00078 typedef struct List_Elem_tag { 00079 struct List_Elem_tag * next; 00080 struct List_Elem_tag * prev; 00081 } List_Elem; 00082 00086 typedef struct List_Object_tag { 00087 List_Elem elem; 00089 } List_Object; 00090 00092 typedef List_Object * List_Handle; 00093 00097 typedef struct List_Params_tag { 00098 UInt32 temp; 00099 } List_Params; 00100 00101 00102 /* ============================================================================= 00103 * APIs 00104 * ============================================================================= 00105 */ 00114 Void List_Params_init (List_Params * params); 00115 00126 List_Handle List_create (List_Params * params, Error_Block *eb); 00127 00135 Void List_delete (List_Handle * handlePtr); 00136 00148 Void List_construct (List_Object * obj, List_Params * params); 00149 00157 Void List_destruct (List_Object * obj); 00158 00166 Void List_elemClear (List_Elem * elem); 00167 00178 Bool List_empty (List_Handle handle); 00179 00190 Ptr List_get (List_Handle handle); 00191 00200 Void List_put (List_Handle handle, List_Elem * elem); 00201 00214 Ptr List_next (List_Handle handle, List_Elem * elem); 00215 00228 Ptr List_prev (List_Handle handle, List_Elem * elem); 00229 00240 Void List_insert (List_Handle handle, List_Elem * newElem, List_Elem * curElem); 00241 00250 Void List_remove (List_Handle handle, List_Elem * elem); 00251 00260 Void List_putHead (List_Handle handle, List_Elem * elem); 00261 00272 Ptr List_dequeue (List_Handle handle); 00273 00282 Void List_enqueue (List_Handle handle, List_Elem * elem); 00283 00292 Void List_enqueueHead (List_Handle handle, List_Elem * elem); 00293 00294 00295 #if defined (__cplusplus) 00296 } 00297 #endif /* defined (__cplusplus) */ 00298 00299 00300 #endif /* LIST_H_0XB734 */