home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / dcflib.h < prev    next >
Text File  |  1998-06-08  |  1KB  |  55 lines

  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.  
  26.  
  27.  
  28. #ifndef _DCFLIB_H
  29. #define _DCFLIB_H
  30.  
  31. #include "stdio.h"
  32. #include "types.h"
  33.  
  34. #define DCFILE FILE
  35.  
  36. // Opens a file for reading only. Returns NULL if error.
  37. #define dcfopen(filename) fopen((filename),"rb")
  38.  
  39. // Moves to a position in the file. Returns 0 if ok.
  40. #define dcfseek( cfile, position ) fseek( cfile, position, SEEK_SET); 
  41.  
  42. #define dcftell( cfile ) ftell(cfile)
  43. // Returns the current file position.
  44.  
  45. #define dcflength( cfile ) filelength(fileno(cfile))
  46. // Returns the length of the file.
  47.  
  48. #define dcfread( cfile, data, size ) fread(data, sizeof(byte), size, cfile)
  49. // Reads 'size' bytes of the file into 'data'. Returns 0 if ok.
  50.  
  51. #define dcfclose( cfile ) fclose( cfile )
  52. // Closes 'cfile'. Frees all memory associated with file.
  53.  
  54. #endif
  55.