Sun Microsystems 800-1256-04 — Sun Microsystems 800-1256-04 SunCGI Reference Manual PDF

Chapter 5 - Input 95 Q Enable Events Cerror enable_events(devclass, devnum) Cdevoff devclass; /* device type*/ Cint devnum; /* device number *I enable events allows a device in NO EVENTS state to put events on the - - event queue. enable_events puts the input device in the QUEUE_EVENT state. An error is generated if the device specified by devclass or devnum does not exist or is not initialized. Errors ENOTVSAC [4] CGI not in proper state: CGI shall be in state VSAC. EINDNOEX [80] Input device does not exist EINDINIT [81] Input device not initialized. EIAEVNEN [93] Events already enabled.

Await Event Cerror await_event(timeout, valid, devclass, devnum, measure, message_link, replost, time_stamp, qstat, overflow) Cint timeout; /* input timeout period*/ Cawresult *valid; /*status*/ Cdevoff *devclass; /* device type*/ Cint *devnum; /* device number*/ Cinrep *measure; /* device value*/ Cmesstype *message_link; /* type of message*/ Cint *replost; /* reports lost*/ Cint *time_stamp; /* time_stamp */ Cqtype *qstat; /* queue status*/ Ceqflow *overflow; /* event queue status*/ 0 await_event processes the event at the head of the event queue. valid is set to WRONG_SfATE if SunCGI is not in state VSAC.

If the event queue is EMPTY, then await_ event waits timeout microseconds for a trigger to be activated. If timeout is less than 0, SunCGI waits until a trigger is activated. valid is set to VAUD_DATA if a trigger is activated within the specified timeout period and TIMED_ OUT otherwise. If either the event queue is not empty or a trigger is activated, the class, number and value of the device generating the evem are reported in the returned argu- ments devclass, devnum and measure. If the appropriate field of the measure argument is a pointer, it must be set to an application program allocated area.

If two events on the evem queue have the same trigger but different values, the argumem message_linlc is assigned to SIMULTANEOUS_EVENT_FOU.OWS; other- wise the argumem message_linlc is set to SINGLE_EVENT. The enumerated type Croes st ype contains the following values: typedef enum { SIMULTANEOUS_EVENT_FOLLOWS, SINGLE_EVENT Cmesstype; 0 The replost and time _stamp arguments should be ignored and are always zero. The returned argument qstat reports the queue status after an event is removed Version C of 17 March 1986