portal.5 (2010 09)

p
portal(5) portal(5)
The SET_MASK_BIT_LOOP
macro in the following example will turn on the three least significant bits of
the maximum integer.
int i;
intmax_t mask = 0;
for(i=0;i<3;i++) {
SET_MASK_BIT_LOOP(mask, i, intmax_t);
}
The SIGN_BIT macro in the following example will return the position of the sign bit in a 32-bit integer.
SIGN_BIT(int32_t)
The SIGN_BIT_MASK
macro in the following example will return a sign bit mask for a 32-bit integer.
SIGN_BIT_MASK(int32_t)
The SIGN_EXTEND macro in the following example will convert the 8-bit integer stored in a char data
type to a 64-bit integer and correctly extend the sign.
char c;
int64_t i;
i = SIGN_EXTEND(c, char, int64_t);
The TEST_ENDIAN macro in the following example will store a 1 in endian if the compilation was big
endian; otherwise, it will store a 0 in endian .
int endian;
TEST_ENDIAN(endian);
if (endian == 0)
printf("This a little endian system\n");
if (endian == 1)
printf("This a big endian system\n");
AUTHOR
portal.h was developed by HP.
FILES
/usr/include/sys/portal.h
SEE ALSO
inttypes(5), limits(5), printf(3S), scanf(3S).
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010