bstr_collection_loop(3) — Subroutines
Name
bstr_collection_loop − Performs a user-defined operation on all the children in a Collection matching a pattern.
Syntax
bstr_t_status bstr_collection_loop (
bstr_t_reference ∗collection,
bstr_t_string pattern,
int (∗func)() ∗user_function,
bstr_t_address user_parameter,
bstr_t_status continue_on_error,
bstr_t_rcb ∗control,
bstr_t_sequence ∗matching_children,
bstr_t_status ∗last_status);
Description
The bstr_collection_loop procedure searches a Collection for all the children whose name matches a pattern and applies the user-defined function to them.
Arguments
collection
access: read
The reference to the collection to be examined.
pattern
access: read
The optional pattern to be used for matching child names. If not defined, the default pattern "∗" is used.
(∗func)() ∗user_function
access: read
This optional parameter is activated on the children belonging to a collection and matching the pattern.
user_parameter
access: read
This optional parameter specifies a user-supplied parameter to be passed to the user function after the reference to a child matching the pattern.
continue_on_error
access: read
This parameter called allows you to determine how BASEstar Open behaves after completing the user-defined function user_function. It defines an error level that BASEstar Open matches with the return code of user_function each time it returns an object that matches the pattern).
The parameter can contain the following values:
•BSTR_S_NORMAL
•BSTR_S_WARNING
•BSTR_S_ERROR
•BSTR_S_SEVERE
If the error level identified by continue_on_error is higher or equal to the error level returned by user_function, control passes to the the next selected object. If this is not the case, BASEstar Open terminates execution. The parameter is optional and its default value is BSTR_C_SUCCESS (BASEstar Open interrupts execution for all error types).
∗control
access: write
The address of an optional request control block.
∗matching_children
access: write
This optional parameter represents the list of children satisfying the pattern matching. This parameter of the user function (or both) parameter should be provided.
last_status
access: write
The status returned by the most recent execution of user_function.
Return Values
| BSTR_S_ABORTED | Operation aborted |
| BSTR_S_BAD_BUFFER | Bad sequence buffer |
| BSTR_S_BAD_PARAMETER | Bad parameter value |
| BSTR_S_BAD_REFERENCE | Bad reference |
| BSTR_S_COMMUNICATION_ERROR | Communication error |
| BSTR_S_FINISH | Request aborted by bstr_finish |
| BSTR_S_INTERNAL_ERROR | Internal error |
| BSTR_S_INTR | Operation interrupted |
| BSTR_S_INVALID_NAME | Invalid name |
| BSTR_S_INVALID_OPERATION | Invalid operation |
| BSTR_S_NORMAL | Normal successful completion |
| BSTR_S_NO_MEMORY | Insufficient virtual memory |
| BSTR_S_REFERENCE_IN_USE | Reference already in use |
| BSTR_S_SEQUENCE_IN_USE | Sequence already in use |
| BSTR_S_SERVER_NOT_REACHABLE | Server not reachable |
| BSTR_S_TIMEOUT | Timeout expired |
| BSTR_S_TOO_MANY_REQUESTS | Too many pending requests |
| BSTR_S_NO_MATCHING_OBJ | No objects matching the request |