/******************************************************************************* ################################################################################ # Copyright (c) [2017-2019] [Radisys] # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # # You may obtain a copy of the License at # # # # http://www.apache.org/licenses/LICENSE-2.0 # # # # Unless required by applicable law or agreed to in writing, software # # distributed under the License is distributed on an "AS IS" BASIS, # # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ *******************************************************************************/ /********************************************************************20** Name: common - linked list functions Type: C include file Desc: macros for linked list functions File: cm_llist.h *********************************************************************21*/ #ifndef __CMLLISTH__ #define __CMLLISTH__ /* cm_llist_h_001.main_8 */ #define cmLListFirst(l) ((l)->crnt = (l)->first) #define cmLListLast(l) ((l)->crnt = (l)->last) #define cmLListCrnt(l) ((l)->crnt) #define cmLListNext(l) ((l)->crnt = ((l)->crnt ? (l)->crnt->next : \ (l)->first)) #define cmLListPrev(l) ((l)->crnt = ((l)->crnt ? (l)->crnt->prev : \ (l)->first)) #define cmLListLen(l) ((l)->count) #define cmLListNode(n) ((n)->node) /* cm_llist_h_001.main_9 : added explicit check for warning fix */ #ifndef __cplusplus #define CM_LLIST_FIRST_NODE(l, n) ((((n) = cmLListFirst(l)) != NULLP) ? (n)->node : NULLP) #define CM_LLIST_NEXT_NODE(l, n) ((((n) = cmLListNext(l))!= NULLP) ? (n)->node : NULLP) #define CM_LLIST_PREV_NODE(l, n) ((((n) = cmLListPrev(l)) != NULLP) ? (n)->node : NULLP) #else #define CM_LLIST_FIRST_NODE(l, n) ((n) = cmLListFirst(l)) #define CM_LLIST_NEXT_NODE(l, n) ((n) = cmLListNext(l)) #define CM_LLIST_PREV_NODE(l, n) ((n) = cmLListPrev(l)) #endif #endif /* __CMLLISTH__ */ /********************************************************************30** End of file **********************************************************************/