OSF DCE Application Development Guide--Introduction and Style Guide

A Sample Application
/* Our backing store data type. For a full explanation, see the */
/* body of sample_resolve_by_name(), in sample_server.c. */
sample_data_t data;
DCE_SVC_DEBUG((smp_svc_handle, smp_s_manager, svc_c_debug6,
"Entering sample_get_text()..."));
*remote_st = rpc_s_ok;
/* Get the object’s data header... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_manager, svc_c_debug6,
"Calling dce_db_fetch_by_uuid()..."));
dce_db_fetch_by_uuid(db_object, &object_uuid, (void *)&data, remote_st);
if (*remote_st != error_status_ok)
{
dce_svc_printf(OBJECT_NOT_FOUND_MSG);
return;
}
/* Copy the text, if any, into the return parameter... */
if (data.s_data.message)
{
DCE_SVC_DEBUG((smp_svc_handle, smp_s_manager, svc_c_debug8,
"Text exists"));
strcpy(text, data.s_data.message);
}
else
{
DCE_SVC_DEBUG((smp_svc_handle, smp_s_manager, svc_c_debug8,
"No text"));
strcpy(text, "-No text-");
}
DCE_SVC_DEBUG((smp_svc_handle, smp_s_manager, svc_c_debug8,
"Recovered text == %s", data.s_data.message));
DCE_SVC_DEBUG((smp_svc_handle, smp_s_manager, svc_c_debug8,
"Message == %s", text));
DCE_SVC_DEBUG((smp_svc_handle, smp_s_manager, svc_c_debug6,
"Successfully exiting sample_get_text()"));
}
/******
*
* sample_put_text -- Puts some text information "into" an object.
*
*
* Not called from anywhere.
*
******/
124246 Tandem Computers Incorporated A 77