---
name: "rlist_first"
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_first"
---

# rlist\_first(3)

get the head or tail entry in the list

## NAME

rlist\_first, rlist\_last - get the head or tail entry in the list

## SYNOPSIS

\#include \<roy.h\>

void \* rlist\_first (RList \* *list*); void \* rlist\_last (RList \* *list*);

## DESCRIPTION

This call gets the first or last (head or tail) of the list respectively.

## RETURN VALUE

Returns the first or last entry in the list, or NULL if there are no items in the list. has *nth* or fewer entries.

## ERRORS

A call to [*rlist\_first*(3)](/rlist_first/3.md) or [*rlist\_last*(3)](/rlist_last/3.md) will never fail.  If *list* is uninitialized, it will likely cause invalid memory access.

## MACROS

[*rlist\_first*(3)](/rlist_first/3.md) and [*rlist\_last*(3)](/rlist_last/3.md) are implemented as macros.

## SEE ALSO

[*rlist*(3)](/rlist/3.md), [*rlist\_append*(3)](/rlist_append/3.md),  [*rlist\_compare*(3)](/rlist_compare/3.md), [*rlist\_free*(3)](/rlist_free/3.md),  [*rlist\_last*(3)](/rlist_last/3.md), [*rlist\_new*(3)](/rlist_new/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)
