Пример #1
0
ICELIB_LIST_PAIR*
pICELIB_triggeredfifoIteratorNext(ICELIB_CHECKLIST*               checkList,
                                  ICELIB_CALLBACK_LOG*            callbackLog,
                                  ICELIB_TRIGGERED_FIFO_ITERATOR* iterator)
{
  uint32_t*         pairId;
  ICELIB_LIST_PAIR* pair = NULL;

  pairId = pICELIB_fifoIteratorNext(iterator);

  if (pairId != NULL)
  {

    pair = ICELIB_getPairById(checkList, *pairId);

    if (pair == NULL)
    {
      ICELIB_log1(callbackLog,
                  ICELIB_logDebug,
                  "Could not find pair by Id: %u",
                  *pairId);
    }
  }

  return pair;
}
Пример #2
0
void ICELIB_triggeredFifoRemove(ICELIB_TRIGGERED_FIFO *fifo,
                                ICELIB_LIST_PAIR      *pair)
{
    uint32_t                        *pairId;
    ICELIB_TRIGGERED_FIFO_ITERATOR  tfIterator;

    ICELIB_fifoIteratorConstructor(&tfIterator, fifo);

    while ((pairId = pICELIB_fifoIteratorNext(&tfIterator)) != NULL) {
        if (*pairId == pair->pairId) {
            *pairId = ICELIB_FIFO_ELEMENT_REMOVED;
        }
    }
}
Пример #3
0
bool ICELIB_isTriggeredFifoPairPresent(ICELIB_TRIGGERED_FIFO *fifo,
                                       ICELIB_LIST_PAIR      *pair,
                                       ICELIB_CALLBACK_LOG   *callbackLog)
{
    uint32_t                        *pairId;
    ICELIB_TRIGGERED_FIFO_ITERATOR  tfIterator;

    ICELIB_fifoIteratorConstructor(&tfIterator, fifo);

    while ((pairId = pICELIB_fifoIteratorNext(&tfIterator)) != NULL) {
        if (*pairId == pair->pairId) {
            ICELIB_log(callbackLog, ICELIB_logDebug, "pair already present in FIFO");
            return true;
        }
    }
    return false;
}