pelib  2.0.0
include/pelib/set.h File Reference
#include <pelib/template.h>
#include <pelib/structure.h>
Include dependency graph for set.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define set(elem)   PELIB_CONCAT_2(set_, elem)
#define set_t(elem)   PELIB_CONCAT_2(set(elem), _t)
#define pelib_set_first(elem)   PELIB_CONCAT_3(pelib_, set(elem), _first)
#define pelib_set_last(elem)   PELIB_CONCAT_3(pelib_, set(elem), _last)
#define pelib_set_insert(elem)   PELIB_CONCAT_3(pelib_, set(elem), _insert)
#define pelib_set_find(elem)   PELIB_CONCAT_3(pelib_, set(elem), _find)
#define pelib_set_compare(elem)   PELIB_CONCAT_3(pelib_, set(elem), _compare)
#define STRUCT_T   set_t(SET_T)

Functions

struct set (SET_T)
SET_T *pelib_set_first() SET_T (set_t(SET_T)*)
int pelib_set_insert() SET_T (set_t(SET_T)*, SET_T)
int pelib_set_compare() SET_T (set_t(SET_T)*a1, set_t(SET_T)*a2)

Define Documentation

#define pelib_set_compare (   elem)    PELIB_CONCAT_3(pelib_, set(elem), _compare)

Definition at line 37 of file set.h.

#define pelib_set_find (   elem)    PELIB_CONCAT_3(pelib_, set(elem), _find)

Definition at line 36 of file set.h.

#define pelib_set_first (   elem)    PELIB_CONCAT_3(pelib_, set(elem), _first)

Definition at line 33 of file set.h.

#define pelib_set_insert (   elem)    PELIB_CONCAT_3(pelib_, set(elem), _insert)

Definition at line 35 of file set.h.

#define pelib_set_last (   elem)    PELIB_CONCAT_3(pelib_, set(elem), _last)

Definition at line 34 of file set.h.

#define set (   elem)    PELIB_CONCAT_2(set_, elem)

Definition at line 30 of file set.h.

#define set_t (   elem)    PELIB_CONCAT_2(set(elem), _t)

Definition at line 31 of file set.h.

#define STRUCT_T   set_t(SET_T)

Definition at line 46 of file set.h.


Function Documentation

struct set ( SET_T  ) [read]

Generic static set

Address where elements are stored

Definition at line 40 of file set.h.

Definition at line 152 of file set.c.

int pelib_set_compare() SET_T ( set_t(SET_T)*  a1,
set_t(SET_T)*  a2 
)

Compares all elements of two sets one by one

Returns:
If a1 and a2 have the same number of elements, for the first pair of elements from both sets a1 and a2 that are different, return -1 if the element of a1 is lower than the element of a2, 1 otherwise. Returns 0 if all elements are identical. If a1 has less elements than a2, then returns -1 other wise returns 1.