|
1 /** |
|
2 * XML Security Library (http://www.aleksey.com/xmlsec). |
|
3 * |
|
4 * General functions and forward declarations. |
|
5 * |
|
6 * This is free software; see Copyright file in the source |
|
7 * distribution for preciese wording. |
|
8 * |
|
9 * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com> |
|
10 * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. |
|
11 */ |
|
12 #ifndef __XMLSEC_H__ |
|
13 #define __XMLSEC_H__ |
|
14 |
|
15 #ifdef __cplusplus |
|
16 extern "C" { |
|
17 #endif /* __cplusplus */ |
|
18 |
|
19 #include <libxml2_tree.h> |
|
20 #include "xmlsec_config.h" |
|
21 #include "xmlsec_version.h" |
|
22 #include "xmlsec_exports.h" |
|
23 #include "xmlsec_strings.h" |
|
24 |
|
25 //added for symbian port |
|
26 #include <libxml2_xmlmemory.h> |
|
27 |
|
28 /*********************************************************************** |
|
29 * |
|
30 * Basic types to make ports to exotic platforms easier |
|
31 * |
|
32 ***********************************************************************/ |
|
33 /** |
|
34 * xmlSecPtr: |
|
35 * |
|
36 * Void pointer. |
|
37 */ |
|
38 typedef void* xmlSecPtr; |
|
39 |
|
40 #ifdef XMLSEC_NO_SIZE_T |
|
41 #define xmlSecSize unsigned int |
|
42 #else /* XMLSEC_NO_SIZE_T */ |
|
43 #define xmlSecSize size_t |
|
44 #endif /* XMLSEC_NO_SIZE_T */ |
|
45 |
|
46 /** |
|
47 * xmlSecByte: |
|
48 * |
|
49 * One byte. Should be typedef instead of define |
|
50 * but it will break ABI |
|
51 */ |
|
52 #define xmlSecByte unsigned char |
|
53 |
|
54 /*********************************************************************** |
|
55 * |
|
56 * Forward declarations |
|
57 * |
|
58 ***********************************************************************/ |
|
59 typedef struct _xmlSecKeyData xmlSecKeyData, *xmlSecKeyDataPtr; |
|
60 typedef struct _xmlSecKeyDataStore xmlSecKeyDataStore, *xmlSecKeyDataStorePtr; |
|
61 typedef struct _xmlSecKeyInfoCtx xmlSecKeyInfoCtx, *xmlSecKeyInfoCtxPtr; |
|
62 typedef struct _xmlSecKey xmlSecKey, *xmlSecKeyPtr; |
|
63 typedef struct _xmlSecKeyStore xmlSecKeyStore, *xmlSecKeyStorePtr; |
|
64 typedef struct _xmlSecKeysMngr xmlSecKeysMngr, *xmlSecKeysMngrPtr; |
|
65 typedef struct _xmlSecTransform xmlSecTransform, *xmlSecTransformPtr; |
|
66 typedef struct _xmlSecTransformCtx xmlSecTransformCtx, *xmlSecTransformCtxPtr; |
|
67 |
|
68 #ifndef XMLSEC_NO_XMLDSIG |
|
69 typedef struct _xmlSecDSigCtx xmlSecDSigCtx, *xmlSecDSigCtxPtr; |
|
70 #endif /* XMLSEC_NO_XMLDSIG */ |
|
71 |
|
72 #ifndef XMLSEC_NO_XMLENC |
|
73 typedef struct _xmlSecEncCtx xmlSecEncCtx, *xmlSecEncCtxPtr; |
|
74 #endif /* XMLSEC_NO_XMLENC */ |
|
75 |
|
76 #ifndef XMLSEC_NO_XKMS |
|
77 typedef struct _xmlSecXkmsServerCtx xmlSecXkmsServerCtx, *xmlSecXkmsServerCtxPtr; |
|
78 #endif /* XMLSEC_NO_XKMS */ |
|
79 |
|
80 XMLSEC_EXPORT int xmlSecInit (void); |
|
81 XMLSEC_EXPORT int xmlSecShutdown (void); |
|
82 |
|
83 |
|
84 |
|
85 /*********************************************************************** |
|
86 * |
|
87 * Version checking |
|
88 * |
|
89 ***********************************************************************/ |
|
90 /** |
|
91 * xmlSecCheckVersionExact: |
|
92 * |
|
93 * Macro. Returns 1 if the loaded xmlsec library version exactly matches |
|
94 * the one used to compile the caller, 0 if it does not or a negative |
|
95 * value if an error occurs. |
|
96 */ |
|
97 #define xmlSecCheckVersionExact() \ |
|
98 xmlSecCheckVersionExt(XMLSEC_VERSION_MAJOR, XMLSEC_VERSION_MINOR, XMLSEC_VERSION_SUBMINOR, xmlSecCheckVersionExact) |
|
99 |
|
100 /** |
|
101 * xmlSecCheckVersion: |
|
102 * |
|
103 * Macro. Returns 1 if the loaded xmlsec library version ABI compatible with |
|
104 * the one used to compile the caller, 0 if it does not or a negative |
|
105 * value if an error occurs. |
|
106 */ |
|
107 #define xmlSecCheckVersion() \ |
|
108 xmlSecCheckVersionExt(XMLSEC_VERSION_MAJOR, XMLSEC_VERSION_MINOR, XMLSEC_VERSION_SUBMINOR, xmlSecCheckVersionABICompatible) |
|
109 |
|
110 /** |
|
111 * xmlSecCheckVersionMode: |
|
112 * @xmlSecCheckVersionExact: the version should match exactly. |
|
113 * @xmlSecCheckVersionABICompatible: the version should be ABI compatible. |
|
114 * |
|
115 * The xmlsec library version mode. |
|
116 */ |
|
117 typedef enum { |
|
118 xmlSecCheckVersionExact = 0, |
|
119 xmlSecCheckVersionABICompatible |
|
120 } xmlSecCheckVersionMode; |
|
121 |
|
122 XMLSEC_EXPORT int xmlSecCheckVersionExt (int major, |
|
123 int minor, |
|
124 int subminor, |
|
125 xmlSecCheckVersionMode mode); |
|
126 |
|
127 /** |
|
128 * ATTRIBUTE_UNUSED: |
|
129 * |
|
130 * Macro used to signal to GCC unused function parameters |
|
131 */ |
|
132 #ifdef __GNUC__ |
|
133 #ifdef HAVE_ANSIDECL_H |
|
134 #include <ansidecl.h> |
|
135 #endif |
|
136 #ifndef ATTRIBUTE_UNUSED |
|
137 #define ATTRIBUTE_UNUSED |
|
138 #endif |
|
139 #else |
|
140 #define ATTRIBUTE_UNUSED |
|
141 #endif |
|
142 |
|
143 #ifdef __cplusplus |
|
144 } |
|
145 #endif /* __cplusplus */ |
|
146 |
|
147 #endif /* __XMLSEC_H__ */ |
|
148 |
|
149 |