void dListFindAndRemove(DList* pList, void *data) { DListNode *pNode, *pNextNode; for(pNode = pList->head; pNode !=0; pNode = pNextNode){ pNextNode = pNode->next; if(pNode->data == data) /* pointer comparison*/ break; } if(pNode) dListRemove(pList, pNode); }
void* dListDeleteHead (OOCTXT* pctxt, DList* pList) { DListNode* pNode = (0 != pList) ? pList->head : 0; if (0 != pNode) { void* pdata = pNode->data; dListRemove (pList, pNode); memFreePtr (pctxt, pNode); return pdata; } return 0; }
void dListFindAndRemove(struct OOCTXT* pctxt, DList* pList, void *data) { DListNode *pNode, *pNextNode; for(pNode = pList->head; pNode !=0; pNode = pNextNode){ pNextNode = pNode->next; if(pNode->data == data) /* pointer comparison*/ break; } if(pNode) { dListRemove(pList, pNode); memFreePtr(pctxt, pNode); } }