int
saf_describe_category(SAF_ParMode pmode,
SAF_Cat *cat, /* A collection category handle. */
char **name, /* If non-NULL, the returned name of the collection category (see Returned Strings). */
SAF_Role *role, /* If non-NULL, the returned role of the collection category (see Collection Roles). */
int *tdim /* If non-NULL, the returned maximum topological dimension of members of collections
* of this category. */
)
{
SAF_ENTER(saf_describe_category, SAF_PRECONDITION_ERROR);
SAF_REQUIRE(_saf_valid_pmode(pmode), SAF_LOW_CHK_COST, SAF_PRECONDITION_ERROR,
_saf_errmsg("PMODE must be valid"));
if (!_saf_is_participating_proc(pmode)) SAF_RETURN(-1);
SAF_REQUIRE(SS_CAT(cat), SAF_LOW_CHK_COST, SAF_PRECONDITION_ERROR,
_saf_errmsg("CAT must be a valid category handle"));
/* return the desired values */
if (_saf_setupReturned_string(name, ss_string_ptr(SS_CAT_P(cat,name))) != SAF_SUCCESS)
SAF_ERROR(SAF_MEMORY_ERROR, _saf_errmsg("unable to process returned string"));
if (role) {
*role = SS_CAT(cat)->role;
}
if (tdim != NULL)
*tdim = SS_CAT(cat)->tdim;
SAF_LEAVE(SAF_SUCCESS);
}