OSF DCE Application Development Guide--Introduction and Style Guide

A Sample Application
/* the objects) */
/* */
/* */
/* */
/****************************************************************************/
void server_store_acl(
dce_db_handle_t db_acl, /* ACL (UUID)-indexed store. */
dce_db_handle_t db_object, /* Object (UUID)-indexed store. */
dce_db_handle_t db_name, /* Name-indexed store. */
sec_acl_t *acl, /* The ACL itself. */
uuid_t *acl_uuid, /* ACL UUID. */
uuid_t *object_uuid, /* Object UUID. */
unsigned_char_t *object_name, /* The name of the object. */
void *object_contents, /* The actual object data contents. */
/* NOTE: NOT USED NOW. */
boolean32 is_container, /* Are we storing a container ACL? */
unsigned32 *status) /* To return status. */
{
/* These two variables are used to hold UUIDs for the ACLs we will */
/* need to create if we have a container ACL on our hands... */
static uuid_t def_object, def_container;
static sample_data_t object_data;
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug7,
"Entering server_store_acl()"));
*status = error_status_ok;
/* Null the contents of the object_data variable... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling bzero()"));
bzero((char *)&object_data, sizeof object_data);
/* If we have a container ACL, then we have to create and store the */
/* special stuff associated with it-- namely, the container ACL */
/* itself, and a default object ACL to go with it... */
if (is_container)
{
/* Create a UUID for the default object ACL... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling uuid_create()"));
uuid_create(&def_object, status);
if (*status != error_status_ok)
{
print_server_error("uuid_create()", *status);
return;
}
/* Create a UUID for the default container ACL... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling uuid_create()"));
uuid_create(&def_container, status);
if (*status != error_status_ok)
{
124246 Tandem Computers Incorporated A 37