Find alternate index specs by matching criteria

saf_find_alternate_indexspecs is a function defined in altindx.c.

Synopsis:

int saf_find_alternate_indexspecs(SAF_ParMode pmode, SAF_Set *containing_set, SAF_Cat *cat, const char *name_grep, int *num, SAF_AltIndexSpec **found)

Formal Arguments:

  • pmode: The parallel mode
  • containing_set: The containing set of the collection.
  • cat: The collection category.
  • name_grep: The name of the alt index spec you wish to search for. Pass NULL if you do not wish to limit the search via a name.
  • num: For this and the succeeding argument [see Returned Handles].
  • found: For this and the preceding argument [see Returned Handles].

Description: Find alternate index specs by matching criteria.

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:

  • pmode must be valid. (low-cost)
  • num and found must 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.

Issues: This function does not follow the usual semantics of a find operation. Instead of searching through a database (or scope) and looking for index specifications that match a certain pattern, it instead looks at a collection (specified with the containing_set and cat arguments) and returns any index specifications of that collection that have the requested name or name pattern.

See Also: