man rlist_nth (Fonctions bibliothèques) - get the nth entry in the list

NAME

rlist_nth - get the nth entry in the list

SYNOPSIS

#include <roy.h>

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

DESCRIPTION

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.

SEE ALSO