DCFLIB.H 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * $Source: f:/miner/source/main/editor/rcs/dcflib.h $
  3. * $Revision: 2.0 $
  4. * $Author: john $
  5. * $Date: 1995/02/27 11:34:25 $
  6. *
  7. * temporary demo version for mine.c
  8. *
  9. * $Log: dcflib.h $
  10. * Revision 2.0 1995/02/27 11:34:25 john
  11. * Version 2.0! No anonymous unions, Watcom 10.0, with no need
  12. * for bitmaps.tbl.
  13. *
  14. * Revision 1.3 1994/02/14 20:14:27 john
  15. * First version working with new cfile stuff.
  16. *
  17. * Revision 1.2 1994/02/08 13:38:21 yuan
  18. * mine loading functions converted.
  19. *
  20. * Revision 1.1 1994/02/08 13:23:14 yuan
  21. * Initial revision
  22. *
  23. *
  24. */
  25. #ifndef _DCFLIB_H
  26. #define _DCFLIB_H
  27. #include "stdio.h"
  28. #include "types.h"
  29. #define DCFILE FILE
  30. // Opens a file for reading only. Returns NULL if error.
  31. #define dcfopen(filename) fopen((filename),"rb")
  32. // Moves to a position in the file. Returns 0 if ok.
  33. #define dcfseek( cfile, position ) fseek( cfile, position, SEEK_SET);
  34. #define dcftell( cfile ) ftell(cfile)
  35. // Returns the current file position.
  36. #define dcflength( cfile ) filelength(fileno(cfile))
  37. // Returns the length of the file.
  38. #define dcfread( cfile, data, size ) fread(data, sizeof(byte), size, cfile)
  39. // Reads 'size' bytes of the file into 'data'. Returns 0 if ok.
  40. #define dcfclose( cfile ) fclose( cfile )
  41. // Closes 'cfile'. Frees all memory associated with file.
  42. #endif
  43.