READFILE.H 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
  12. */
  13. /*
  14. * $Source: f:/miner/source/pslib/rcs/readfile.h $
  15. * $Revision: 1.5 $
  16. * $Author: matt $
  17. * $Date: 1993/10/19 12:38:14 $
  18. *
  19. *
  20. *
  21. */
  22. #ifndef _READFILE_H
  23. #define _READFILE_H
  24. #include "types.h"
  25. #define ERROR_OPENING_FILE 21
  26. #define ERROR_WRITING_FILE 22
  27. #define ERROR_READING_DATA -20
  28. void *ReadFile( char *filename, int *length );
  29. // ReadFile reads 'filename' and returns the buffer and passes the length
  30. // in bytes.
  31. int WriteFile( char *filename, void *data, int length );
  32. // WriteFile writes 'length' bytes of 'data' to 'filename'
  33. // returns an error code != 0 if there is an error.
  34. int AppendFile( char *filename, void *data, int length );
  35. // AppendFile appends 'length' bytes of 'data' to 'filename'
  36. // returns an error code != 0 if there is an error.
  37. int ReadFileBuf( char *filename, byte *buf, int bufsize );
  38. // ReadFileBuf reads bufize bytes of 'filename' into the address of 'buf'
  39. // returns an error code < 0 if there is an error.
  40. #endif