.title fputr put a random record into an index file .ident /000007/ ; ;+ ; ; Index put a random record into an index file ; ; Usage ; ; fputr(buffer, size, rec, iop); ; char *buffer; ; int size; ; int rec; ; FILE *iop; ; ; Description ; ; Writes a record into the indicated file. Size is the ; record size. Rec is the record number. ; ; The record is written by a direct call to the file ; service PUT$R routine. Your program must not mix calls ; to fput() with calls to other I/O routines, such as ; fputs(). ; ; The actual number of bytes written is returned. Returns ; null on error. You must check $$ferr for the error code. ; ; Fputr() is not present on Unix standard I/O libraries. ; ; Internal ; ; Must be used with fopenx "x" option. Users should be ; familiar with FCS macro calls. ; ; Bugs ; ;- ; ; Edit history ; 000001 18-Nov-84 HJJ Created from Fput. ; .mcall put$r .psect c$code fputr:: jsr r5,csv$ ;02 mov C$PMTR+6(r5),r4 ;put IOV pointer mov C$PMTR+0(r5),r2 ;Buffer mov C$PMTR+2(r5),r1 ;Nbytes mov C$PMTR+4(r5),r3 ;record number mov r4,r0 ;R0 must point to FDB add #V$FDB,R0 ;Now it does PUT$R r0,r2,r1,r3,,puterr ;put the record mov V$FDB+F.NRBD(R4),R0 ;R0 := actual byte count jmp cret$ ;Done puterr: movb F.ERR+V$FDB(R4),R0 ;put error code mov r0,$$ferr ;Save in $$ferr for user clr r0 ; report error jmp cret$ ;Done .end