#### Using sec_attr_cursor_t with sec_rgy_attr_sch_scan( )

The sec_rgy_attr_sch_scan( ) call, which reads a specified number of attribute type entries from the attribute schema, 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_sch_scan( ) call. In addition, it can also be initialized to the first attribute type entry in the schema, 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_sch_scan( ) call:

· sec_rgy_attr_sch_cursor_init( )

The sec_rgy_attr_sch_cursor_init( ) call allocates resources to the cursor and initializes the cursor to the first attribute type entry in the attribute schema. This call also supplies the total number of entries in the attribute schema 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_sch_cursor_alloc( )

The sec_rgy_attr_sch_cursor_alloc( ) call allocates resources to the cursor but does not initialize the cursor. However, since the sec_rgy_attr_sch_scan( ) 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 an application. Be aware that the sec_rgy_attr_sch_cursor_init( ) call provides the total number of entries in the named schema, a piece of information not provided by the sec_rgy_attr_sch_cursor_alloc( ) call.

· sec_rgy_attr_sch_cursor_release( )

The sec_rgy_attr_sch_cursor_release( ) call releases all resources allocated to a sec_attr_cursor_t cursor used with the sec_rgy_attr_sch_scan( ) call.

· sec_rgy_attr_sch_cursor_reset( )

The sec_rgy_attr_sch_cursor_reset( ) call initializes a sec_attr_cursor_t cursor used with the sec_rgy_attr_sch_scan( ) call. The reset cursor can then be used without releasing and reallocating.

####