/*	Header for Code writing conventions for RPC software
**	====================================================
**
**  These macros are used my the RPC code for readability, consistency
**  and portability.  They are not needed by user code which calls RPC
**  routines.
**
**  See also:	system_specific.h    may modify these macros.
*/

/*	Trace macros (if not overwritten by system_specific macros)
**	------------
**
**  System-specific definition of these macros allows weird and wonderful
**  methods of displaying trace information to be implemented. Note that
**  these macros are followed by variable length parameter lists, the first
**  of which is a file pointer.
**
**  The unconditional trace macro is always used within a conditional block,
**  so it is never called when rpc_trace is false. PRINT_ERROR however may
**  be called whether trace is on or off.
*/

#ifndef UTRACE
#define UTRACE fprintf			/* Unconditional trace */
#define CTRACE if (rpc_trace) fprintf	/* Conditional trace */
#define FLUSH_TRACE if (rpc_trace)fflush(tfp);	/* Conditional flush of trace*/ 
#endif

#ifndef PERROR
#define PERROR fprintf			/* Called as PERROR(stderr, ....);    */
#endif

#define PRINT_ERROR fprintf		/* For output to standard error       */

#define PUBLIC				/* Accessible outside this module     */
#define PRIVATE static			/* Accessible only within this module */

#define GOOD(status) ((status)&1)	/* VMS style status: test bit 0	      */
#define BAD(status)  (!GOOD(status))	/* Bit 0 set if OK, otherwise clear   */

#ifndef BOOLEAN_DEFINED
typedef char	BOOLEAN;		/* Logical value */
#define TRUE	(BOOLEAN)1
#define	FALSE	(BOOLEAN)0
#define BOOLEAN_DEFINED
#endif

/*	External variables:
**
*/
#ifndef RPCRTS
extern BOOLEAN  rpc_trace;	/* Flag: Please output trace information */
extern FILE	    *tfp;	/* Output stream open if rpc_trace true */
#endif

#ifndef CRITICAL
#define CRITICAL		/* Code to start protected region */
#define NONCRITICAL		/* End protected region */
#endif
