/* Copyright (c) 1993 Xerox Corporation. All rights reserved. */ /* $Id$ $Date$ */ #ifndef __PCR_StdDefs_h #define __PCR_StdDefs_h 1 #include #include /* * 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$ */