rlist_compare(3)

rlist_compare3

Compare two lists for equality

Usage

#include <roy.h>

typedef int (*RListComparatorFunction) (RListEntry *entry_a, RListEntry *entry_b);

int rlist_compare (RList * list_1, RList * list_2, RListComparatorFunction comparator);

Overview

This call compares two lists for equality. Comparison stops immediatly if the two lists are of different length. Otherwise, each entry pair in the two lists are passed two by two into the comparator function as entry_a and entry_b. If the comparator function returns non zero at any point the comparison stops.

The comparator function should not return -1 because -1 is reserved for unequal length lists.

Return value

The return of -1 indicates that list_1 and list_2 are of different lengths. If the comparitor function returns anthing other than zero (0) then the rlist_compare(3) call returns the same value, even if that value is -1. A return value of zero (0) indicates that the two lists are equal, anything else means they are unequal.

Errors

A call to rlist_compare(3) will never fail.

Function

The rlist_compare(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.