Synopsis

PDX_MSGT mda_GetNthlevelParents(long option, MDA_PTR db_ptr, long parent_level, long *count, MDA_PTR **parent_list)

Purpose

Retrieve Nth level parents of the given entity.

Description

The list of entities at the required parent_level, which reference db_ptr is returned. The memory to contain the list is allocated by this function and must be freed by the caller. If the caller is not part of libpdx, pdx_Free must be used to free the list. The number of pointers in parent_list is returned in count. If the entity does not have any parents then count will be returned as 0 and no memory will be allocated in parent_list. Note that some pointers in parent_list may be duplicated if a single parent makes multiple references to db_ptr. See the mda_intro man page for more information.

Input

option

Options (not used)

db_ptr

Entity to obtain parents for

parent_level

Number of levels up from the current level

Output

count

Number of referencing pointers

parent_list

Array of referencing entity pointers (must be freed by the caller, using pdx_Free if the caller is not part of libpdx).

Return

MDA error code