Typedef caprock_token_iterator

Typedef Documentation

typedef caprock_error_t (*caprock_token_iterator)(void *buffer, size_t *bufsize, void *baton)

An iterator function for a token chain. Each invocation should place a token into the passed buffer, and return CAPROCK_ERR_SUCCESS if it worked, other errors if it did not. CAPROCK_ERR_ITERATION_END indicates that there is no more data the iterator can provide. If returned, no token should be written to the buffer, i.e. it has one-past-end semantics.

The baton can be used for carrying state for the iterator, and is passed to every invocation.

Param buffer

[out] The buffer to place a serialized capability into.

Param bufsize

[inout] When called, this is the maximum size of the buffer. Upon return, an iterator should set this to the amount of buffer consumed for writing the capability.

Param baton

[in] An opaque pointer useful for the iterator; see caprock_claim_validate for how it is initalized.