michael@0: /* michael@0: ****************************************************************************** michael@0: * michael@0: * Copyright (C) 1997-2005, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: * michael@0: ****************************************************************************** michael@0: * michael@0: * File FILESTRM.H michael@0: * michael@0: * Contains FileStream interface michael@0: * michael@0: * @author Glenn Marcy michael@0: * michael@0: * Modification History: michael@0: * michael@0: * Date Name Description michael@0: * 5/8/98 gm Created. michael@0: * 03/02/99 stephen Reordered params in ungetc to match stdio michael@0: * Added wopen michael@0: * michael@0: ****************************************************************************** michael@0: */ michael@0: michael@0: #ifndef FILESTRM_H michael@0: #define FILESTRM_H michael@0: michael@0: #include "unicode/utypes.h" michael@0: michael@0: typedef struct _FileStream FileStream; michael@0: michael@0: U_CAPI FileStream* U_EXPORT2 michael@0: T_FileStream_open(const char* filename, const char* mode); michael@0: michael@0: /* michael@0: U_CAPI FileStream* U_EXPORT2 michael@0: T_FileStream_wopen(const wchar_t* filename, const wchar_t* mode); michael@0: */ michael@0: U_CAPI void U_EXPORT2 michael@0: T_FileStream_close(FileStream* fileStream); michael@0: michael@0: U_CAPI UBool U_EXPORT2 michael@0: T_FileStream_file_exists(const char* filename); michael@0: michael@0: /* michael@0: U_CAPI FileStream* U_EXPORT2 michael@0: T_FileStream_tmpfile(void); michael@0: */ michael@0: michael@0: U_CAPI int32_t U_EXPORT2 michael@0: T_FileStream_read(FileStream* fileStream, void* addr, int32_t len); michael@0: michael@0: U_CAPI int32_t U_EXPORT2 michael@0: T_FileStream_write(FileStream* fileStream, const void* addr, int32_t len); michael@0: michael@0: U_CAPI void U_EXPORT2 michael@0: T_FileStream_rewind(FileStream* fileStream); michael@0: michael@0: /*Added by Bertrand A. D. */ michael@0: U_CAPI char * U_EXPORT2 michael@0: T_FileStream_readLine(FileStream* fileStream, char* buffer, int32_t length); michael@0: michael@0: U_CAPI int32_t U_EXPORT2 michael@0: T_FileStream_writeLine(FileStream* fileStream, const char* buffer); michael@0: michael@0: U_CAPI int32_t U_EXPORT2 michael@0: T_FileStream_putc(FileStream* fileStream, int32_t ch); michael@0: michael@0: U_CAPI int U_EXPORT2 michael@0: T_FileStream_getc(FileStream* fileStream); michael@0: michael@0: U_CAPI int32_t U_EXPORT2 michael@0: T_FileStream_ungetc(int32_t ch, FileStream *fileStream); michael@0: michael@0: U_CAPI int32_t U_EXPORT2 michael@0: T_FileStream_peek(FileStream* fileStream); michael@0: michael@0: U_CAPI int32_t U_EXPORT2 michael@0: T_FileStream_size(FileStream* fileStream); michael@0: michael@0: U_CAPI int U_EXPORT2 michael@0: T_FileStream_eof(FileStream* fileStream); michael@0: michael@0: U_CAPI int U_EXPORT2 michael@0: T_FileStream_error(FileStream* fileStream); michael@0: michael@0: /* michael@0: U_CAPI void U_EXPORT2 michael@0: T_FileStream_setError(FileStream* fileStream); michael@0: */ michael@0: michael@0: U_CAPI FileStream* U_EXPORT2 michael@0: T_FileStream_stdin(void); michael@0: michael@0: U_CAPI FileStream* U_EXPORT2 michael@0: T_FileStream_stdout(void); michael@0: michael@0: U_CAPI FileStream* U_EXPORT2 michael@0: T_FileStream_stderr(void); michael@0: michael@0: U_CAPI UBool U_EXPORT2 michael@0: T_FileStream_remove(const char* fileName); michael@0: michael@0: #endif /* _FILESTRM*/