rwfile.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Hey EMACS -*- linux-c -*- */
  2. /* $Id: misc.h 368 2004-03-22 18:42:08Z roms $ */
  3. /* libtifiles - file format library, a part of the TiLP project
  4. * Copyright (C) 1999-2005 Romain Liévin
  5. * Copyright (C) 2007 Kevin Kofler
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. */
  21. #ifndef __TIFILES_MISC__
  22. #define __TIFILES_MISC__
  23. #define gfopen fopen
  24. int fread_n_bytes(FILE * f, int n, uint8_t *s);
  25. int fwrite_n_bytes(FILE * f, int n, const uint8_t *s);
  26. int fread_n_chars(FILE * f, int n, char *s);
  27. int fwrite_n_chars(FILE * f, int n, const char *s);
  28. int fwrite_n_chars2(FILE * f, int n, const char *s);
  29. int fread_8_chars(FILE * f, char *s);
  30. int fwrite_8_chars(FILE * f, const char *s);
  31. int fskip(FILE * f, int n);
  32. int fread_byte(FILE * f, uint8_t * data);
  33. int fread_word(FILE * f, uint16_t * data);
  34. int fread_long(FILE * f, uint32_t * data);
  35. int fwrite_byte(FILE * f, uint8_t data);
  36. int fwrite_word(FILE * f, uint16_t data);
  37. int fwrite_long(FILE * f, uint32_t data);
  38. #endif