Next: , Up: Usage Outline

7.2.1 Parsing A Format Specification

The parse a format specification the data formatter must be provided the actual format specification, the formatting directives description and some set of methods performing formatting related logics.

status = x1f4_parse_format6(&format, directives, &methods_set, specification);

See x1f4_parse_format6.

The x1f4_parse_format function parses the specification format specification according to the directives formatting directives. If successful it stores the parsed format specification at the address specified by &format. The methods in the methods_set are used to fit the parsed format specification in the application context.

Note that parsed format specifications are opaque structures and application wise typeless. Only references to parsed format specifications are application available. For convenience the C type of the parsed format specifications references is void *.

Hence, the format declaration may well be:

void *format;

The x1f4_format_type can be used interchangeably:

typedef void *x1f4_format_type;

The formatting context methods set is described via the struct x1f4_f6link_type record, thus methods_set is declarable as:

struct x1f4_f6link_type methods_set;

See struct x1f4_f6link_type.

The formatting directives are described via the struct x1f4_ffield_type record, thus directives are declarable as:

struct x1f4_ffield_type directives[...];