Previous: struct x1f4_f6link_type, Up: Mk 6 Formatter Types


7.7.2.3 struct x1f4_ffield_type

typedef struct x1f4_ffield_type {
    const char *description;
    const struct x1f4_efield_type *efield_data;
    unsigned (*count_field) (void *, unsigned), flags, index;
    void (*put_field) (void *, unsigned);
} x1f4_ffield_type;

The struct x1f4_ffield_type record describes formatting directives.

description
The description field is used by the formatting directives hierarchy printing functions as a short formatting directive description. It is otherwise unused throughout Mk 6 application data formatter.

See Application Help Message.

flags
The flags field is a bitwise OR of zero or more directive flag bits.

See Directive Flags.

index
The index field indicates the formatting directive introducing literal sign. The valid range for the index field is limited to letters.

See Format Specification Syntax.

count_field
The count_field field is the method that retrieves the formatted width for the non subformat specifier formatting directives and the number of formatting iterations for subformat specifier formatting directives.

See Format Specification Syntax.

It is passed the data formatting context as the first argument and a bitwise OR of zero or more formatting flag bits as the second argument.

See x1f4_run_format6.

See Formatting Flags.

For non subformat specifier formatting directives the formatted width may indicate the number of bytes or characters to which the directive formats (i.e. the number of bytes or characters the put_field outputs) when the formatting is actual text formatting. The data formatter will use this information to compute the amount of (white) space that needs to be inserted to meet the field minimum width formatting specifications.

For conditional output subformat specifier formatting directives the count_field method is expected to output 0 if the directive first subformat specification logic is not to be executed and the directive second subformat specification, if any, logic is to be executed and non zero if the directive first subformat specification logic is to be executed.

See Conditional Formatting.

For iterative output subformat specifier formatting directives the count_field method is expected to output the iteration upper bound when the X1f4_FORMAT_INDEXED is set in its flags argument. The directive subformat specification logic will be executed as many times the thus application limited user specified range rules. If no user range has been specified the 0 to infinity range is assumed. For the same iterative output subformat specifier formatting directives the count_field method output is irrelevant if the X1f4_FORMAT_INDEXED is not set in its flags argument.

See Iterative Formatting.

See Formatting Flags.

The data formatter assumes the subformat specifier formatting directives to be iterative output ones if a range has been specified or if the X1f4_FORMAT_ITERATE bit in the flags field has been specified and conditional output ones otherwise.

See Directive Flags.

put_field
The put_field field is the method that does the actual formatting for the non subformat specifier formatting directives and NULL for subformat specifier formatting directives.

See Format Specification Syntax.

It is passed the data formatting context as the first argument and a bitwise OR of zero or more formatting flag bits as the second argument.

See x1f4_run_format6.

See Formatting Flags.

efield_data
The efield_data field is the list of formatting directives replacing the current one for subformat specifier formatting directives and NULL otherwise.

See Format Specification Syntax.

See struct x1f4_efield_type.