1c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott/*
2c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott******************************************************************************
3c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*
4c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*   Copyright (C) 1997-2005, International Business Machines
5c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*   Corporation and others.  All Rights Reserved.
6c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*
7c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott******************************************************************************
8c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*
9c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott* File FILESTRM.H
10c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*
11c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott* Contains FileStream interface
12c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*
13c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott* @author       Glenn Marcy
14c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*
15c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott* Modification History:
16c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*
17c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*   Date        Name        Description
18c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*   5/8/98      gm          Created.
19c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*  03/02/99     stephen     Reordered params in ungetc to match stdio
20c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*                           Added wopen
21c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*
22c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott******************************************************************************
23c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*/
24c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
25c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#ifndef FILESTRM_H
26c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#define FILESTRM_H
27c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
28c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#include "unicode/utypes.h"
29c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
30c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scotttypedef struct _FileStream FileStream;
31c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
32c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI FileStream* U_EXPORT2
33c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_open(const char* filename, const char* mode);
34c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
35c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott/*
36c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI FileStream* U_EXPORT2
37c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_wopen(const wchar_t* filename, const wchar_t* mode);
38c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*/
39c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI void U_EXPORT2
40c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_close(FileStream* fileStream);
41c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
42c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI UBool U_EXPORT2
43c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_file_exists(const char* filename);
44c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
45c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott/*
46c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI FileStream* U_EXPORT2
47c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_tmpfile(void);
48c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*/
49c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
50c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI int32_t U_EXPORT2
51c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_read(FileStream* fileStream, void* addr, int32_t len);
52c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
53c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI int32_t U_EXPORT2
54c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_write(FileStream* fileStream, const void* addr, int32_t len);
55c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
56c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI void U_EXPORT2
57c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_rewind(FileStream* fileStream);
58c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
59c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott/*Added by Bertrand A. D. */
60c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI char * U_EXPORT2
61c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_readLine(FileStream* fileStream, char* buffer, int32_t length);
62c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
63c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI int32_t U_EXPORT2
64c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_writeLine(FileStream* fileStream, const char* buffer);
65c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
66c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI int32_t U_EXPORT2
67c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_putc(FileStream* fileStream, int32_t ch);
68c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
69c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI int U_EXPORT2
70c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_getc(FileStream* fileStream);
71c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
72c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI int32_t U_EXPORT2
73c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_ungetc(int32_t ch, FileStream *fileStream);
74c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
75c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI int32_t U_EXPORT2
76c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_peek(FileStream* fileStream);
77c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
78c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI int32_t U_EXPORT2
79c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_size(FileStream* fileStream);
80c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
81c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI int U_EXPORT2
82c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_eof(FileStream* fileStream);
83c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
84c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI int U_EXPORT2
85c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_error(FileStream* fileStream);
86c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
87c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott/*
88c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI void U_EXPORT2
89c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_setError(FileStream* fileStream);
90c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*/
91c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
92c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI FileStream* U_EXPORT2
93c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_stdin(void);
94c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
95c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI FileStream* U_EXPORT2
96c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_stdout(void);
97c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
98c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI FileStream* U_EXPORT2
99c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_stderr(void);
100c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
101c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_CAPI UBool U_EXPORT2
102c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottT_FileStream_remove(const char* fileName);
103c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
104c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#endif /* _FILESTRM*/
105