/*
Copyright (c) 1993 Xerox Corporation.  All rights reserved.
*/
/*
$Id$

$Date$
*/

#ifndef	←←PCR←StdDefs←h
#define ←←PCR←StdDefs←h	1

#include <config/PCR←StdTypes.h>
#include <config/PCR←Arch.h>

/*
 * Rounding
 */

extern const unsigned long PCR←defaultAlignMASK;

extern unsigned long
PCR←RoundUp(unsigned long x, unsigned long mask);

#define PCR←←RoundUp(x,mask) \
	(((x) + (mask)) & (~(mask)))
#define PCR←RoundUp		PCR←←RoundUp


extern unsigned long
PCR←RoundDown(unsigned long x, unsigned long mask);

#define PCR←←RoundDown(x,mask) \
	((x) & (~(mask)))
#define PCR←RoundDown		PCR←←RoundDown


/*
 * Host-network byte order conversions
 */

extern unsigned short
PCR←hton16(unsigned short);

extern unsigned short
PCR←ntoh16(unsigned short);

extern unsigned long
PCR←hton32(unsigned long);

extern unsigned long
PCR←ntoh32(unsigned long);

#if PCR←Arch←ENDIAN3210 /* big-endian */
    
#   define PCR←←hton16(x) ((unsigned short)(x))
#   define PCR←hton16 PCR←←hton16

#   define PCR←←ntoh16(x) ((unsigned short)(x))
#   define PCR←ntoh16 PCR←←ntoh16

#   define PCR←←hton32(x) ((unsigned long)(x))
#   define PCR←hton32 PCR←←hton32

#   define PCR←←ntoh32(x) ((unsigned long)(x))
#   define PCR←ntoh32 PCR←←ntoh32

#else /* not big-endian */

    /* they're out-of-line, sigh */
 
#endif /* PCR←Arch←ENDIAN3210 */


/*
 * (im)mutability testing.
 *
 * On some systems/arguments both the following may be FALSE,
 *   meaning "don't know".
 */

extern PCR←Bool
PCR←IsMutable(const void *p);
/*
    PCR←IsMutable(p) => *p may be written. 
*/

extern PCR←Bool
PCR←IsImmutable(const void *p);
/*
    PCR←IsImmutable(p) => *p guaranteed not to change. 
*/


#endif /* !←←PCR←StdDefs←h */

/*
$Log$
*/