.title rmark Mark the file position .ident "V02.00" ;+ ; Index Mark the file position ; ; Usage ; ; extern long rmark(); ; ; fpb = rmark(stream) ; long fpb; /* File position */ ; int stream; /* Stream number returned by open */ ; ; Description ; ; rmark() is used in conjunction with seek() to achieve a ; degree of random access capability in sequential files. ; rmark() returns -1 on error and the file position on success. ;- ; Edit History ; V02.00 18-Oct-82 TTC Rework of old CS library ; .MCALL FSDEF$ FSDEF$ .psect c$code rmark:: jsr r5,csv$ ; Link environments mov #FS.MRK,fsqio+q.iofn ; Function: FS.MRK mov #fsqio+q.iopl,r0 ; r0 --> qio param list for prmclr mov r0,r2 ; save for later call prmclr ; Clear parameter list mov C$PMTR+0(r5),(r2)+ ; Parameter #1: Stream Number sub #2,sp ; Create fpb on stack mov sp,(r2)+ ; Param #2: Fpb address mov #4,(r2)+ ; Param #3: Fpb size, must be 4 mov #fsqio,r0 ; r0 --> fsqio for xqiow call .xqiow ; execute qiow cmp $dsw,#is.suc ; How'd it go bne 20$ ; Not good cmpb f.iosb,#is.suc beq 30$ ; OK 20$: mov #-1,r1 ; Error: return -1 sxt r0 ; (the right way) br 40$ 30$: mov (sp)+,r0 ; Return the file position mov (sp),r1 ; as a long 40$: jmp cret$ .end