All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
le_singlyLinkedList.h
Go to the documentation of this file.
1 
176 #ifndef LEGATO_SINGLY_LINKED_LIST_INCLUDE_GUARD
177 #define LEGATO_SINGLY_LINKED_LIST_INCLUDE_GUARD
178 
179 
180 //--------------------------------------------------------------------------------------------------
189 //--------------------------------------------------------------------------------------------------
190 typedef struct le_sls_Link
191 {
192  struct le_sls_Link* nextPtr;
193 }
195 
196 
197 //--------------------------------------------------------------------------------------------------
204 //--------------------------------------------------------------------------------------------------
205 typedef struct
206 {
208 }
210 
211 
212 //--------------------------------------------------------------------------------------------------
217 //--------------------------------------------------------------------------------------------------
218 #define LE_SLS_LIST_INIT (le_sls_List_t){NULL}
219 
220 
221 //--------------------------------------------------------------------------------------------------
226 //--------------------------------------------------------------------------------------------------
227 #define LE_SLS_LINK_INIT (le_sls_Link_t){NULL}
228 
229 
230 //--------------------------------------------------------------------------------------------------
234 //--------------------------------------------------------------------------------------------------
235 void le_sls_Stack
236 (
237  le_sls_List_t* listPtr,
238  le_sls_Link_t* newLinkPtr
239 );
240 
241 
242 //--------------------------------------------------------------------------------------------------
246 //--------------------------------------------------------------------------------------------------
247 void le_sls_Queue
248 (
249  le_sls_List_t* listPtr,
250  le_sls_Link_t* newLinkPtr
251 );
252 
253 
254 //--------------------------------------------------------------------------------------------------
259 //--------------------------------------------------------------------------------------------------
260 void le_sls_AddAfter
261 (
262  le_sls_List_t* listPtr,
263  le_sls_Link_t* currentLinkPtr,
264  le_sls_Link_t* newLinkPtr
265 );
266 
267 
268 //--------------------------------------------------------------------------------------------------
277 //--------------------------------------------------------------------------------------------------
279 (
280  le_sls_List_t* listPtr,
281  le_sls_Link_t* currentLinkPtr
282 );
284 
285 
286 //--------------------------------------------------------------------------------------------------
294 //--------------------------------------------------------------------------------------------------
296 (
297  le_sls_List_t* listPtr
298 );
299 
300 
301 //--------------------------------------------------------------------------------------------------
309 //--------------------------------------------------------------------------------------------------
311 (
312  const le_sls_List_t* listPtr
313 );
314 
315 
316 //--------------------------------------------------------------------------------------------------
327 //--------------------------------------------------------------------------------------------------
329 (
330  const le_sls_List_t* listPtr,
331  const le_sls_Link_t* currentLinkPtr
332 );
333 
334 
335 //--------------------------------------------------------------------------------------------------
342 //--------------------------------------------------------------------------------------------------
343 static inline bool le_sls_IsEmpty
344 (
345  const le_sls_List_t* listPtr
346 )
347 //--------------------------------------------------------------------------------------------------
348 {
349  return (le_sls_Peek(listPtr) == NULL);
350 }
351 
352 
353 //--------------------------------------------------------------------------------------------------
361 //--------------------------------------------------------------------------------------------------
362 bool le_sls_IsInList
363 (
364  const le_sls_List_t* listPtr,
365  const le_sls_Link_t* linkPtr
366 );
367 
368 
369 //--------------------------------------------------------------------------------------------------
376 //--------------------------------------------------------------------------------------------------
377 size_t le_sls_NumLinks
378 (
379  const le_sls_List_t* listPtr
380 );
381 
382 
383 //--------------------------------------------------------------------------------------------------
391 //--------------------------------------------------------------------------------------------------
393 (
394  const le_sls_List_t* listPtr
395 );
396 
397 
398 #endif // LEGATO_SINGLY_LINKED_LIST_INCLUDE_GUARD
399 
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:344
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:207
size_t le_sls_NumLinks(const le_sls_List_t *listPtr)
Definition: le_singlyLinkedList.h:205
void le_sls_Stack(le_sls_List_t *listPtr, le_sls_Link_t *newLinkPtr)