1999-08-16 21:50:52 +00:00
|
|
|
/*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
1999-12-13 22:28:37 +00:00
|
|
|
*
|
2001-03-21 20:44:20 +00:00
|
|
|
* Copyright (C) 1997-2001, International Business Machines
|
1999-12-13 22:28:37 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
1999-08-16 21:50:52 +00:00
|
|
|
*
|
|
|
|
* File FILESTRM.H
|
|
|
|
*
|
|
|
|
* Contains FileStream interface
|
|
|
|
*
|
|
|
|
* @author Glenn Marcy
|
|
|
|
*
|
|
|
|
* Modification History:
|
|
|
|
*
|
|
|
|
* Date Name Description
|
|
|
|
* 5/8/98 gm Created.
|
|
|
|
* 03/02/99 stephen Reordered params in ungetc to match stdio
|
|
|
|
* Added wopen
|
|
|
|
*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
1999-08-16 21:50:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FILESTRM_H
|
|
|
|
#define FILESTRM_H
|
|
|
|
|
|
|
|
#ifndef _UTYPES
|
1999-12-28 23:39:02 +00:00
|
|
|
#include "unicode/utypes.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct _FileStream FileStream;
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI FileStream* U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_open(const char* filename, const char* mode);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI FileStream* U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_wopen(const wchar_t* filename, const wchar_t* mode);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI void U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_close(FileStream* fileStream);
|
|
|
|
|
2000-05-18 22:08:39 +00:00
|
|
|
U_CAPI UBool U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_file_exists(const char* filename);
|
|
|
|
|
2001-11-01 23:17:49 +00:00
|
|
|
/*
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI FileStream* U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_tmpfile(void);
|
2001-11-01 23:17:49 +00:00
|
|
|
*/
|
1999-08-16 21:50:52 +00:00
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_read(FileStream* fileStream, void* addr, int32_t len);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_write(FileStream* fileStream, const void* addr, int32_t len);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI void U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_rewind(FileStream* fileStream);
|
|
|
|
|
|
|
|
/*Added by Bertrand A. D. */
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI char * U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_readLine(FileStream* fileStream, char* buffer, int32_t length);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_writeLine(FileStream* fileStream, const char* buffer);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_putc(FileStream* fileStream, int32_t ch);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI int U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_getc(FileStream* fileStream);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_ungetc(int32_t ch, FileStream *fileStream);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_peek(FileStream* fileStream);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_size(FileStream* fileStream);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI int U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_eof(FileStream* fileStream);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI int U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_error(FileStream* fileStream);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI void U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_setError(FileStream* fileStream);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI FileStream* U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_stdin(void);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI FileStream* U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_stdout(void);
|
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
U_CAPI FileStream* U_EXPORT2
|
1999-08-16 21:50:52 +00:00
|
|
|
T_FileStream_stderr(void);
|
|
|
|
|
|
|
|
#endif /* _FILESTRM*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|