Next: , Previous: , Up: Executive Assembler Introduction   [Index]


8.1.7 The Library Object Constructors

The standalone interpreter features all the libaime libraries. The library objects will be constructed according to struct x1f4_lxtile_type specifications (constructor routine, flags set and extra parameters set triplets):

See struct x1f4_lxtile_type.

See Aime Libraries.

const static struct x1f4_lxtile_type tiles[] = {
    {	x1f4_note_lxcase,	0,		NULL		},
    {	x1f4_note_lxcast,	0,		NULL		},
    {	x1f4_note_lxdash,	0,		NULL		},
    {	x1f4_note_lxdata,	0,		NULL		},
    {	x1f4_note_lxdate,	0,		NULL		},
    {	x1f4_note_lxdecq,	0,		NULL		},
    {	x1f4_note_lxfile,	FILE_BITS,	NULL		},
    {	x1f4_note_lxline,	0,		NULL		},
    {	x1f4_note_lxlist,	0,		NULL		},
    {	x1f4_note_lxnear,	0,		&lxnear		},
    {	x1f4_note_lxpoll,	0,		NULL		},
    {	x1f4_note_lxport,	PORT_BITS,	NULL		},
    {	x1f4_note_lxtext,	0,		NULL		},
    {	x1f4_note_lxtrap,	0,		NULL		}
};

The output library object constructor will require the descriptions for the two output functions sets:

See Output Library.

See struct x1f4_lxnear_type.

static struct x1f4_lxnear_type lxnear;

See struct x1f4_textpipe_type.

static const struct x1f4_textpipe_type near_pipes[] = {
    {	"o",		copy_output,		1,	NULL	},
    {	"v",		copy_error,		1,	NULL	}
};

Enable most of the library features as:

#define FILE_BITS \
    X1f4_LXFILE_SETCLOSE
#define PORT_BITS \
    X1f4_LXPORT_SETCLOSE

and define the two output methods:

static int
copy_error(void *none, const char *data, unsigned size)
{
    fwrite(data, size, 1, stderr);

    return 0;
}
static int
copy_output(void *none, const char *data, unsigned size)
{
    fwrite(data, size, 1, stdout);

    return 0;
}