filestrm.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // © 2016 and later: Unicode, Inc. and others.
  2. // License & terms of use: http://www.unicode.org/copyright.html
  3. /*
  4. ******************************************************************************
  5. *
  6. * Copyright (C) 1997-2005, International Business Machines
  7. * Corporation and others. All Rights Reserved.
  8. *
  9. ******************************************************************************
  10. *
  11. * File FILESTRM.H
  12. *
  13. * Contains FileStream interface
  14. *
  15. * @author Glenn Marcy
  16. *
  17. * Modification History:
  18. *
  19. * Date Name Description
  20. * 5/8/98 gm Created.
  21. * 03/02/99 stephen Reordered params in ungetc to match stdio
  22. * Added wopen
  23. *
  24. ******************************************************************************
  25. */
  26. #ifndef FILESTRM_H
  27. #define FILESTRM_H
  28. #include "unicode/utypes.h"
  29. typedef struct _FileStream FileStream;
  30. U_CAPI FileStream* U_EXPORT2
  31. T_FileStream_open(const char* filename, const char* mode);
  32. /*
  33. U_CAPI FileStream* U_EXPORT2
  34. T_FileStream_wopen(const wchar_t* filename, const wchar_t* mode);
  35. */
  36. U_CAPI void U_EXPORT2
  37. T_FileStream_close(FileStream* fileStream);
  38. U_CAPI UBool U_EXPORT2
  39. T_FileStream_file_exists(const char* filename);
  40. /*
  41. U_CAPI FileStream* U_EXPORT2
  42. T_FileStream_tmpfile(void);
  43. */
  44. U_CAPI int32_t U_EXPORT2
  45. T_FileStream_read(FileStream* fileStream, void* addr, int32_t len);
  46. U_CAPI int32_t U_EXPORT2
  47. T_FileStream_write(FileStream* fileStream, const void* addr, int32_t len);
  48. U_CAPI void U_EXPORT2
  49. T_FileStream_rewind(FileStream* fileStream);
  50. /*Added by Bertrand A. D. */
  51. U_CAPI char * U_EXPORT2
  52. T_FileStream_readLine(FileStream* fileStream, char* buffer, int32_t length);
  53. U_CAPI int32_t U_EXPORT2
  54. T_FileStream_writeLine(FileStream* fileStream, const char* buffer);
  55. U_CAPI int32_t U_EXPORT2
  56. T_FileStream_putc(FileStream* fileStream, int32_t ch);
  57. U_CAPI int U_EXPORT2
  58. T_FileStream_getc(FileStream* fileStream);
  59. U_CAPI int32_t U_EXPORT2
  60. T_FileStream_ungetc(int32_t ch, FileStream *fileStream);
  61. U_CAPI int32_t U_EXPORT2
  62. T_FileStream_peek(FileStream* fileStream);
  63. U_CAPI int32_t U_EXPORT2
  64. T_FileStream_size(FileStream* fileStream);
  65. U_CAPI int U_EXPORT2
  66. T_FileStream_eof(FileStream* fileStream);
  67. U_CAPI int U_EXPORT2
  68. T_FileStream_error(FileStream* fileStream);
  69. /*
  70. U_CAPI void U_EXPORT2
  71. T_FileStream_setError(FileStream* fileStream);
  72. */
  73. U_CAPI FileStream* U_EXPORT2
  74. T_FileStream_stdin(void);
  75. U_CAPI FileStream* U_EXPORT2
  76. T_FileStream_stdout(void);
  77. U_CAPI FileStream* U_EXPORT2
  78. T_FileStream_stderr(void);
  79. U_CAPI UBool U_EXPORT2
  80. T_FileStream_remove(const char* fileName);
  81. #endif /* _FILESTRM*/