]> git.saurik.com Git - apple/icu.git/blob - icuSources/common/filestrm.h
ICU-6.2.8.tar.gz
[apple/icu.git] / icuSources / common / filestrm.h
1 /*
2 ******************************************************************************
3 *
4 * Copyright (C) 1997-2003, International Business Machines
5 * Corporation and others. All Rights Reserved.
6 *
7 ******************************************************************************
8 *
9 * File FILESTRM.H
10 *
11 * Contains FileStream interface
12 *
13 * @author Glenn Marcy
14 *
15 * Modification History:
16 *
17 * Date Name Description
18 * 5/8/98 gm Created.
19 * 03/02/99 stephen Reordered params in ungetc to match stdio
20 * Added wopen
21 *
22 ******************************************************************************
23 */
24
25 #ifndef FILESTRM_H
26 #define FILESTRM_H
27
28 #ifndef _UTYPES
29 #include "unicode/utypes.h"
30 #endif
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 #endif /* _FILESTRM*/
106
107
108
109