home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / MAXONC3_6OF8.DMS / in.adf / LIBSRC.LHA / LIBSRC / fileerr.asm < prev    next >
Encoding:
Assembly Source File  |  1994-04-08  |  829 b   |  56 lines

  1.  
  2. * Maxon  C++ Library:
  3. * Modul "fileerr"
  4. * Jens Gelhar 08.06.92, 08.04.94
  5.  
  6. str_error    = 7
  7. str_bufptr    = 8
  8.  
  9. buf_fill    = 6
  10. buf_pos    = 8
  11. buf_mode    = 10
  12.  
  13.     xdef    _clearerr,clearerr__P06stream
  14.     xdef    _feof,feof__P06stream
  15.     xdef    _ferror,ferror__P06stream
  16.  
  17. _clearerr:
  18. clearerr__P06stream:
  19.     move.l    4(a7),a0
  20.     clr.b    str_error(a0)
  21.     rts
  22.  
  23. _feof:
  24. feof__P06stream:
  25.     move.l    4(a7),a0
  26.     cmp.b    #-1,str_error(a0)
  27.     seq    d0
  28.     ext.w    d0
  29.     ext.l    d0
  30.     bra.b    validerr
  31.  
  32. _ferror:
  33. ferror__P06stream:
  34.     move.l    4(a7),a0
  35.     moveq    #0,d0
  36.     move.b    str_error(a0),d0
  37.     cmp.w    #$FF,d0
  38.     bne.b    ret
  39.     moveq    #0,d0
  40. validerr
  41.     tst.w    d0
  42.     beq.b    ret
  43.     move.l    str_bufptr(a0),d1    ; Buffer gesetzt?
  44.     beq.b    ret
  45.     move.l    d1,a0
  46.     tst.b    buf_mode(a0)        ; Lesepuffer?
  47.     bpl.b    ret
  48.     move.w    buf_pos(a0),d1        ; noch was drin?
  49.     cmp.w    buf_fill(a0),d1
  50.     bhs.b    ret
  51.     moveq    #0,d0            ; dann vorerst kein Problem
  52. ret    rts
  53.  
  54.     end
  55.  
  56.