rlist_nth(3)

rlist_nth3

Get the nth entry in the list

Usage

#include <roy.h>

void * rlist_nth (RList * list, unsigned int nth);

Overview

This call indexes into list as if it were an array of entries. Entry 1 is accessed with nth of 0, and the last entry is accessed with nth of last - 1.

Return value

The return type of void * is used so the compiler will upgrade the return value to your entry type. As long as the value isn't NULL the value should be compatable with an RListEntry pointer. See rlist(3) on how to create RListEntry compatible entry structs.

This call returns the nth entry in list or NULL if list has nth or fewer entries.

Errors

A call to rlist_nth(3) will never fail, but will return NULL if nth is out of range.

Function

The rlist_nth(3) api is implemented using a function.

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.