The sec_rgy_attr_lookup_by_id( ) call, which reads attributes for a specified object, uses a cursor of type sec_attr_cursor_t. This cursor must be allocated before it can be used as input to the sec_rgy_attr_lookup_by_id( ) call. In addition, it can also be initialized to the first attribute in the specified object's list of attributes, although this is not required. After use, the resources allocated to the sec_attr_cursor_t must be released.
The following calls allocate, initialize, and release a sec_attr_cursor_t for use with the sec_rgy_attr_lookup_by_id( ) call:
· sec_rgy_attr_cursor_init( )
The sec_rgy_attr_sch_cursor_init( ) call allocates resources to and initializes the cursor to the first attribute in the specified object's list of attributes. This call also supplies the total number of attributes attached to the object as part of its output. The cursor allocation is a local operation. The cursor initialization is a remote operation and makes a remote call to the registry.
· sec_rgy_attr_cursor_alloc( )
The sec_rgy_attr_cursor_alloc( ) call allocates resources to the cursor but does not initialize the cursor. However, since the sec_rgy_attr_lookup_by_id( ) call will initialize the cursor if it is passed in uninitialized, you may prefer this call to limit the number of remote calls performed by the application. Be aware that the sec_rgy_attr_cursor_init( ) call provides the total number of attributes attached to the specified object, a piece of information not provided by this call.
· sec_rgy_attr_cursor_release( )
The sec_rgy_attr_cursor_release( ) call releases all resources allocated to a sec_attr_cursor_t cursor used with the sec_rgy_attr_lookup_by_id( ) call.
· sec_rgy_attr_cursor_reset( )
The sec_rgy_attr_cursor_reset( ) call reinitializes a sec_attr_cursor_t cursor used with the sec_rgy_attr_lookup_by_id( ) call. The reset cursor can then be used without releasing and reallocating.