• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*---------------------------------------------------------------------------*
2  *  PANSIFileImpl.h  *
3  *                                                                           *
4  *  Copyright 2007, 2008 Nuance Communciations, Inc.                               *
5  *                                                                           *
6  *  Licensed under the Apache License, Version 2.0 (the 'License');          *
7  *  you may not use this file except in compliance with the License.         *
8  *                                                                           *
9  *  You may obtain a copy of the License at                                  *
10  *      http://www.apache.org/licenses/LICENSE-2.0                           *
11  *                                                                           *
12  *  Unless required by applicable law or agreed to in writing, software      *
13  *  distributed under the License is distributed on an 'AS IS' BASIS,        *
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
15  *  See the License for the specific language governing permissions and      *
16  *  limitations under the License.                                           *
17  *                                                                           *
18  *---------------------------------------------------------------------------*/
19 
20 #ifndef __PANSIFILEIMPL_H
21 #define __PANSIFILEIMPL_H
22 
23 
24 
25 #include "PFile.h"
26 #include "PFileImpl.h"
27 #ifdef USE_THREAD
28 #include "ptrd.h"
29 #endif
30 
31 /**
32  * Portable file, ANSI implementation.
33  */
34 typedef struct PANSIFileImpl_t
35 {
36   /**
37    * Superinterface.
38    */
39   PFileImpl Interface;
40 
41   /**
42    * Underlying file.
43    */
44   FILE* value;
45 }
46 PANSIFileImpl;
47 
48 
49 /**
50  * ANSI implementation.
51  */
52 PORTABLE_API ESR_ReturnCode PANSIFileCreateImpl(const LCHAR* filename, ESR_BOOL isLittleEndian, PFile** self);
53 
54 /**
55  * ANSI implementation.
56  */
57 PORTABLE_API ESR_ReturnCode PANSIFileDestroyImpl(PFile* self);
58 
59 /**
60  * ANSI implementation.
61  */
62 PORTABLE_API ESR_ReturnCode PANSIFileOpenImpl(PFile* self, const LCHAR* mode);
63 
64 /**
65  * ANSI implementation.
66  */
67 PORTABLE_API ESR_ReturnCode PANSIFileCloseImpl(PFile* self);
68 
69 /**
70  * ANSI implementation.
71  */
72 PORTABLE_API ESR_ReturnCode PANSIFileReadImpl(PFile* self, void* buffer, size_t size, size_t* count);
73 
74 /**
75  * ANSI implementation.
76  */
77 PORTABLE_API ESR_ReturnCode PANSIFileWriteImpl(PFile* self, void* buffer, size_t size, size_t* count);
78 
79 /**
80  * ANSI implementation.
81  */
82 PORTABLE_API ESR_ReturnCode PANSIFileFlushImpl(PFile* self);
83 
84 /**
85  * ANSI implementation.
86  */
87 PORTABLE_API ESR_ReturnCode PANSIFileSeekImpl(PFile* self, long offset, int origin);
88 
89 /**
90  * ANSI implementation.
91  */
92 PORTABLE_API ESR_ReturnCode PANSIFileGetPositionImpl(PFile* self, size_t* position);
93 
94 /**
95  * ANSI implementation.
96  */
97 PORTABLE_API ESR_ReturnCode PANSIFileIsOpenImpl(PFile* self, ESR_BOOL* isOpen);
98 
99 /**
100  * ANSI implementation.
101  */
102 PORTABLE_API ESR_ReturnCode PANSIFileIsEOFImpl(PFile* self, ESR_BOOL* isEof);
103 
104 /**
105  * ANSI implementation.
106  */
107 PORTABLE_API ESR_ReturnCode PANSIFileIsErrorSetImpl(PFile* self, ESR_BOOL* isError);
108 
109 /**
110  * ANSI implementation.
111  */
112 PORTABLE_API ESR_ReturnCode PANSIFileClearErrorImpl(PFile* self);
113 
114 /**
115  * ANSI implementation.
116  */
117 PORTABLE_API ESR_ReturnCode PANSIFileVfprintfImpl(PFile* self, int* result, const LCHAR* format, va_list args);
118 
119 /**
120  * ANSI implementation.
121  */
122 PORTABLE_API ESR_ReturnCode PANSIFileFgetcImpl(PFile* self, LINT* result);
123 
124 /**
125  * ANSI implementation.
126  */
127 PORTABLE_API ESR_ReturnCode PANSIFileFgetsImpl(PFile* self, LCHAR* string, int n, LCHAR** result);
128 
129 /**
130  * ANSI implementation.
131  */
132 PORTABLE_API ESR_ReturnCode PANSIFileHideMemoryAllocation(PFile* self);
133 
134 #endif /* __PANSIFILEIMPL_H */
135