libopc
container.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010, Florian Reuter
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions
7  are met:
8 
9  * Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11  * Redistributions in binary form must reproduce the above copyright
12  notice, this list of conditions and the following disclaimer in
13  the documentation and/or other materials provided with the
14  distribution.
15  * Neither the name of Florian Reuter nor the names of its contributors
16  may be used to endorse or promote products derived from this
17  software without specific prior written permission.
18 
19  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
30  OF THE POSSIBILITY OF SUCH DAMAGE.
31 
32 */
47 #include <opc/config.h>
48 #include <opc/file.h>
49 
50 #ifndef OPC_CONTAINER_H
51 #define OPC_CONTAINER_H
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
61 
66  typedef enum {
98 
102  typedef enum {
122 
133  opcContainer* opcContainerOpen(const xmlChar *fileName,
134  opcContainerOpenMode mode,
135  void *userContext,
136  const xmlChar *destName);
137 
147  opcContainerOpenMode mode,
148  void *userContext);
149 
165  opcFileWriteCallback *iowrite,
166  opcFileCloseCallback *ioclose,
167  opcFileSeekCallback *ioseek,
168  opcFileTrimCallback *iotrim,
169  opcFileFlushCallback *ioflush,
170  void *iocontext,
171  pofs_t file_size,
172  opcContainerOpenMode mode,
173  void *userContext);
174 
184 
190 
197 
204  int opcContainerFlatExport(opcContainer *c, const xmlChar *fileName);
205 
211  int opcContainerFlatImport(opcContainer *c, const xmlChar *fileName);
212 
223  const xmlChar *opcContentTypeFirst(opcContainer *container);
224 
228  const xmlChar *opcContentTypeNext(opcContainer *container, const xmlChar *type);
229 
240  const xmlChar *opcExtensionFirst(opcContainer *container);
241 
245  const xmlChar *opcExtensionNext(opcContainer *container, const xmlChar *ext);
246 
251  const xmlChar *opcExtensionGetType(opcContainer *container, const xmlChar *ext);
252 
257  const xmlChar *opcExtensionRegister(opcContainer *container, const xmlChar *ext, const xmlChar *type);
258 
259 
270  const xmlChar *opcRelationTypeFirst(opcContainer *container);
271 
275  const xmlChar *opcRelationTypeNext(opcContainer *container, const xmlChar *type);
276 
277 
288  const xmlChar *opcExternalTargetFirst(opcContainer *container);
289 
293  const xmlChar *opcExternalTargetNext(opcContainer *container, const xmlChar *target);
294 
295 
296 #ifdef __cplusplus
297 } /* extern "C" */
298 #endif
299 
300 #endif /* OPC_CONTAINER_H */
int opcContainerFlatExport(opcContainer *c, const xmlChar *fileName)
int opcFileReadCallback(void *iocontext, char *buffer, int len)
Definition: file.h:81
opc_error_t opcContainerDump(opcContainer *c, FILE *out)
Definition: container.c:597
const xmlChar * opcRelationTypeNext(opcContainer *container, const xmlChar *type)
Definition: container.c:1472
Definition: container.h:96
Definition: container.h:81
int opcFileCloseCallback(void *iocontext)
Definition: file.h:101
puint8_t opc_uint8_t
Definition: config.h:91
const xmlChar * opcContentTypeFirst(opcContainer *container)
Definition: container.c:1269
opcContainer * opcContainerOpen(const xmlChar *fileName, opcContainerOpenMode mode, void *userContext, const xmlChar *destName)
Definition: container.c:1045
Definition: container.h:107
const xmlChar * opcExtensionFirst(opcContainer *container)
Definition: container.c:1286
int opcContainerFlatImport(opcContainer *c, const xmlChar *fileName)
const xmlChar * opcExternalTargetFirst(opcContainer *container)
Definition: container.c:1481
Definition: container.h:113
Definition: container.h:89
int opcFileTrimCallback(void *iocontext, opc_ofs_t new_size)
Definition: file.h:130
opcContainer * opcContainerOpenIO(opcFileReadCallback *ioread, opcFileWriteCallback *iowrite, opcFileCloseCallback *ioclose, opcFileSeekCallback *ioseek, opcFileTrimCallback *iotrim, opcFileFlushCallback *ioflush, void *iocontext, pofs_t file_size, opcContainerOpenMode mode, void *userContext)
Definition: container.c:1076
puint32_t opc_uint32_t
Definition: config.h:103
const xmlChar * opcExtensionNext(opcContainer *container, const xmlChar *ext)
Definition: container.c:1295
Definition: internal.h:181
const xmlChar * opcRelationTypeFirst(opcContainer *container)
Definition: container.c:1464
opc_error_t opcContainerClose(opcContainer *c, opcContainerCloseMode mode)
Definition: container.c:1239
Definition: container.h:71
enum OPC_ERROR_ENUM opc_error_t
void * opcContainerGetUserContext(opcContainer *c)
const xmlChar * opcExtensionGetType(opcContainer *container, const xmlChar *ext)
Definition: container.c:1304
opc_ofs_t opcFileSeekCallback(void *iocontext, opc_ofs_t ofs)
Definition: file.h:116
const xmlChar * opcExtensionRegister(opcContainer *container, const xmlChar *ext, const xmlChar *type)
Definition: container.c:1313
Definition: container.h:120
int opcFileFlushCallback(void *iocontext)
Definition: file.h:140
opcContainerCloseMode
Definition: container.h:102
const xmlChar * opcExternalTargetNext(opcContainer *container, const xmlChar *target)
Definition: container.c:1489
const xmlChar * opcContentTypeNext(opcContainer *container, const xmlChar *type)
Definition: container.c:1277
Definition: container.h:76
opcContainerOpenMode
Definition: container.h:66
int opcFileWriteCallback(void *iocontext, const char *buffer, int len)
Definition: file.h:91
opcContainer * opcContainerOpenMem(const opc_uint8_t *data, opc_uint32_t data_len, opcContainerOpenMode mode, void *userContext)
Definition: container.c:1061