C API Functions

## udbListReferenceFilter

### Description

Filter the specified list of references, using the reference kinds and/or the entity kinds specified, and return a new allocated array of references. If unique is specified, the newrefs array will only contain the first reference for each unique entity.

Call udbListReferenceFree() to free this list.

### Syntax

     #include "udb/udb.h"
     void  udbListReferenceFilter(UdbReference *refs,
                                 UdbKindList refkinds,
                                 UdbKindList entkinds,
                                 int unique,
                                 UdbReference **newrefs,
                                 int *items)

### Arguments

Argument | description
--- | ---
UdbReference *refs | Original list of references; non-allocated.
UdbKindList refkinds | If not NULL, reference kinds to filter; allocated.
UdbKindList entkinds | If not NULL, entity kinds to filter; allocated.
int unique | If specified, only one reference per unique entity is returned
UdbReference **newrefs | Return allocated array of references.
int *items | If not NULL, return size of newrefs array.

### Return Values

There are no function return values.

### Example Usage

This example filters an existing list of reference to include only those references where there is an active callby or useby reference, or where the entity is declared or defined.

     udbListReferenceFilter(refs,
            udbKindParse("callby ~inactive,declarein,definein,
    useby ~inactive"),
             NULL, 0, &xrefs, &items);

### See Also

udbListReference to get list of references for a specified entity.

udbListReferenceFree to free the list of references.

Scientific Toolworks, Inc. http://www.scitools.com Voice: (802) 763-2995 Fax: (802) 763-3066 support@scitools.com sales@scitools.com