home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / KAFFE-0.2 / KAFFEH / FILE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-30  |  659 b   |  42 lines

  1. /*
  2.  * file.h
  3.  * File support routines.
  4.  *
  5.  * Copyright (c) 1996 Systems Architecture Research Centre,
  6.  *           City University, London, UK.
  7.  *
  8.  * See the file "license.terms" for information on usage and redistribution
  9.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  10.  *
  11.  * Written by Tim Wilkinson <tim@sarc.city.ac.uk>, February 1996.
  12.  */
  13.  
  14. #ifndef __file_h
  15. #define __file_h
  16.  
  17. #include <stdio.h>
  18. #include "gtypes.h"
  19.  
  20. inline
  21. void
  22. readu1(u1* c, FILE* f)
  23. {
  24.     *c = getc(f);
  25. }
  26.  
  27. inline
  28. void
  29. readu2(u2* c, FILE* f)
  30. {
  31.     *c = (getc(f) << 8) | getc(f);
  32. }
  33.  
  34. inline
  35. void
  36. readu4(u4* c, FILE* f)
  37. {
  38.     *c = (getc(f) << 24)|(getc(f) << 16)|(getc(f) << 8)|getc(f);
  39. }
  40.  
  41. #endif
  42.