Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

Data Alignment

Although byte ordering can be handled transparently by FairCom DB, data alignment is still YOUR RESPONSIBILITY in a stand-alone environment or when a DODA is not present.

To determine the alignment for each environment in use, compile and execute cttest. The best way to approach data alignment from a portability perspective is to align your structures for the largest aligned environment. For example, to port a data file from an environment that places all integers on a byte boundary to an environment that places all integers on a word (2 byte) boundary requires placing all integers on a word (2 byte) boundary.

It may be necessary to add char fields as padding to get proper alignment or to reorder the members of structures. In addition, grouping all data types together in the record structure has the added benefit of once the first occurrence of a data type is aligned properly, all subsequent occurrences in the same group are properly aligned.

TOCIndex