Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ (2) — Plan9 3rd Edition (Vita Nuova)

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

draw-intro(2)

draw-pointer(2)

DEVPOINTER(2)  —  mux

NAME

devpointer − I/O interface for the pointer device

SYNOPSIS

include "draw.m";   # for Draw->Pointer
include "devpointer.m";
ptr:= load Devpointer Devpointer->PATH;
 init:      fn(file: string, posn: chan of ref Draw->Pointer): int;
bytes2ptr: fn(buf: array of byte)    : ref Draw->Pointer;
ptr2bytes: fn(ptr: ref Draw->Pointer): array of byte;

DESCRIPTION

­Devpointer reads messages from pointer devices with the same data format as /dev/pointer, converting them to ­Pointer adts. 

­Init spawns a process to read continually the pointer device specified by ­file and send a ­Pointer adts over the channel specified by posn. If ­file is nil, the default device is /dev/pointer. 

­Bytes2ptr converts the array of bytes ­buf to a ­Pointer and returns a reference to it.  ­Buf should consist of exactly ­Devpointer->Size bytes and be in the format returned by /dev/pointer. 

­Ptr2bytes provides the inverse transformation of bytes2ptr: it packs the data into an array of bytes of appropriate format, which it returns. 

FILES

­/dev/pointer

SEE ALSO

draw-intro(2), draw-pointer(2)

Plan 9  —  June 07, 2000

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026