home *** CD-ROM | disk | FTP | other *** search
-
- * Maxon C++ Library:
- * Modul "getstring"
- * Jens Gelhar 11.05.93
-
- xdef _gets,gets__Pc,_fgets,fgets__PciP06stream
-
- xref _std__in,fgetc__P06stream
-
- _gets:
- gets__Pc: ; Stack-Parameter: char*
- pea _std__in
- move.l #80,-(a7)
- move.l 8+4(a7),-(a7)
- bsr.b _fgets
- lea 12(a7),a7
- rts
-
- _fgets:
- fgets__PciP06stream: ; Stack-Parameter: char*, int, stream*
- movem.l d1/a0,-(a7)
- move.l 8+4(a7),a0
- move.l 8+8(a7),d1
- beq.b fgerr
- subq.l #1,d1
- beq.b fgend
- fgLoop: move.l 8+12(a7),-(a7)
- jsr fgetc__P06stream
- addq.l #4,a7
- cmp.l #256,d0
- bhs.b fgerr
- cmp.b #10,d0
- beq.s fgend
- move.b d0,(a0)+
- subq.l #1,d1
- bne.s fgLoop
- fgend: clr.b (a0)
- movem.l (a7)+,d1/a0
- move.l 4(a7),d0
- rts
- fgerr: movem.l (a7)+,d1/a0
- moveq #0,d0
- rts
-
- end
-
-