DCE Application Programming Guide
Porting Applications
HP NonStop DCE Application Programming Guide—429551-003
5-3
Changes to the Server Module
included to illustrate the conversion process. In addition, the converted server is an 
example of a program that can execute as a standard multithreaded server. 
The server module infpls_s.c is used as the basis for a new module 
infpls_s_v11.c. Only minimal changes are required; all changes are for process 
and serviceability initialization and shutdown. The new file inf.sams is created to 
define the server messages. Finally, the error message macros are modified to use the 
serviceability interface. The modified macros are placed in the new file errmac_s.h.
Changes to the Server Module
The new server module infpls_s_v11.c is a copy of the server module 
infpls_s.c with changes made for server initialization and serviceability. These 
changes were made to server initialization:
•
Replaced the include statement for the rpc.h file with an include statement 
for the dced.h file (item A1 in the listing of Figure A-11 on page A-18). This 
definition file is required by the server initialization routines.
•
Replaced variable definitions for bindings and annotation with server_conf, 
register_data, and server_handle (item A2 in the listing on page A-18). The 
annotation is now part of the server configuration. The other changes are 
necessary because of the changes in the functions called to do the server 
initialization.
•
Added a call to the dce_server_inq_server() function (item A3 in the listing 
on page A-19), which retrieves the server’s configuration information from the 
dced program. 
•
Replaced the calls to the rpc_server_register_if(), 
rpc_server_use_protseq(), rpc_server_inq_bindings(), and 
rpc_ep_register() functions with a call to the dce_server_register() 
function (item A4 in the listing on page A-19), which does the work of all the 
replaced functions.
•
Replaced the call to the rpc_ep_unregister() function with a call to the 
dce_server_unregister() function (item A5 in the listing on page A-19
). 
These changes were made for serviceability:
•
Added include statements for the DCE serviceability header files and the 
Information Please message files generated by the sams utility (item B1 in the 
listing on page A-18).
•
Replaced the include statement for the errmac.h file with an include 
statement for the errmac_s.h file (item B2 in the listing on page A-18). The new 
file contains error macro definitions that use the serviceability interface instead of 
the fprintf() function.
•
Added a definition for the serviceability handle inf_svc_handle (item B3 in the 
listing on page A-18).










