OSF DCE Application Development Guide--Introduction and Style Guide

OSF DCE Application Development Guide—Introduction and Style Guide
/* 3. Access by clients in contact with the server. This is */
/* handled by the server code itself, as described above. */
/* */
/* */
/* */
/* Note that the use of the three databases given here is necessar- */
/* ily true only of the ACL databases we are setting up here. The */
/* object data stored in databases is strictly up to the applica- */
/* tion; that is why this parameter is defined as (void *). */
/* In other words, the backing store library can be used for any- */
/* thing. */
/* */
/* In the sample_db.idl file can be seen the object data type de- */
/* fined for this sample application, which is stored in the ob- */
/* ject UUID-indexed database... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling dce_db_std_header_init()"));
dce_db_std_header_init(
db_object, /* Object database. */
&(object_data.s_hdr), /* Object data hdr. */
object_uuid, /* Object UUID. */
acl_uuid, /* ACL UUID. */
&def_object, /* Default object ACL. */
&def_container, /* Default container ACL. */
0, /* Reference count. */
status);
if (*status != error_status_ok)
{
print_server_error("dce_db_std_header_init()", *status);
return;
}
/* Now store the object data keyed by object UUID... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling dce_db_store_by_uuid()"));
/* This is perhaps a not very nice way to do this, but it will have */
/* to serve for the time being... */
if (strcmp((char *)object_name, SAMPLE_OBJECT_NAME) == 0)
strcpy((char *)object_data.s_data.message,
"THIS IS AN OFFICIAL SAMPLE OBJECT TEXT!");
else if (strcmp((char *)object_name, MGMT_OBJ_NAME) == 0)
strcpy((char *)object_data.s_data.message,
"THIS IS AN OFFICIAL MGMT OBJECT SAMPLE TEXT!");
else
strcpy((char *)object_data.s_data.message,
"I DON’T KNOW WHAT THIS IS!");
A 40 Tandem Computers Incorporated 124246