rlist_free(3)

rlist_free3

Free a dynamicly allocated rlist

Usage

#include <roy.h>

void rlist_free (RList * list);

Overview

Free the dynamic rlist list that was allocated using rlist_new(3). This will NOT free the items of the list. You should use RLIST_FOREACH to visit each entry, rlist_remove(3) to unlink each entry, and a call to your entry destructor to free the item's memory before calling rlist_free(3).

If list wasn't dynamicly allocated using rlist_new(3) then it should be destroyed using the RLIST_DESTRUCT macro, see rlist(3).

EXAMPLE

This is the proper way to destory the full rlist.

        RLIST_FOREACH (list, entry) {
                rlist_remove (entry);
                rmem_free (entry);      /* Opposite of rmem_new(3). */
        } RFOREACH_CLOSE;
        rlist_free (list);              /* Do this last. */

Return value

This call doesn't return any value.

Errors

A call to rlist_free(3) will never fail.

Macro

The rlist_free(3) api is implemented using a macro.

Releases

2 releases since Debian 3.0 (Woody); the text changed 1 time.

  1. 3.0
  2. 3.1

From libroy-dev 1.0.8-1 in Debian 3.1 (Sarge). Parsed by carta from the page's man source.