et_def()

Allocates and initializes an event table and sets the default event function

Call
#include <vv_sys.h>
ETPTR et_def(size, default_fp)

int size

Number of entries to allow in table

EVENTFP default_fp Pointer to default event function to install
Returns  
POINTER A pointer to the initialized event table
NULLP Error. VV_ERR is set to the following:
  MEMLACK There is insufficient memory to allocate the table
Description

Memory is allocated for an event table of the desired number of entries plus one extra entry for an end-of-table marker. Since memory allocation is done with a call to mem_get(), which initializes each allocated byte to 0, all entries in the table are empty.

If a default event function is specified, it is installed in the table. In the default event function entry, ET_DEFAULT is used as the event code.

The end-of-table marker is installed in the last entry in the event table.

Related Functions

et_delfp(), et_free(), et_getfp(), et_rplevnt()


Home Contents Previous Next