Metafile Data Format

This section describes the format of the data in a metafile, as it would be stored in an OS/2 disk file.

Metafile data is stored as a sequence of structured fields. Each structured field starts with an eight-byte header consisting of a two-byte length field and a three-byte identifier field. These are followed by a one-byte flags field and a two-byte segment sequence number field.

The length field contains a count of the total number of bytes in the structured field, including the length field. The identifier field uniquely identifies the type of the structured field.

The flags and segment sequence number fields are always zero.

Following the header are positional parameters that are optional and dependent on the particular structured field.

Following the positional parameters are non-positional parameters called triplets. These are self-defining parameters and consist of a one-byte length field, followed by a one-byte identifier field, followed by the data of the parameter.

The length field contains a count of the total number of bytes in the triplet, including the length and identifier fields. The identifier field identifies uniquely the type of the triplet.

A metafile is structured into a number of different functional components; for example, document and graphics object. Each component comprises a number of structured fields, and is delimited by "begin-component" and "end-component" structured fields. Structured fields marked as required, inside an optional structured field bracket, are required if the containing bracket is present.

The graphics orders that describe a picture occur in the graphics data structured field. See Structured Field Formats for more information.


[Back: Metafile Restrictions]
[Next: Structured Field Formats]