FUNCTION TYPBUF(LUN:integer):INTEGER; EXTERNAL; { *USER* The TYPBUF function returns the current character count in the typeahead buffer of the specified lun number in LUN. Naturally, the lun must be assigned to a device that has typeahead enabled (like a terminal with TYPEAHEAD), and the device must be attached. A zero or positive integer returned as the value of TYPBUF will be the current character count. A negative integer will be returned if the lun specified is not a "typeahead" device. The negative value will be a directive error code or an IO error code. This routine uses local efn 24, which is reserved for P3UITL use. *ERROR CODES* A returned negative value is either a directive error or an IO error code resulting from the QIOW SF.GMC call. Common errors would be: .lit -7 (IE.DNA) device not attached -15 (IE.ABO) request terminated - invalid device or no typeahead -96 (IE.ILU) invalid lun number *WIZARD* Typeahead count is retrieved using the QIOW SF.GMC function, specifying the TC.TBF characteristic code. }