[Top] [Prev] [Next]


devpointer - I/O interface for the pointer device


include "draw.m";   #for Draw->Pointer
include "devpointer.m";
ptr:= load Devpointer Devpointer->PATH;
Devpointer: module
  PATH:      con "/dis/lib/devpointer.dis";
   Size:      con 1+3*12;	# 'm' plus 3 12-byte decimal integers
   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;


init (file, posn)

The init function spawns a thread to continually read the pointer device specified by file and return a Pointer adt (see pointer) over the channel specified by posn. If file is nil, the default device is /dev/pointer.

bytes2ptr (buf)

The bytes2ptr function converts the array of characters in buf to a Pointer and returns a reference to it. The buf array should consist of exactly Size bytes and be in the format returned by /dev/pointer.

ptr2bytes (ptr)

The ptr2bytes function provides an inverse transformation of the bytes2ptr function.



See Also

pointer and draw

[Top] [Prev] [Next]

Copyright © 1996,Lucent Technologies, Inc. All rights reserved.