OSF DCE Application Development Guide--Introduction and Style Guide

OSF DCE Application Development Guide—Introduction and Style Guide
{
uuid_t u, *up; /* To hold the retrieved object UUID, and to */
/* take a pointer to it. */
unsigned_char_t *uuid_string;
sec_acl_t retrieved_acl;
/* The definition of the following is in the sample.idl file. */
/* */
/* See the "Examples" section in the dce_db_open() ref page, */
/* where the skeleton IDL interface for a server’s backing */
/* store is given. The data type definition (which is what */
/* sample_data_t is) is there prescribed as consisting of a */
/* dce_db_header_t, plus whatever server-specific data is */
/* quired, all in a single structure. */
/* */
/* Essentially it’s a dce_db_header_t structure (with an */
/* application-defined message string tacked on); this is */
/* the object header data structure that is returned, such as, */
/* by dce_db_header_fetch(); in other words, this is the */
/* thingie that actually contains the data "in" an object */
/* held in an object store. */
sample_data_t dataheader;
*st = error_status_ok;
/* Check for nonexistence of object name... */
if (!name || !*name)
{
dce_svc_printf(CANNOT_RESOLVE_NAME_MSG);
return;
}
/* Get the object’s UUID, which will be the key that we will use to */
/* fetch this particular object’s data in the call following this */
/* one... */
dce_db_fetch_by_name(db_name, (char *)name, /* (void *) */ &u, st);
up = &u; /* ...take the pointer to the key. */
/* Using the UUID "key" that we just retrieved, get the dataheader */
/* for the desired object (note that the data that one retrieves */
/* with this routine can be anything; it depends on what we are */
/* using the backing store for)... */
dce_db_fetch_by_uuid(db_object, up, /* (void *) */ &dataheader, st);
/* Now, depending on the kind of ACL we’re hunting for (that is ob- */
/* ject, container, etc.), extract its UUID from the object’s */
/* header structure... */
switch (sec_acl_type)
{
case 1:
*acl_uuid = dataheader.s_hdr.tagged_union.h.def_object_acl;
break;
case 2:
*acl_uuid = dataheader.s_hdr.tagged_union.h.def_container_acl;
3 48 Tandem Computers Incorporated 124246