OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
storage_tag The storage tag locates the actual data. Each service knows how to
interpret this tag to find the data. For example, some data is stored in
a file, the name of which is contained in the storage tag. Other data is
stored in memory and the storage tag contains a pointer to the
memory location. The data type is dced_string_t.
2.4.3 Reading All of a Host Service’s Data
Suppose you want to display host service data in an application that has a graphical user
interface. The dcecp commands may not be adequate to display data for this application.
The following example shows how to obtain the entire set of data for each host service:
dced_binding_handle_t dced_bh;
dced_string_t host_service;
void *data_list;
unsigned32 count;
dced_service_type_t service_type;
error_status_t status;
.
.
.
while(user_selects(&host_service, &service_type)){ /*application specific*/
dced_binding_create(host_service,
dced_c_binding_syntax_default,
&dced_bh,
&status);
if(status == error_status_ok) {
dced_object_read_all(dced_bh, &count, &data_list, &status);
if(status == error_status_ok) {
display(service_type, count, data_list); /*application specific*/
dced_objects_release(dced_bh, count, data_list, &status);
}
dced_binding_free( dced_bh, &status);
}
}
user_selects()
This is an example of an application-specific routine that constructs the
complete service name from host and service name information. Data is
stored and retrievable for the hostdata, srvrconf, srvrexecD, and
keytab services. No data is stored for the secval service.
dced_binding_create()
Output from the dced_binding_create routine includes a dced binding
handle whose data type is dced_binding_handle_t. If an application
already has an RPC binding handle to a server on the host desired, it can
use the dced_binding_from_rpc_binding( ) routine to bind to dced and
one of its host services on that host. (Applications also use these
routines to bind to the secval service to perform other functions.)
dced_object_read_all( )
Applications use the dced_object_read_all( ) routine to read data for all
2 8 Tandem Computers Incorporated 124245