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-2004 by 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/rtxCommon.h"
00031 
00050 typedef struct OSRTDListNode {
00051    const void* data;            
00052    struct OSRTDListNode* next; 
00053    struct OSRTDListNode* prev; 
00054 } OSRTDListNode;
00055 
00062 typedef struct OSRTDList {
00063    OSUINT32 count;              
00064    OSRTDListNode* head;         
00065    OSRTDListNode* tail;         
00066 } OSRTDList;
00067 
00068 #ifdef __cplusplus
00069 extern "C" {
00070 #endif
00071 
00072 /* Doubly-linked list functions */
00073 
00090 EXTERNRTX void rtxDListInit (OSRTDList* pList);
00091 
00111 EXTERNRTX OSRTDListNode* rtxDListAppend 
00112 (OSCTXT* pctxt, OSRTDList* pList, const void* pData);
00113 
00114 EXTERNRTX OSRTDListNode* rtxDListAppendNode 
00115 (OSRTDList* pList, OSRTDListNode* pListNode);
00116 
00136 EXTERNRTX OSRTDListNode* rtxDListInsert 
00137 (OSCTXT* pctxt, OSRTDList* pList, int index, const void* pData);
00138 
00139 EXTERNRTX OSRTDListNode* rtxDListInsertNode 
00140 (OSRTDList* pList, int index, OSRTDListNode* pListNode);
00141 
00161 EXTERNRTX OSRTDListNode* rtxDListInsertBefore 
00162 (OSCTXT* pctxt, OSRTDList* pList, OSRTDListNode* node, const void* pData);
00163 
00183 EXTERNRTX OSRTDListNode* rtxDListInsertAfter 
00184 (OSCTXT* pctxt, OSRTDList* pList, OSRTDListNode* node, const void* pData);
00185 
00199 EXTERNRTX OSRTDListNode* rtxDListFindByIndex (OSRTDList* pList, int index); 
00200 
00211 EXTERNRTX OSRTDListNode* rtxDListFindByData (OSRTDList* pList, void* data);
00212 
00223 EXTERNRTX int rtxDListFindIndexByData (OSRTDList* pList, void* data);
00224 
00233 EXTERNRTX void rtxDListRemove (OSRTDList* pList, OSRTDListNode* node);
00234 
00243 EXTERNRTX void rtxDListFreeNodes (OSCTXT* pctxt, OSRTDList* pList);
00244 
00254 EXTERNRTX void rtxDListFreeAll (OSCTXT* pctxt, OSRTDList* pList);
00255 
00273 EXTERNRTX int rtxDListToArray 
00274 (OSCTXT* pctxt, OSRTDList* pList, void** ppArray, 
00275  OSUINT32* pElements, int elemSize);
00276 
00293 EXTERNRTX int rtxDListAppendArray 
00294 (OSCTXT* ctxt_p, OSRTDList* pList, const void* pArray, 
00295  OSUINT32 numElements, int elemSize);
00296 
00312 EXTERNRTX int rtxDListAppendArrayCopy 
00313 (OSCTXT* ctxt_p, OSRTDList* pList, const void* pArray, 
00314  OSUINT32 numElements, int elemSize);
00319 #define OSALLOCELEMDNODE(pctxt,type) \
00320 (type*) (((char*)OSMALLOCZ (pctxt, sizeof(type) + \
00321 sizeof(OSRTDListNode))) + sizeof(OSRTDListNode))
00322 
00323 #ifdef __cplusplus
00324 }
00325 #endif
00326 
00327 #endif

This file was last modified on 1 Jun 2004.
XBinder, Version 1.0.0