PreviousNext

sec_rgy_cursor_reset(3sec)

Resets the registry database cursor

Synopsis

#include <dce/misc.h>

void sec_rgy_cursor_reset(
sec_rgy_cursor_t *cursor);

Parameters

Input/Output

cursor
A pointer into the registry database.

Description
The sec_rgy_cursor_reset( ) routine resets the database cursor to return the first suitable entry. A cursor is a pointer into the registry. It serves as a place holder when returning successive items from the registry.

A cursor is bound to a particular server. In other words, a cursor that is in use with one replica of the registry has no meaning for any other replica. If a calling program attempts to use a cursor from one replica with another, the cursor is reset and the routine for which the cursor was specified returns the first item in the database.

A cursor that is in use with one call cannot be used with another. For example, you cannot use the same cursor on a call to sec_rgy_acct_get_projlist( ) and sec_rgy_pgo_get_next( ). The behavior in this case is undefined.

Files

/usr/include/dce/misc.idl
The idl file from which dce/misc.h was derived.

Examples
The following example illustrates use of the cursor within a loop. The initial sec_rgy_cursor_reset( ) call resets the cursor to point to the first item in the registry. Successive calls to sec_rgy_pgo_get_next( ) return the next PGO item and update the cursor to reflect the last item returned. When the end of the list of PGO items is reached, the routine returns the value sec_rgy_no_more_entries in the status parameter.

sec_rgy_cursor_reset(&cursor);
do {
sec_rgy_pgo_get_next(context, domain, scope, &cursor,
&item, name &status);
if (status == error_status_ok) {
/* Print formatted PGO item info */
}
}while (status == error_status_ok);

Related Information
Functions:

sec_intro(3sec)

sec_rgy_acct_get_projlist(3sec)

sec_rgy_acct_lookup(3sec)

sec_rgy_pgo_get_by_id(3sec)

sec_rgy_pgo_get_by_name(3sec)

sec_rgy_pgo_get_by_unix_num(3sec)

sec_rgy_pgo_get_members(3sec)

sec_rgy_pgo_get_next(3sec)