1 // Copyright (C) 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 27 #ifndef FILESTRM_H 28 #define FILESTRM_H 29 30 #include "unicode/utypes.h" 31 32 typedef struct _FileStream FileStream; 33 34 U_CAPI FileStream* U_EXPORT2 35 T_FileStream_open(const char* filename, const char* mode); 36 37 /* 38 U_CAPI FileStream* U_EXPORT2 39 T_FileStream_wopen(const wchar_t* filename, const wchar_t* mode); 40 */ 41 U_CAPI void U_EXPORT2 42 T_FileStream_close(FileStream* fileStream); 43 44 U_CAPI UBool U_EXPORT2 45 T_FileStream_file_exists(const char* filename); 46 47 /* 48 U_CAPI FileStream* U_EXPORT2 49 T_FileStream_tmpfile(void); 50 */ 51 52 U_CAPI int32_t U_EXPORT2 53 T_FileStream_read(FileStream* fileStream, void* addr, int32_t len); 54 55 U_CAPI int32_t U_EXPORT2 56 T_FileStream_write(FileStream* fileStream, const void* addr, int32_t len); 57 58 U_CAPI void U_EXPORT2 59 T_FileStream_rewind(FileStream* fileStream); 60 61 /*Added by Bertrand A. D. */ 62 U_CAPI char * U_EXPORT2 63 T_FileStream_readLine(FileStream* fileStream, char* buffer, int32_t length); 64 65 U_CAPI int32_t U_EXPORT2 66 T_FileStream_writeLine(FileStream* fileStream, const char* buffer); 67 68 U_CAPI int32_t U_EXPORT2 69 T_FileStream_putc(FileStream* fileStream, int32_t ch); 70 71 U_CAPI int U_EXPORT2 72 T_FileStream_getc(FileStream* fileStream); 73 74 U_CAPI int32_t U_EXPORT2 75 T_FileStream_ungetc(int32_t ch, FileStream *fileStream); 76 77 U_CAPI int32_t U_EXPORT2 78 T_FileStream_peek(FileStream* fileStream); 79 80 U_CAPI int32_t U_EXPORT2 81 T_FileStream_size(FileStream* fileStream); 82 83 U_CAPI int U_EXPORT2 84 T_FileStream_eof(FileStream* fileStream); 85 86 U_CAPI int U_EXPORT2 87 T_FileStream_error(FileStream* fileStream); 88 89 /* 90 U_CAPI void U_EXPORT2 91 T_FileStream_setError(FileStream* fileStream); 92 */ 93 94 U_CAPI FileStream* U_EXPORT2 95 T_FileStream_stdin(void); 96 97 U_CAPI FileStream* U_EXPORT2 98 T_FileStream_stdout(void); 99 100 U_CAPI FileStream* U_EXPORT2 101 T_FileStream_stderr(void); 102 103 U_CAPI UBool U_EXPORT2 104 T_FileStream_remove(const char* fileName); 105 106 #endif /* _FILESTRM*/ 107