OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
contained in dcehelmac.h.
A convenience macro is generated for every message in a sams file that has both sub-
component and attributes specified. The macro’s name is formed from the uppercase
version of its code value (as specified in the sams file), with the string _MSG appended.
The complete source code for hello_svc.c is as follows:
#include <dce/dce.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <dce/utctypes.h>
#include <pthread.h>
#include <dce/dce_msg.h>
#include "hel_svc.h"
#include <dce/dcesvcmsg.h>
#include "dcehelmsg.h"
#include "dcehelsvc.h"
#include "dcehelmac.h"
int main( int argc,
char *argv[] )
{
dce_svc_handle_t hel_svc_handle;
unsigned32 status;
hel_svc_handle = dce_svc_register(hel_svc_table, \
(idl_char*)"hel", &status);
if (status != svc_s_ok)
{
printf("dce_svc_register failed\n");
exit(1);
}
dce_msg_define_msg_table(hel_msg_table,
sizeof(hel_msg_table) / sizeof(hel_msg_table[0]),
&status);
if (status != svc_s_ok)
printf("dce_svc_define_msg_table failed \
-- will use catalogs\n");
dce_svc_printf(HEL_S_HELLO_MSG);
}
4 10 Tandem Computers Incorporated 124245