OSF DCE Application Development Guide--Core Components
DCE Host Services
how the data is to be interpreted. In this example, we know the data to
be read is plain text, so we use the global variable dced_g_uuid_fileattr
to specify plain text rather than binary data (dced_g_uuid_binfileattr).
Create a New Array
The next few lines copy the existing array of print strings into a new
array that has additional space allocated for the new data.
dced_inq_id()
This routine acquires the UUID dced that maintains for a known entry
name. In this example, we need the UUID for the NEWERprinter
hostdata entry so that it can be included in the data stored back in the
post_processors file.
uuid_to_string( )
This routine returns the string representation of a UUID. Each line in the
post_processors file contains a string UUID and a program name for
dced to run if the hostdata entry referred to by the UUID changes. The
next few lines create a new string containing the string UUID and a
program name, adds the new string to the new array, and reassigns the
new array to the old data pointer.
dced_hostdata_write( )
Since hostdata could have more than one attribute associated with each
entry, the data must be inserted in an attribute list data structure before
the dced_hostdata_write( ) routine is called. In the case of the well-
known post_processors hostdata object, the attribute is for a plain text
file. The dced_hostdata_write( ) routine replaces the old data with the
new data for the hostdata entry represented by the entry UUID.
dced_objects_release()
Each call to the dced_hostdata_read() routine requires a corresponding
call to dced_objects_release( ) to release the resources allocated.
dced_binding_free( )
Each call to the dced_binding_create( ) routine requires a
corresponding call to dced_binding_free( ) to release the resources
allocated.
The post_processors data for this dced now contains an additional string with a UUID
and program name. If the hostdata item represented by the UUID for NEWERprinter
is changed, dced automatically runs the program.
2.6 Controlling Servers Remotely
Both applications developers and system administrators may want servers to have certain
support services and control functionality. For example, servers may need mechanisms
to store operational data, and they may need to start or stop in various ways. The dced
program provides these support and control mechanisms for servers.
124245 Tandem Computers Incorporated 2− 17