NAME ^

src/byteorder.c - Byteordering functions

DESCRIPTION ^

These are assigned to a vtable when the PBC file is loaded.

If the vtable method for conversion from the native byteorder is called, it is a no op and will work, but the caller should know if the byteorder in the PBC file is native and skip the conversion and just map it in.

Byte order handlers ^

Configure will have checked for supported word sizes.

PARROT_WARN_UNUSED_RESULT PARROT_CONST_FUNCTION INTVAL fetch_iv_le(INTVAL w)

This function converts a 4 or 8 byte INTVAL into little endian format. If the native format is already little endian, then no conversion is done.

PARROT_WARN_UNUSED_RESULT PARROT_CONST_FUNCTION INTVAL fetch_iv_be(INTVAL w)

This function converts a 4 or 8 byte INTVAL into big endian format. If the native format is already big endian, then no conversion is done.

PARROT_WARN_UNUSED_RESULT PARROT_CONST_FUNCTION opcode_t fetch_op_be(opcode_t w)

Same as fetch_iv_be for opcode_t

PARROT_WARN_UNUSED_RESULT PARROT_CONST_FUNCTION opcode_t fetch_op_le(opcode_t w)

Same as fetch_iv_le for opcode_t

Unrolled routines for swapping various sizes from 32-128 bits. These should only be used if alignment is unknown or we are pulling something out of a padded buffer.

void fetch_buf_be_4(NOTNULL(unsigned char *rb), ARGIN(const unsigned char *b))

RT#48260: Not yet documented!!!

void fetch_buf_le_4(NOTNULL(unsigned char *rb), ARGIN(const unsigned char *b))

RT#48260: Not yet documented!!!

void fetch_buf_be_8(NOTNULL(unsigned char *rb), ARGIN(const unsigned char *b))

RT#48260: Not yet documented!!!

void fetch_buf_le_8(NOTNULL(unsigned char *rb), ARGIN(const unsigned char *b))

RT#48260: Not yet documented!!!

void fetch_buf_le_12(NOTNULL(unsigned char *rb), ARGIN(const unsigned char *b))

RT#48260: Not yet documented!!!

void fetch_buf_be_12(NOTNULL(unsigned char *rb), ARGIN(const unsigned char *b))

RT#48260: Not yet documented!!!

void fetch_buf_le_16(NOTNULL(unsigned char *rb), ARGIN(const unsigned char *b))

RT#48260: Not yet documented!!!

void fetch_buf_be_16(NOTNULL(unsigned char *rb), ARGIN(const unsigned char *b))

RT#48260: Not yet documented!!!

HISTORY ^

Initial version by Melvin on 2002/05/01


parrot