OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
phone_record_t ph;
} phone_data_t;
/*
* The following routine returns the entire contents of the
* directory from the backing store by using the iteration
* routines. First, the portion of the IDL file that
* defines the routine’s RPC format:
*/
[idempotent] void entire_phone_book(
[in] handle_t h,
[out] phone_record_array_t *e_array,
[out] error_status_t *st
);
Next the routine itself, written in C:
/* global variables */
dce_db_handle__t db_h; /* handle to phonebook backing store */
/* Other routines are not shown here, including the routine
* that opened the backing store.
*/
void
entire_phone_book(
/* [in] */ handle_t h, /* For RPC, but not used
* here. An ACL check
* would use it. */
/* [out] */ phone_record_array_t *e_array,
/* [out] */ error_status_t *st
)
{
uuid_t *dbkey;
phone_data_t pd;
unsigned32 i;
error_status_t st2;
*st = error_status_ok;
/* Lock before starting work, so that the backing
* store does not change until after all the info
* has been returned.
*/
dce_db_lock(db_h, st);
/* Count the entries so enough storage can be allocated */
e_array->count = 0;
dce_db_inq_count(db_h, &e_array->count, st);
if (*st != error_status_ok) {
dce_fprintf(stderr, *st); /* or some other treatment */
dce_db_unlock(db_h, st);
5− 10 Tandem Computers Incorporated 124245