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