FileInMemoryManager.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef _FileInMemoryManager_h_
  2. #define _FileInMemoryManager_h_
  3. /* FileInMemoryManager.h
  4. *
  5. * Copyright (C) 2017 David Weenink
  6. *
  7. * This code 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 (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include "FileInMemorySet.h"
  21. #include "Strings_.h"
  22. #include "Table.h"
  23. #include "FileInMemoryManager_def.h"
  24. autoFileInMemoryManager FileInMemoryManager_create (FileInMemorySet files);
  25. autoFileInMemory FileInMemoryManager_createFile (FileInMemoryManager me, MelderFile file);
  26. /* Generates the set with ownership */
  27. autoFileInMemorySet FileInMemoryManager_extractFiles (FileInMemoryManager me, kMelder_string which, conststring32 criterion);
  28. autoTable FileInMemoryManager_downto_Table (FileInMemoryManager me, bool openFilesOnly);
  29. /*
  30. File open and read emulations. The FILE * is internally used as an index of the file in the Set.
  31. */
  32. bool FileInMemoryManager_hasDirectory (FileInMemoryManager me, conststring32 name);
  33. FILE *FileInMemoryManager_fopen (FileInMemoryManager me, const char *filename, const char *mode);
  34. void FileInMemoryManager_rewind (FileInMemoryManager me, FILE *stream);
  35. int FileInMemoryManager_fclose (FileInMemoryManager me, FILE *stream);
  36. int FileInMemoryManager_feof (FileInMemoryManager me, FILE *stream);
  37. integer FileInMemoryManager_ftell (FileInMemoryManager me, FILE *stream);
  38. int FileInMemoryManager_fseek (FileInMemoryManager me, FILE *stream, integer offset, int origin);
  39. char *FileInMemoryManager_fgets (FileInMemoryManager me, char *str, int num, FILE *stream);
  40. size_t FileInMemoryManager_fread (FileInMemoryManager me, void *ptr, size_t size, size_t count, FILE *stream);
  41. int FileInMemoryManager_fgetc (FileInMemoryManager me, FILE *stream);
  42. int FileInMemoryManager_fprintf (FileInMemoryManager me, FILE * stream, const char * format, ... );
  43. int FileInMemoryManager_ungetc (FileInMemoryManager me, int character, FILE * stream);
  44. void test_FileInMemoryManager_io (void);
  45. #endif // _FileInMemoryManager_h_