.title rseek Seek to a file position .ident "V02.00" ;+ ; Index Seek to a file position ; ; Usage ; ; rseek(stream, &fpb) ; int stream; /* Stream number from open/create */ ; long fpb; /* Seek position */ ; ; Description ; ; rseek() sets the stream position of a sequential file to the ; supplied file position. It is used in conjunction with mark() to ; achieve a degree of random access capability in sequential files. ; It returns a 0 on error and 1 on success. ;- ; Edit History ; V02.00 19-Oct-82 TTC Rework of old CS library ; .MCALL FSDEF$ FSDEF$ .psect c$code rseek:: mov #FS.PNT,fsqio+q.iofn ; Function: FS.PNT mov #fsqio+q.iopl,r0 ; r0 -> qio param list for prmclr mov 2(sp),(r0)+ ; Param #1: Stream Number mov 4(sp),(r0)+ ; Param #2: Fpb address mov #4,(r0)+ ; Param #3: Fpb size, must be 4 clr (r0)+ ; Clear parameters 4, 5, and 6 clr (r0)+ clr (r0) mov #fsqio,r0 ; r0 must = qio for xqiow call .xqiow ; execute qiow mov #1,r0 ; Assume success, r0 = 1 cmp $dsw,#is.suc ; How'd it go bne 10$ ; Not so good cmpb f.iosb,#is.suc beq 20$ 10$: clr r0 ; Branch here if error, r0 = 0 20$: return .end