coan 4.2.4
The Pointer-Set component internals.
Collaboration diagram for The Pointer-Set component internals.:

Data Structures

struct  ptr_set

Files

file  ptr_set.c

Defines

#define SOMEWHERE(loc)   ((loc) >= 0)
#define NOWHERE(loc)   ((loc) < 0)
#define POINTER(loc)   (NOWHERE(loc) ? ~(loc) : (loc))

Functions

static int default_comparator (void const *obj, void const *key, locator_t ignore)
static void ptr_set_init (ptr_set_h ps, comparator_t compare, dtor_t dtor, cloner_t cloner)
static void ptr_set_copy_init (ptr_set_h dest, ptr_set_const_h src)

Detailed Description

The Pointer-Set component internals.


Define Documentation

#define NOWHERE (   loc)    ((loc) < 0)

Predicate denoting a non-existent location

Definition at line 57 of file ptr_set.c.

Referenced by ptr_set_insert(), and ptr_set_search().

#define POINTER (   loc)    (NOWHERE(loc) ? ~(loc) : (loc))

Get the pointer represented by a locator_t

Definition at line 60 of file ptr_set.c.

#define SOMEWHERE (   loc)    ((loc) >= 0)

Predicate denoting that a location exists

Definition at line 54 of file ptr_set.c.

Referenced by ptr_set_insert().


Function Documentation

static int default_comparator ( void const *  obj,
void const *  key,
locator_t  ignore 
) [static]

Default comparator function for ordering pointer sets.

Parameters:
objAddress to an object to be compared with a key.
keyAddress of the key to compare with obj.
ignoreUnused parameter required by comparator_t prototype.
Returns:
The result of strcmp(obj,key).

Definition at line 83 of file ptr_set.c.

Referenced by ptr_set_init().

static void ptr_set_copy_init ( ptr_set_h  dest,
ptr_set_const_h  src 
) [static]

Initialise a pointer set from another

Parameters:
destThe pointer set to initialise. Is assumed to control only unitialised storage.
srcThe pointer set to be copied.

dest is initialised as a copy of src

Definition at line 116 of file ptr_set.c.

References ptr_set::cached_pos, ptr_set::compare, ptr_vector_copy(), and ptr_set::pv.

Referenced by ptr_set_copy().

Here is the call graph for this function:

static void ptr_set_init ( ptr_set_h  ps,
comparator_t  compare,
dtor_t  dtor,
cloner_t  cloner 
) [static]

Initialise a pointer set.

Parameters:
psThe pointer set to initialise. Is assumed to control only unitialised storage.
compareThe comparator to be used for ordering this pointer set.
dtorThe destructor to be applied to members of this pointer set.
clonerThe function for cloning elements of this pointer set.

Definition at line 98 of file ptr_set.c.

References ptr_set::cached_pos, ptr_set::compare, default_comparator(), ptr_vector_new(), and ptr_set::pv.

Referenced by ptr_set_new().

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines