Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

rtxDList.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2006 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00027 #ifndef _RTXDLIST_H_
00028 #define _RTXDLIST_H_
00029 
00030 #include "rtxsrc/rtxCommonDefs.h"
00031 #include "rtxsrc/rtxSysTypes.h"
00032 
00051 typedef struct OSRTDListNode {
00052    void* data;            
00053    struct OSRTDListNode* next; 
00054    struct OSRTDListNode* prev; 
00055 } OSRTDListNode;
00056 
00063 typedef struct OSRTDList {
00064    OSUINT32 count;              
00065    OSRTDListNode* head;         
00066    OSRTDListNode* tail;         
00067 } OSRTDList;
00068 
00069 struct OSCTXT;
00070 
00071 #ifdef __cplusplus
00072 extern "C" {
00073 #endif
00074 
00075 /* Doubly-linked list functions */
00076 
00093 EXTERNRTX void rtxDListInit (OSRTDList* pList);
00094 
00114 EXTERNRTX OSRTDListNode* rtxDListAppend 
00115 (struct OSCTXT* pctxt, OSRTDList* pList, void* pData);
00116 
00117 EXTERNRTX OSRTDListNode* rtxDListAppendNode 
00118 (OSRTDList* pList, OSRTDListNode* pListNode);
00119 
00139 EXTERNRTX OSRTDListNode* rtxDListInsert 
00140 (struct OSCTXT* pctxt, OSRTDList* pList, int index, void* pData);
00141 
00142 EXTERNRTX OSRTDListNode* rtxDListInsertNode 
00143 (OSRTDList* pList, int index, OSRTDListNode* pListNode);
00144 
00164 EXTERNRTX OSRTDListNode* rtxDListInsertBefore 
00165 (struct OSCTXT* pctxt, OSRTDList* pList, OSRTDListNode* node, void* pData);
00166 
00186 EXTERNRTX OSRTDListNode* rtxDListInsertAfter 
00187 (struct OSCTXT* pctxt, OSRTDList* pList, OSRTDListNode* node, void* pData);
00188 
00202 EXTERNRTX OSRTDListNode* rtxDListFindByIndex (const OSRTDList* pList, int index); 
00203 
00214 EXTERNRTX OSRTDListNode* rtxDListFindByData (const OSRTDList* pList, void* data);
00215 
00226 EXTERNRTX int rtxDListFindIndexByData (const OSRTDList* pList, void* data);
00227 
00237 EXTERNRTX void rtxDListFreeNode
00238    (struct OSCTXT* pctxt, OSRTDList* pList, OSRTDListNode* node);
00239 
00248 EXTERNRTX void rtxDListRemove (OSRTDList* pList, OSRTDListNode* node);
00249 
00258 EXTERNRTX void rtxDListFreeNodes (struct OSCTXT* pctxt, OSRTDList* pList);
00259 
00269 EXTERNRTX void rtxDListFreeAll (struct OSCTXT* pctxt, OSRTDList* pList);
00270 
00288 EXTERNRTX int rtxDListToArray 
00289 (struct OSCTXT* pctxt, OSRTDList* pList, void** ppArray, 
00290  OSUINT32* pElements, int elemSize);
00291 
00308 EXTERNRTX int rtxDListAppendArray 
00309 (struct OSCTXT* ctxt_p, OSRTDList* pList, void* pArray, 
00310  OSUINT32 numElements, int elemSize);
00311 
00327 EXTERNRTX int rtxDListAppendArrayCopy 
00328 (struct OSCTXT* ctxt_p, OSRTDList* pList, const void* pArray, 
00329  OSUINT32 numElements, int elemSize);
00334 #define rtxDListAppendData(pctxt,pList,pData) do { \
00335 OSRTDListNode* _node = (OSRTDListNode*) (((char*)(pData)) - sizeof(OSRTDListNode)); \
00336 _node->data = pData; \
00337 rtxDListAppendNode (pList, _node); \
00338 } while (0);
00339 
00340 #define rtxDListFastInit(pList) do {\
00341 if ((pList) != 0) { \
00342 (pList)->head = (pList)->tail = (OSRTDListNode*) 0; \
00343 (pList)->count = 0; } \
00344 } while (0)
00345 
00346 #ifdef __cplusplus
00347 }
00348 #endif
00349 
00350 #endif

This file was last modified on 8 Jan 2007.
XBinder, Version 1.1.9