OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
*/
#define CHECK_STATUS(t, func, returned_st, expected_st) \
{\
if (returned_st == expected_st) { \
/*
* Do nothing.
*/
}else{\
dce_error_inq_text(returned_st,\
(unsigned char *)unexpected, &dce_status); \
dce_error_inq_text(expected_st, \
(unsigned char *)expected, &dce_status); \
printf("FAILED %s()\nresult: %s\nexpected: %s\n\n", \
func, unexpected, expected); \
}\
}\
static unsigned char unexpected[dce_c_error_string_len];
static unsigned char expected[dce_c_error_string_len];
static int dce_status;
void
main(void)
{
rpc_binding_handle_t bind_handle;
rpc_ns_handle_t import_context;
error_status_t status;
error_status_t temp_status;
cs_byte net_string[SIZE];
cs_byte loc_string[SIZE];
unsigned char err_buf[256];
char *nsi_entry_name;
char *client_locale_name;
int i, rpc_num;
FILE *fp_in, *fp_out;
/* The environment variable I18N_SERVER_ENTRY needs
* to be set before running this program. This is
* not a DCE environment variable, so you can set up
* your own environment variable if you like.
*/
nsi_entry_name = getenv("I18N_SERVER_ENTRY");
setlocale(LC_ALL, "");
rpc_ns_binding_import_begin (
rpc_c_ns_syntax_default,
(unsigned_char_p_t)nsi_entry_name,
cs_test_v1_0_c_ifspec,
NULL,
&import_context,
&status );
CHECK_STATUS(TRUE, "rpc_ns_binding_import_begin", status, rpc_s_ok);
15 − 24 Tandem Computers Incorporated 124245