nss: upgrade to release 3.73
[LibreOffice.git] / include / store / store.h
blob7da4901a09dd5bff016754de11350d370a425581
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 #ifndef INCLUDED_STORE_STORE_H
21 #define INCLUDED_STORE_STORE_H
23 #include <store/storedllapi.h>
24 #include <store/types.h>
25 #include <rtl/ustring.h>
26 #include <sal/types.h>
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
32 /** Handle opaque type.
34 typedef void* storeHandle;
36 /** Acquire a Handle.
37 @param Handle [in] the Handle.
38 @return store_E_None upon success
40 STORE_DLLPUBLIC storeError store_acquireHandle (
41 storeHandle Handle
42 ) SAL_THROW_EXTERN_C();
44 /** Release a Handle.
45 @param Handle [in] the Handle.
46 @return store_E_None upon success,
47 store_E_InvalidHandle otherwise.
49 STORE_DLLPUBLIC storeError store_releaseHandle (
50 storeHandle Handle
51 ) SAL_THROW_EXTERN_C();
53 /** File Handle opaque type.
55 typedef void* storeFileHandle;
57 /** Open a temporary file in memory.
58 @param nPageSize [in] the creation page size,
59 integer multiple of minimum page size.
60 @param phFile [out] the File Handle.
61 @return store_E_None upon success
63 STORE_DLLPUBLIC storeError store_createMemoryFile (
64 sal_uInt16 nPageSize,
65 storeFileHandle *phFile
66 ) SAL_THROW_EXTERN_C();
68 /** Open a file.
69 @param pFilename [in] the filename as URL or system path.
70 @param eAccessMode [in] the access mode.
71 storeAccessMode::Create truncate existing and create,
72 store_AccessReadCreate create not existing,
73 storeAccessMode::ReadWrite write existing,
74 storeAccessMode::ReadOnly never modifies.
75 @param nPageSize [in] the creation page size,
76 integer multiple of minimum page size.
77 @param phFile [out] the File Handle.
78 @return store_E_None upon success
80 STORE_DLLPUBLIC storeError store_openFile (
81 rtl_uString *pFilename,
82 storeAccessMode eAccessMode,
83 sal_uInt16 nPageSize,
84 storeFileHandle *phFile
85 ) SAL_THROW_EXTERN_C();
87 /** Close a file.
88 @param hFile [in] the File Handle.
89 @return store_E_None upon success,
90 store_E_InvalidHandle otherwise.
92 STORE_DLLPUBLIC storeError store_closeFile (
93 storeFileHandle hFile
94 ) SAL_THROW_EXTERN_C();
96 /** Flush a file.
97 @param hFile [in] the File Handle.
98 @return store_E_None upon success
100 STORE_DLLPUBLIC storeError store_flushFile (
101 storeFileHandle hFile
102 ) SAL_THROW_EXTERN_C();
104 /** Directory Handle opaque type.
106 typedef void* storeDirectoryHandle;
108 /** Open a directory.
109 @see store_openFile()
111 @param hFile [in] the File Handle.
112 @param pPath [in] the directory path.
113 @param pName [in] the directory name.
114 @param eAccessMode [in] the access mode.
115 @param phDirectory [out] the Directory Handle.
116 @return store_E_None upon success
118 STORE_DLLPUBLIC storeError store_openDirectory (
119 storeFileHandle hFile,
120 rtl_uString const *pPath,
121 rtl_uString const *pName,
122 storeAccessMode eAccessMode,
123 storeDirectoryHandle *phDirectory
124 ) SAL_THROW_EXTERN_C();
126 /** Find first directory entry.
127 @param hDirectory [in] the Directory Handle.
128 @param pFindData [out] the Find Data structure.
129 @return store_E_None upon success,
130 store_E_NoMoreFile upon end of iteration.
132 STORE_DLLPUBLIC storeError store_findFirst (
133 storeDirectoryHandle hDirectory,
134 storeFindData *pFindData
135 ) SAL_THROW_EXTERN_C();
137 /** Find next directory entry.
138 @param hDirectory [in] the Directory Handle.
139 @param pFindData [out] the Find Data structure.
140 @return store_E_None upon success,
141 store_E_NoMoreFile upon end of iteration.
143 STORE_DLLPUBLIC storeError store_findNext (
144 storeDirectoryHandle hDirectory,
145 storeFindData *pFindData
146 ) SAL_THROW_EXTERN_C();
148 /** Stream Handle opaque type.
150 typedef void* storeStreamHandle;
152 /** Open a stream.
153 @see store_openFile()
155 @param hFile [in] the File Handle.
156 @param pPath [in] the stream path.
157 @param pName [in] the stream name.
158 @param eMode [in] the access mode.
159 @param phStrm [out] the Stream Handle.
160 @return store_E_None upon success
162 STORE_DLLPUBLIC storeError store_openStream (
163 storeFileHandle hFile,
164 rtl_uString const *pPath,
165 rtl_uString const *pName,
166 storeAccessMode eMode,
167 storeStreamHandle *phStrm
168 ) SAL_THROW_EXTERN_C();
170 /** Read from a stream.
171 @param hStrm [in] the Stream Handle.
172 @param nOffset [in] the offset of the first byte to read.
173 @param pBuffer [out] the buffer.
174 @param nBytes [in] the number of bytes to read.
175 @param pnDone [out] the number of bytes actually read.
176 @return store_E_None upon success
178 STORE_DLLPUBLIC storeError store_readStream (
179 storeStreamHandle hStrm,
180 sal_uInt32 nOffset,
181 void *pBuffer,
182 sal_uInt32 nBytes,
183 sal_uInt32 *pnDone
184 ) SAL_THROW_EXTERN_C();
186 /** Write to a stream.
187 @param hStrm [in] the Stream Handle.
188 @param nOffset [in] the offset of the first byte to write.
189 @param pBuffer [in] the buffer.
190 @param nBytes [in] the number of bytes to write.
191 @param pnDone [out] the number of bytes actually written.
192 @return store_E_None upon success
194 STORE_DLLPUBLIC storeError store_writeStream (
195 storeStreamHandle hStrm,
196 sal_uInt32 nOffset,
197 const void *pBuffer,
198 sal_uInt32 nBytes,
199 sal_uInt32 *pnDone
200 ) SAL_THROW_EXTERN_C();
202 /** Remove a file entry.
203 @param hFile [in] the File Handle
204 @param pPath [in] the entry path
205 @param pName [in] the entry name
206 @return store_E_None upon success
208 STORE_DLLPUBLIC storeError store_remove (
209 storeFileHandle hFile,
210 rtl_uString const *pPath,
211 rtl_uString const *pName
212 ) SAL_THROW_EXTERN_C();
214 #ifdef __cplusplus
216 #endif
218 #endif // INCLUDED_STORE_STORE_H
223 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */