Generated from cl_packon.h with ROBODoc v3.2.3 on Sat Jan 18 07:05:18 2003
TABLE OF CONTENTS
- Component Library/Structure Packing
NAME
Structure Packing
DESCRIPTION
The structure packing header files allow packing structures on byte
boundaries.
Structure packing should be used whenever a structure is transmitted
between systems, as different platforms pad structures differently if
they are not packed. Packing a structure that is not transmitted between
systems can be detrimental to performance, as fields in the structure may
not align properly for some platforms. Care must be taken when creating
packed structures that the alignment rules for all platforms are followed.
To pack a structure, include ipackon.h before defining the structure, and
include ipackoff.h after the structure definition. Multiple structures
can be packed between the two include statements if desired.
The structure definition itself must use the PACK_SUFFIX keyword.
EXAMPLE
#include <iba/complib/ipackon.h>
typedef _my_struct_t
{
uint64 large;
uint32 medium;
uint16 small;
} PACK_SUFFIX my_struct_t;
#include <iba/complib/ipackoff.h>