le_singlyLinkedList.h
Go to the documentation of this file.
1 
167 #ifndef LEGATO_SINGLY_LINKED_LIST_INCLUDE_GUARD
168 #define LEGATO_SINGLY_LINKED_LIST_INCLUDE_GUARD
169 
170 
171 //--------------------------------------------------------------------------------------------------
180 //--------------------------------------------------------------------------------------------------
181 typedef struct le_sls_Link
182 {
183  struct le_sls_Link* nextPtr;
184 }
186 
187 
188 //--------------------------------------------------------------------------------------------------
195 //--------------------------------------------------------------------------------------------------
196 typedef struct
197 {
199 }
201 
202 
203 //--------------------------------------------------------------------------------------------------
208 //--------------------------------------------------------------------------------------------------
209 #define LE_SLS_LIST_INIT (le_sls_List_t){NULL}
210 
211 
212 //--------------------------------------------------------------------------------------------------
217 //--------------------------------------------------------------------------------------------------
218 #define LE_SLS_LINK_INIT (le_sls_Link_t){NULL}
219 
220 
221 //--------------------------------------------------------------------------------------------------
225 //--------------------------------------------------------------------------------------------------
226 void le_sls_Stack
227 (
228  le_sls_List_t* listPtr,
229  le_sls_Link_t* newLinkPtr
230 );
231 
232 
233 //--------------------------------------------------------------------------------------------------
237 //--------------------------------------------------------------------------------------------------
238 void le_sls_Queue
239 (
240  le_sls_List_t* listPtr,
241  le_sls_Link_t* newLinkPtr
242 );
243 
244 
245 //--------------------------------------------------------------------------------------------------
250 //--------------------------------------------------------------------------------------------------
251 void le_sls_AddAfter
252 (
253  le_sls_List_t* listPtr,
254  le_sls_Link_t* currentLinkPtr,
255  le_sls_Link_t* newLinkPtr
256 );
257 
258 
259 //--------------------------------------------------------------------------------------------------
268 //--------------------------------------------------------------------------------------------------
270 (
271  le_sls_List_t* listPtr,
272  le_sls_Link_t* currentLinkPtr
273 );
275 
276 
277 //--------------------------------------------------------------------------------------------------
285 //--------------------------------------------------------------------------------------------------
287 (
288  le_sls_List_t* listPtr
289 );
290 
291 
292 //--------------------------------------------------------------------------------------------------
300 //--------------------------------------------------------------------------------------------------
302 (
303  const le_sls_List_t* listPtr
304 );
305 
306 
307 //--------------------------------------------------------------------------------------------------
318 //--------------------------------------------------------------------------------------------------
320 (
321  const le_sls_List_t* listPtr,
322  const le_sls_Link_t* currentLinkPtr
323 );
324 
325 
326 //--------------------------------------------------------------------------------------------------
333 //--------------------------------------------------------------------------------------------------
334 static inline bool le_sls_IsEmpty
335 (
336  const le_sls_List_t* listPtr
337 )
338 //--------------------------------------------------------------------------------------------------
339 {
340  return (le_sls_Peek(listPtr) == NULL);
341 }
342 
343 
344 //--------------------------------------------------------------------------------------------------
352 //--------------------------------------------------------------------------------------------------
353 bool le_sls_IsInList
354 (
355  const le_sls_List_t* listPtr,
356  const le_sls_Link_t* linkPtr
357 );
358 
359 
360 //--------------------------------------------------------------------------------------------------
367 //--------------------------------------------------------------------------------------------------
368 size_t le_sls_NumLinks
369 (
370  const le_sls_List_t* listPtr
371 );
372 
373 
374 //--------------------------------------------------------------------------------------------------
382 //--------------------------------------------------------------------------------------------------
384 (
385  const le_sls_List_t* listPtr
386 );
387 
388 
389 #endif // LEGATO_SINGLY_LINKED_LIST_INCLUDE_GUARD
390 
void le_sls_Queue(le_sls_List_t *listPtr, le_sls_Link_t *newLinkPtr)
static bool le_sls_IsEmpty(const le_sls_List_t *listPtr)
Definition: le_singlyLinkedList.h:335
bool le_sls_IsInList(const le_sls_List_t *listPtr, const le_sls_Link_t *linkPtr)
le_sls_Link_t * le_sls_RemoveAfter(le_sls_List_t *listPtr, le_sls_Link_t *currentLinkPtr)
le_sls_Link_t * le_sls_PeekNext(const le_sls_List_t *listPtr, const le_sls_Link_t *currentLinkPtr)
le_sls_Link_t * le_sls_Peek(const le_sls_List_t *listPtr)
le_sls_Link_t * le_sls_Pop(le_sls_List_t *listPtr)
void le_sls_AddAfter(le_sls_List_t *listPtr, le_sls_Link_t *currentLinkPtr, le_sls_Link_t *newLinkPtr)
bool le_sls_IsListCorrupted(const le_sls_List_t *listPtr)
le_sls_Link_t * tailLinkPtr
Tail link pointer.
Definition: le_singlyLinkedList.h:198
size_t le_sls_NumLinks(const le_sls_List_t *listPtr)
Definition: le_singlyLinkedList.h:196
void le_sls_Stack(le_sls_List_t *listPtr, le_sls_Link_t *newLinkPtr)