OSF DCE Application Development Guide--Introduction and Style Guide

OSF DCE Application Development Guide—Introduction and Style Guide
.
/* These are the backing store database handles: */
dce_db_handle_t db_acl, db_object, db_name;
.
.
.
/* A UUID for a sample object: */
uuid_t sample_object_uuid = {/* 00415371-f29a-1d3d-b8c8-0000c0d4de56 */
0x00415371, 0xf29a, 0x1d3d, 0xb8, 0xc8, 0x00, 0x00, 0xc0, 0xd4,
0xde, 0x56 };
.
.
.
uuid_create(&server_uuid, &status);
..
..
..
dce_db_store_by_uuid(db_object, object_uuid, (void *)&sample_data,
status);
if (*status != error_status_ok)
{
print_server_error("dce_db_store_by_uuid()", *status);
return;
}
/* Finally, store the object UUID keyed by the object */
/* ("residual") name... */
dce_db_store_by_name(db_name, (char *)object_name, object_uuid,
status);
.
.
.
Names are established so that applications can refer to objects in a way other than
through the cumbersome UUID. Object UUIDs are generated in the following two ways:
The uuidgen -s command generates the C-structure form of a UUID that can then be
hard-coded into applications
The uuid_create() routine generates a UUID ‘‘on-the-fly.’’
After creating backing store headers (if desired) and opening the backing store databases,
UUIDs are stored by calling the dce_db_store_by_uuid( ) routine. To store names
associated with the UUIDs, call the dce_db_store_by_name( ) routine.
1 16 Tandem Computers Incorporated 124246