.title fcsget do an fcs get .ident /000007/ ; ;+ ; ; Index do an FCS get ; ; Usage ; ; fcsget(buffer, size, iop); ; char *buffer; ; int size; ; FILE *iop; ; ; Description ; ; Reads a record from the indicated file using the FCS ; get macro. Size is the record size. ; ; The record is read by a direct call to the file ; service GET$ routine. Your program must not mix calls ; to fcsget() with calls to other I/O routines, such as ; fgets(). ; ; The actual number of bytes read is returned. Returns ; null on error. You must check $$ferr for the error code. ; ; Internal ; ; Written to allow reading NULL bytes. ; ; Bugs ; ;- ; ; Edit history ; 000001 18-Nov-84 HJJ Created from Fput. ; .mcall get$ .psect c$code fcsget:: jsr r5,csv$ ;02 mov C$PMTR+4(r5),r4 ;put IOV pointer mov C$PMTR+0(r5),r2 ;Buffer mov C$PMTR+2(r5),r1 ;Nbytes mov r4,r0 ;R0 must point to FDB add #V$FDB,R0 ;Now it does GET$ r0,r2,r1,geterr ;get the record mov V$FDB+F.NRBD(R4),R0 ;R0 := actual byte count jmp cret$ ;Done geterr: 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