OSF DCE Application Development Guide--Introduction and Style Guide

OSF DCE Application Development Guide—Introduction and Style Guide
/******
*
* bind_to_object -- Local client call to get UUID from object name.
*
* (The real sub-title of this saga seems to be "How to Implement
* a Junction".)
*
* Called from main().
*
******/
void bind_to_object(
unsigned_char_t *object_name, /* The name of the object we’re to bind to. */
rpc_if_handle_t if_hint, /* Interface specification; NULL from main(). */
uuid_t *id_hint, /* Presumably the object’s UUID; NULL from main(). */
rpc_binding_handle_t *binding_h, /* Binding will be returned here. */
uuid_t *object_uuid, /* Object’s object UUID will be returned here. */
uuid_t *mgr_type_uuid, /* Object’s type manager UUID will be returned here. */
unsigned_char_t **entry_name, /* Full entry name (?) will be returned here. */
unsigned_char_t **residual, /* Unresolved (?) name part returned here. */
error_status_t *status)
{
unsigned_char_p_t resolved_name = NULL; /* To hold resolved part of */
/* object name. */
rpc_ns_handle_t import_context; /* For NSI import operations. */
unsigned_char_t *uuid_string; /* Not used. */
unsigned_char_t *string_binding; /* Not used. */
fprintf(stdout, "sample_client: Entering bind_to_object()...0);
/* Attempt to resolve the entry (i.e., object) name we were */
/* given. The idea is that we are feeding this routine an over- */
/* qualified name, which it will be able to resolve only to a cer- */
/* tain depth. What’s left should be only a simple name, i.e. of */
/* the object we want to bind to... */
fprintf(stdout, "sample_client: Object name == %s0, object_name);
fprintf(stdout, "sample_client: Calling rpc_ns_entry_inq_resolution()...0);
rpc_ns_entry_inq_resolution(
rpc_c_ns_syntax_dce, /* Syntax for object_name. */
object_name, /* Entry name to be resolved. */
&resolved_name, /* Pointer to resolved name returned here. */
residual, /* Pointer to unresolved name part returned here. */
status);
if (*status != rpc_s_ok)
{
print_error("rpc_ns_entry_inq_resolution()", *status);
}
A 92 Tandem Computers Incorporated 124246