librnr/dlistvoid.c
DListVoidNode_T *DListVoidFindNode(DListVoid_T *pHead, const void *pData)
{
  dnode_t         *p, *q, *head;
  DListVoidNode_T *pNode;

  LOGDIAG4CALL(_TPTR(pHead), _TPTR(pData));

  CHKPTR(pHead, NULL);

  if( pHead->m_fnDataCmp == NULL )
  {
    return NULL;
  }

  head = &(pHead->m_dnodeHead);

  dlist_for_each_safe(p, q, head)
  {
    pNode = DLISTVOID_ENTRY(p);
    if( !pHead->m_fnDataCmp(pData, pNode->m_pData) )
    {
      return pNode;
    }
  }
  return NULL;
}
/*!
 * \brief Find the first node with the matching data.
 *
 * The user provided comparator function is used, if any.
 *
 * \param pHead   Pointer to dlist (head).
 * \param pData   Pointer to data to find.
 *
 * \return Returns first node with mathcing data on success, NULL if
 * no matches or on error.
 */
\brief Find the first node with the matching data.
The user provided comparator function is used, if any.

\param pHead   Pointer to dlist (head).
\param pData   Pointer to data to find.

\return Returns first node with mathcing data on success, NULL if
no matches or on error.
\ brief Find the first node with the matching data . The user provided comparator function is used if any . \ param pHead Pointer to dlist ( head ) . \ param pData Pointer to data to find . \ return Returns first node with mathcing data on success NULL if no matches or on error .
DListVoidNode_T *DListVoidFindNode(DListVoid_T *pHead, const void *pData)
{
  dnode_t         *p, *q, *head;
  DListVoidNode_T *pNode;
  LOGDIAG4CALL(_TPTR(pHead), _TPTR(pData));
  CHKPTR(pHead, NULL);
  if( pHead->m_fnDataCmp == NULL )
  {
    return NULL;
  }
  head = &(pHead->m_dnodeHead);
  dlist_for_each_safe(p, q, head)
  {
    pNode = DLISTVOID_ENTRY(p);
    if( !pHead->m_fnDataCmp(pData, pNode->m_pData) )
    {
      return pNode;
    }
  }
  return NULL;
}
DListVoidNode_T * DListVoidFindNode ( DListVoid_T * pHead , const void * pData ) { dnode_t * p , * q , * head ; DListVoidNode_T * pNode ; LOGDIAG4CALL ( _TPTR ( pHead ) , _TPTR ( pData ) ) ; CHKPTR ( pHead , NULL ) ; if ( pHead -> m_fnDataCmp == NULL ) { return NULL ; } head = & ( pHead -> m_dnodeHead ) ; dlist_for_each_safe ( p , q , head ) { pNode = DLISTVOID_ENTRY ( p ) ; if ( ! pHead -> m_fnDataCmp ( pData , pNode -> m_pData ) ) { return pNode ; } } return NULL ; }
\brief Find the first node with the matching data.
\ brief Find the first node with the matching data .