forsyth20121205-174063a80cc13 years agoHistory
78 lines · 1.6 KB · Text
RawDownload
.TH DEVPOINTER 2 mux.SH NAMEdevpointer \- I/O interface for the pointer device.SH SYNOPSIS.EXinclude "draw.m";   # for Draw->Pointerinclude "devpointer.m";ptr := load Devpointer Devpointer->PATH; init:      fn();reader:    fn(file: string, posn: chan of ref Draw->Pointer,              pid: chan of (int, string));bytes2ptr: fn(buf: array of byte)    : ref Draw->Pointer;ptr2bytes: fn(ptr: ref Draw->Pointer): array of byte;.EE.SH DESCRIPTION.B Devpointerreads messages from pointer devices with the same data format as.BR /dev/pointer ,converting them to.B Pointeradts..PP.B Initmust be called before any other operation of the module..PP.B Readershould be spawned by the caller.It opens the pointer device specified by.IR file ,and sends a value.BI ( id,\ err )on channel.IR pid .On success,.I idis the process ID of the spawned process and.I erris nil; on an error,.I erris a diagnostic, and.I idis undefined.If the file was opened successfully,.B readercontinually reads the pointer device and sends.B Pointeradts over the channel.IR posn .If.I fileis.BR nil ,the default device is.BR /dev/pointer ..PP.B Bytes2ptrconverts the array of bytes.I bufto a.B Pointerand returns a reference to it..I Bufshould consist of exactly.B Devpointer->Sizebytes and be in the format returned by.BR /dev/pointer ..PP.B Ptr2bytesprovides the inverse transformation of.BR bytes2ptr :it packs the data into an array of bytes of appropriate format,which it returns..SH FILES.B /dev/pointer.SH "SEE ALSO".IR draw-intro (2),.IR draw-pointer (2)