dl_flush()

dl_flush()#

Removes all items from the given double-linked list and optionally frees them using the provided function.

Prototype

void dl_flush(
    dl_list_t *dl,
    void (*fnfree)(void *)
);

Parameters

Key

Type

Description

dl

dl_list_t *

Pointer to the double-linked list to be flushed.

fnfree

void (*)(void *)

Function pointer to a deallocation function for freeing each item, or NULL if no deallocation is needed.


Return Value

None.

Notes

Ensures that the list is completely emptied. If fnfree is provided, it is called for each item before removal.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples