---
name: "rlist_new"
section: "3"
platform: "linux"
package: "libroy-dev"
version: "1.0.8-1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/rlist_new"
---

# rlist\_new(3)

allocate a new rlist head

## NAME

rlist\_new - allocate a new rlist head

## SYNOPSIS

\#include \<roy.h\>

RList \* rlist\_new (void);

## DESCRIPTION

Create a new toplevel struct to hold an rlist. This rlist is a doublely linked list that has both a head and a tail pointer.  The RList struct is always the head of the rlist and should not be confused with an rlist entry struct, see [*rlist*(3)](/rlist/3.md).

## RETURN VALUE

This function should always succeed in returning an empty newly allocated RList pointer. This pointer is considered to be dynamicly allocated and should be freed by a call to [*rlist\_free*(3)](/rlist_free/3.md).  For static allocation of an RList see [*rlist*(3)](/rlist/3.md).

## ERRORS

The [*rlist\_new*(3)](/rlist_new/3.md) call will never return any failure condition. Any out of memory issues are delt with by [*rmem*(3)](/rmem/3.md) functions.

## MACRO

The [*rlist\_new*(3)](/rlist_new/3.md) api is implemented using a macro.

## SEE ALSO

[*rlist*(3)](/rlist/3.md), [*rlist\_append*(3)](/rlist_append/3.md),  [*rlist\_compare*(3)](/rlist_compare/3.md), [*rlist\_first*(3)](/rlist_first/3.md),  [*rlist\_free*(3)](/rlist_free/3.md), [*rlist\_last*(3)](/rlist_last/3.md),  [*rlist\_next*(3)](/rlist_next/3.md), [*rlist\_nth*(3)](/rlist_nth/3.md),  [*rlist\_prepend*(3)](/rlist_prepend/3.md), [*rlist\_prev*(3)](/rlist_prev/3.md),  [*rlist\_remove*(3)](/rlist_remove/3.md), [*roy*(3)](/roy/3.md)
