OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
dcehelmsg.sml Code for a subsection documenting the messages.
dcehelmsg.man Code for a reference page subsection documenting the
messages.
dcehelmsg.idx Code for building an index for the subsection.
dcehelsvc.c Code defining the serviceability table. (This is a separate table
containing the serviceability subcomponent identifying
messages specified at the end of the sams file.)
dcehelsvc.h Header file containing definitions for dcehelsvc.c.
Of these files, only the following are needed for the hello_svc program:
dcehelmac.h Contains convenience macro code.
dcehelmsg.c Contains in-memory message table code.
dcehelmsg.h Contains definitions for in-memory message table code.
dcehelsvc.c Contains serviceability message table code.
dcehelsvc.h Contains definitions for serviceability message table code.
The three header files should be included into the program source code. The
dcehelmsg.c and dcehelsvc.c modules should be compiled and linked with the program
object module.
All that remains now is to create a simple C program that calls the necessary
serviceability routines to output the ‘‘Hello World’’ message.
4.1.2.3 Coding the Serviceability Calls
The bare minimum required to initialize the serviceability interface and use it to display
our message is
Call dce_svc_register() to get a serviceability handle that we can pass to
serviceability message routines.
Call dce_msg_define_msg_table( ) to set up the in-memory message table.
Call dce_svc_printf() to print the message.
To call dce_svc_register(), you must declare the serviceability handle that you defined
in hel.sams:
#include "dcehelsvc.h"
<. . .>
dce_svc_handle_t hel_svc_handle;
unsigned32 status;
<. . .>
4 8 Tandem Computers Incorporated 124245