fscanf.s 473 B

12345678910111213141516171819202122
  1. |fscanf() implementation for TIGCCLIB - callback functions
  2. |Copyright (C) Kevin Kofler, 2002-2007
  3. /*Prototypes:
  4. CALLBACK short __fscanf_get(FILE *param);
  5. CALLBACK void __fscanf_unget(short c, FILE *param);
  6. */
  7. .text
  8. .xdef __fscanf_get
  9. __fscanf_get:
  10. |extern short fgetc(FILE*)__ATTR_LIB_C__;
  11. move.l 4(%a7),%a0
  12. jra fgetc
  13. .xdef __fscanf_unget
  14. __fscanf_unget:
  15. |#define ungetc(c,f) ((f)->unget=((c)|0x8000))
  16. bset.b #7,4(%a7)
  17. movea.l 6(%a7),%a0
  18. move.w 4(%a7),12(%a0)
  19. rts