DCE for the HP e3000 (B3821-90003)

Chapter 7 63
Programming with RPC 1.2.1 on MPE/iX
#include <dce/dce_error.h> /* DCE error facility */
#include "common.h" /* Common defs for this app */
#include "sleeper.h" /* Output from sleeper.idl */
#ifdef TRACING
tr_handle_t * tr_handle = NULL; /* Initialize for server */
#endif /* TRACING */
void main(int argc, char *argv[])
{
rpc_binding_vector_t *bvec; /* used to register w/runtime */
error_status_t st, _ignore; /* returned by DCE calls */
dce_error_string_t dce_err_string; /* text describing error code */
ndr_char *string_binding; /* printable rep of binding */
int i; /* index into bvec */
#ifdef TRACING
/*
* Initialize tracing.
*/
if (tr_handle == NULL) {
char trace_name_buf[40];
/*
* Construct the tracing prefix string from the trace_name constant
* and the current process id. This allows multiple servers on the
* same host to differentiate themselves from each other.
*/
sprintf(trace_name_buf, "%s-%d", trace_name, getpid());
tr_handle = tr_init("TR_SLEEPER", /* environment variable name */
NULL, /* selector level defaults */
NULL, /* filename for output */
trace_name_buf); /* prefix string in output */
if (tr_handle == NULL) {
/*
* Still NULL -- unable to initialize tracing. This may cause
* the following tr_printmsg calls (via PRINT_FUNC) to fail.
*/