home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Collection - Online Library - January 1996
/
CKITOS2196.ISO
/
diskette
/
gg244090.dsk
/
unc.dsk
/
CHAPTER.09
/
COMMON.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-04
|
2KB
|
50 lines
/***************************************************************************/
/* */
/* Name: header file common.h */
/* */
/* Description: Common header file for the Message Box example. */
/* Defines the error check pseudo function which is called */
/* to check the return status of call to the RPC runtime. */
/* Defines also the principal used by the server to */
/* authenticate, the name for the entry in the CDS name */
/* space and the return values of the remote procedures. */
/* */
/***************************************************************************/
# ifndef _MBOX_COMMON
# define _MBOX_COMMON
# ifndef _H_STDIO
# include <stdio.h>
# endif
# define ERRCHK(x) \
if ( (x) != error_status_ok ) { \
fprintf( stderr, "FAULT: %s: %d\n", __FILE__, __LINE__ - 1);\
dce_error_inq_text(x, dce_error_string, &error_inq_st); \
fprintf(stderr, "cause: %s\n", dce_error_string); \
fflush(stderr); \
exit ( x ); \
}
char dce_error_string[256];
error_status_t error_inq_st;
# define NUM_ELEMS(a) (sizeof(a)/sizeof(a[0]))
# define ENTRY_NAME "/.:/Servers/MessageBox"
# define PRINCIPAL_NAME "MessageBox"
/* Return values of remote procedures */
# define MBOX_OK 0
# define MBOX_NO_MSG 1
# define MBOX_READ 2
# define MBOX_APPEND 3
# define MBOX_CREATE 4
# define MBOX_NOT_AUTHORIZED -1
# define MBOX_PRINCIPAL_EXIST -2
# define MBOX_PRINCIPAL_NOT_EXIST -3
# define MBOX_ALL_USED -4
# endif