/* OBJECT device V1.2 by Gregor Goldbach with suggs by Trey van Riper v2.0 12.4.95: made it fit to 'Object' methods: open() close() end() doio() sendio() abortio() reset() */ OPT MODULE OPT OSVERSION=37 OPT EXPORT OPT PREPROCESS MODULE 'exec/devices', 'exec/io', 'exec/nodes', 'exec/ports','exec/devices', 'oomodules/library' CONST SIZE_OF_BIGGEST_DEVICE_BLOCK=100, -> the size of the biggest device block LONGEST_NAME=40 OBJECT device OF library unit io:PTR TO io flags lasterror ENDOBJECT PROC name() OF device IS 'Device' PROC select(optionlist,index) OF device DEF item,now=NIL item := ListItem(optionlist, index) SELECT item CASE "name" INC index self.name := ListItem(optionlist,index) now := 1 CASE "unit" INC index self.unit := ListItem(optionlist,index) CASE "flag" INC index self.flags := ListItem(optionlist,index) ENDSELECT IF index=ListLen(optionlist-1) THEN self.open(self.name,self.unit,self.flags) ENDPROC index PROC open(name, unit=NIL,flags=NIL) OF device /* METHOD open(n