Next: , Previous: , Up: File Library   [Index]


7.11.5 File Output Function Generation

See Output Library.

See Output Library Reference.

A struct x1f4_datapipe_type record describing the ‘file’ output devices must be supplied to the output library constructor.

See struct x1f4_datapipe_type.

static const struct x1f4_datapipe_type file_datapipe = {
    "f",
    x1f4_pipe_lxfile,
    FILE_TYPE,
    1,
    NULL
};

See x1f4_pipe_lxfile.

The FILE_TYPE is the type id of the ‘file’ type, an application conveniently choosen value.

See Application Defined Types.

Assuming there is no other struct x1f4_datapipe_type record to be introduced, the output device description can be linked into the output library generation context as:

    struct x1f4_lxnear_type lxnear;

    lxnear.longpipe_set.datapipe_data = &file_datapipe;
    lxnear.longpipe_set.miss = 1;

See struct x1f4_lxnear_type.

See Output Library Generation Flags.

The record presence will be flagged appropriately:

    status = x1f4_init_lxnear
	(&output_library, X1f4_LXNEAR_LONGPIPE | ..., &lxnear);

See x1f4_init_lxnear.

The file library object will need to be registered with the output device description record. The registration can be done by setting the text field of the struct x1f4_datapipe_type record, or later, via x1f4_dfix_lxnear.

See x1f4_dfix_lxnear.

    x1f4_dfix_lxnear(output_library, 0, file_library);

If the executive assembler is used to generate the live library objects the registration step is not required (and the output library will be constructed by the assembler). No ‘file’ type id is required in the struct x1f4_datapipe_type record, but the record needs to be writable, as the id will be added by the assembler.

See Executive Assembler.

static const struct x1f4_datapipe_type file_datapipe = {
    "f",
    x1f4_pipe_lxfile,
    0,
    1,
    NULL
};