OSF DCE Application Development Guide--Introduction and Style Guide
A Sample Application
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug8,
"Object name == %s", name));
/* Check for non-existence 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_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling dce_db_fetch_by_name()"));
dce_db_fetch_by_name(db_name, (char *)name, /* (void *) */ &u, st);
if (*st != error_status_ok)
{
print_server_error("dce_db_fetch_by_name()", *st);
return;
}
up = &u; /* ...take the pointer to the key. */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling uuid_to_string()"));
uuid_to_string(up, &uuid_string, st);
if (*st != uuid_s_ok)
{
print_server_error("uuid_to_string()", *st);
return(0);
}
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug8,
"String form of retrieved key UUID == %s",
uuid_string));
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling rpc_string_free()"));
rpc_string_free(&uuid_string, st);
if (*st != rpc_s_ok)
{
print_server_error("rpc_string_free()", *st);
return(0);
}
124246 Tandem Computers Incorporated A− 63