Drop unneeded indirection and unused argument
[LibreOffice.git] / include / store / store.h
blob2fdfa4a302d75619c9de9e24e5e7056ab51c7e57
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <store/storedllapi.h>
23 #include <store/types.h>
24 #include <rtl/ustring.h>
25 #include <sal/types.h>
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
31 /** Handle opaque type.
33 typedef void* storeHandle;
35 /** Acquire a Handle.
36 @param Handle [in] the Handle.
37 @return store_E_None upon success
39 STORE_DLLPUBLIC storeError store_acquireHandle (
40 storeHandle Handle
41 ) SAL_THROW_EXTERN_C();
43 /** Release a Handle.
44 @param Handle [in] the Handle.
45 @return store_E_None upon success,
46 store_E_InvalidHandle otherwise.
48 STORE_DLLPUBLIC storeError store_releaseHandle (
49 storeHandle Handle
50 ) SAL_THROW_EXTERN_C();
52 /** File Handle opaque type.
54 typedef void* storeFileHandle;
56 /** Open a temporary file in memory.
57 @param nPageSize [in] the creation page size,
58 integer multiple of minimum page size.
59 @param phFile [out] the File Handle.
60 @return store_E_None upon success
62 STORE_DLLPUBLIC storeError store_createMemoryFile (
63 sal_uInt16 nPageSize,
64 storeFileHandle *phFile
65 ) SAL_THROW_EXTERN_C();
67 /** Open a file.
68 @param pFilename [in] the filename as URL or system path.
69 @param eAccessMode [in] the access mode.
70 storeAccessMode::Create truncate existing and create,
71 store_AccessReadCreate create not existing,
72 storeAccessMode::ReadWrite write existing,
73 storeAccessMode::ReadOnly never modifies.
74 @param nPageSize [in] the creation page size,
75 integer multiple of minimum page size.
76 @param phFile [out] the File Handle.
77 @return store_E_None upon success
79 STORE_DLLPUBLIC storeError store_openFile (
80 rtl_uString *pFilename,
81 storeAccessMode eAccessMode,
82 sal_uInt16 nPageSize,
83 storeFileHandle *phFile
84 ) SAL_THROW_EXTERN_C();
86 /** Close a file.
87 @param hFile [in] the File Handle.
88 @return store_E_None upon success,
89 store_E_InvalidHandle otherwise.
91 STORE_DLLPUBLIC storeError store_closeFile (
92 storeFileHandle hFile
93 ) SAL_THROW_EXTERN_C();
95 /** Flush a file.
96 @param hFile [in] the File Handle.
97 @return store_E_None upon success
99 STORE_DLLPUBLIC storeError store_flushFile (
100 storeFileHandle hFile
101 ) SAL_THROW_EXTERN_C();
103 /** Directory Handle opaque type.
105 typedef void* storeDirectoryHandle;
107 /** Open a directory.
108 @see store_openFile()
110 @param hFile [in] the File Handle.
111 @param pPath [in] the directory path.
112 @param pName [in] the directory name.
113 @param eAccessMode [in] the access mode.
114 @param phDirectory [out] the Directory Handle.
115 @return store_E_None upon success
117 STORE_DLLPUBLIC storeError store_openDirectory (
118 storeFileHandle hFile,
119 rtl_uString const *pPath,
120 rtl_uString const *pName,
121 storeAccessMode eAccessMode,
122 storeDirectoryHandle *phDirectory
123 ) SAL_THROW_EXTERN_C();
125 /** Find first directory entry.
126 @param hDirectory [in] the Directory Handle.
127 @param pFindData [out] the Find Data structure.
128 @return store_E_None upon success,
129 store_E_NoMoreFile upon end of iteration.
131 STORE_DLLPUBLIC storeError store_findFirst (
132 storeDirectoryHandle hDirectory,
133 storeFindData *pFindData
134 ) SAL_THROW_EXTERN_C();
136 /** Find next directory entry.
137 @param hDirectory [in] the Directory Handle.
138 @param pFindData [out] the Find Data structure.
139 @return store_E_None upon success,
140 store_E_NoMoreFile upon end of iteration.
142 STORE_DLLPUBLIC storeError store_findNext (
143 storeDirectoryHandle hDirectory,
144 storeFindData *pFindData
145 ) SAL_THROW_EXTERN_C();
147 /** Stream Handle opaque type.
149 typedef void* storeStreamHandle;
151 /** Open a stream.
152 @see store_openFile()
154 @param hFile [in] the File Handle.
155 @param pPath [in] the stream path.
156 @param pName [in] the stream name.
157 @param eMode [in] the access mode.
158 @param phStrm [out] the Stream Handle.
159 @return store_E_None upon success
161 STORE_DLLPUBLIC storeError store_openStream (
162 storeFileHandle hFile,
163 rtl_uString const *pPath,
164 rtl_uString const *pName,
165 storeAccessMode eMode,
166 storeStreamHandle *phStrm
167 ) SAL_THROW_EXTERN_C();
169 /** Read from a stream.
170 @param hStrm [in] the Stream Handle.
171 @param nOffset [in] the offset of the first byte to read.
172 @param pBuffer [out] the buffer.
173 @param nBytes [in] the number of bytes to read.
174 @param pnDone [out] the number of bytes actually read.
175 @return store_E_None upon success
177 STORE_DLLPUBLIC storeError store_readStream (
178 storeStreamHandle hStrm,
179 sal_uInt32 nOffset,
180 void *pBuffer,
181 sal_uInt32 nBytes,
182 sal_uInt32 *pnDone
183 ) SAL_THROW_EXTERN_C();
185 /** Write to a stream.
186 @param hStrm [in] the Stream Handle.
187 @param nOffset [in] the offset of the first byte to write.
188 @param pBuffer [in] the buffer.
189 @param nBytes [in] the number of bytes to write.
190 @param pnDone [out] the number of bytes actually written.
191 @return store_E_None upon success
193 STORE_DLLPUBLIC storeError store_writeStream (
194 storeStreamHandle hStrm,
195 sal_uInt32 nOffset,
196 const void *pBuffer,
197 sal_uInt32 nBytes,
198 sal_uInt32 *pnDone
199 ) SAL_THROW_EXTERN_C();
201 /** Remove a file entry.
202 @param hFile [in] the File Handle
203 @param pPath [in] the entry path
204 @param pName [in] the entry name
205 @return store_E_None upon success
207 STORE_DLLPUBLIC storeError store_remove (
208 storeFileHandle hFile,
209 rtl_uString const *pPath,
210 rtl_uString const *pName
211 ) SAL_THROW_EXTERN_C();
213 #ifdef __cplusplus
215 #endif
217 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */