Find set by matching criteria¶
saf_find_matching_sets is a function defined in set.c.
Synopsis:
-
int
saf_find_matching_sets(SAF_ParMode pmode, SAF_Db *db, const char *name_grep, SAF_SilRole srole, int tdim, SAF_ExtendMode extmode, SAF_TopMode topmode, int *num, SAF_Set **found)¶
Formal Arguments:
pmode: The parallel mode.db: The database in which to searchname_grep: The name of the desired set(s) or a limited regular expression that the set names must match. If this argument begins with a leading “at sign”, ‘@’, character, the remaining characters will be treated as a limited form of a regular expression akin to that supported by ‘ed.’ The constantSAF__ANY_NAMEcan be passed if the client does not want to limit the search by name.srole: The subset inclusion lattice role of the desired set(s). TheSAF__ANY_SILROLEconstant can be passed if the client is not interested in restricting the search on this criteria.tdim: The topological dimension of the desired set(s). TheSAF__ANY_TOPODIMconstant can be passed if the client is not interested in restricting the search on this criteria.extmode: User to specify if the set is extendible or not (whether it can grow or not). PassSAF__EXTENDIBLE_TRUE,SAF__EXTENDIBLE_FALSE, orSAF__EXTENDIBLE_TORFtopmode: whether the matching sets should be top sets. PassSAF__TOP_TRUE,SAF__TOP_FALSE, orSAF__TOP_TORFnum: For this and the succeeding argument [see Returned Handles].found: For this and the preceding argument [see Returned Handles].
Description: This function will find sets by searching the entire database and matching certain criteria. Because it finds sets by matching criteria, this function does not exploit the subset inclusion lattice to improve performance.
If the name_grep argument begins with a leading “at sign” character, ‘@’, the remaining characters will be
treated as a limited form of a regular expression akin to that supported in ‘ed’. Otherwise, it will
be treated as a specific name for a set. If the name does not matter, pass SAF__ANY_NAME.
If the library was not compiled with -lgen support library, then if regular expressions are used,
the library will behave as though SAF__ANY_NAME was specified.
Preconditions:
pmodemust be valid. (low-cost)DATABASEmust be a database handle. (low-cost)- The
srolemust be one ofSAF__TIME,SAF__SPACE,SAF__PARAM, orSAF__ANY_SILROLE. (low-cost) - If
sroleisTIMEthentdimmust be 1. (low-cost) tdimmust beSAF__ANY_TOPODIMor positive. (low-cost)extmodecannot be arbitrarily non-zero for truth. (low-cost)topmodecannot be arbitrarily non-zero for truth. (low-cost)numandfoundmust be compatible for return value allocation. (low-cost)
Return Value: The constant SAF__SUCCESS is returned when this function is successful. Otherwise this function either returns
an error number or throws an exception, depending on the value of the library’s error handling property.
See Also:
- Sets: Introduction for current chapter