Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

SEGMDEF Structure

The segmented file specifications in a call to SetFileSegments() are expressed through the SEGMDEF structure, which is made up of a pointer to a segment name and a 4-byte integer holding the segment size in MB. The segment definitions are stored in the host, or first, file segment as a special FairCom resource.

There is no limit on the number of segments except that the ASCII strings containing the segment names and sizes are limited to just over 8100 bytes. This means that even if each segment requires a 255-byte file name, a minimum of 30 segments could still be defined within the size constraint of the special resource.

The segment definitions can be changed on the fly, even while the file is being updated.

A SEGMDEF structure is used to specify each segment. It is defined in ctport.h as:

typedef struct segmdef {

pTEXT sgname; /* pointer to segment name */

LONG sgsize; /* size of segment in MB */

} SEGMDEF;

sgname points to the name of the segment. The sgname parameter conveys not only a name to use for the segment, but, by virtue of any path or device specification used in the segment name, where the segment should be located.

sgsize specifies the size of a segment in MB. Therefore, if you have the segment size in bytes, divide it by 1,048,576 to get MB.

TOCIndex