First cut at signing support.
[shibboleth/cpp-xmltooling.git] / xmltooling / internal.h
1 /*\r
2  *  Copyright 2001-2005 Internet2\r
3  * \r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 /*\r
18  *  internal.h - internally visible classes\r
19  */\r
20 \r
21 #ifndef __xmltooling_internal_h__\r
22 #define __xmltooling_internal_h__\r
23 \r
24 #ifdef WIN32\r
25 # define _CRT_SECURE_NO_DEPRECATE 1\r
26 # define _CRT_NONSTDC_NO_DEPRECATE 1\r
27 #endif\r
28 \r
29 // eventually we might be able to support autoconf via cygwin...\r
30 #if defined (_MSC_VER) || defined(__BORLANDC__)\r
31 # include "config_win32.h"\r
32 #else\r
33 # include "config.h"\r
34 #endif\r
35 \r
36 #include "base.h"\r
37 #include "XMLToolingConfig.h"\r
38 #include "util/ParserPool.h"\r
39 \r
40 #include <vector>\r
41 #ifndef XMLTOOLING_NO_XMLSEC\r
42     #include <xsec/framework/XSECProvider.hpp>\r
43 #endif\r
44 \r
45 #define XMLTOOLING_LOGCAT "XMLTooling"\r
46 \r
47 namespace xmltooling {\r
48     \r
49     class XMLToolingInternalConfig : public xmltooling::XMLToolingConfig\r
50     {\r
51     public:\r
52         XMLToolingInternalConfig() : m_lock(NULL), m_parserPool(NULL), m_xsecProvider(NULL) {}\r
53 \r
54         static XMLToolingInternalConfig& getInternalConfig();\r
55 \r
56         // global per-process setup and shutdown of runtime\r
57         bool init();\r
58         void term();\r
59 \r
60         // global mutex available to library applications\r
61         xmltooling::ILockable& lock();\r
62         void unlock();\r
63 \r
64         // configuration\r
65         bool load_library(const char* path, void* context=NULL);\r
66         bool log_config(const char* config=NULL);\r
67 \r
68         // internal parser pool\r
69         xmltooling::ParserPool* m_parserPool;\r
70         XSECProvider* m_xsecProvider;\r
71 \r
72     private:\r
73         std::vector<void*> m_libhandles;\r
74         void* m_lock;\r
75         //PlugManager m_plugMgr;\r
76     };\r
77 };\r
78 \r
79 #endif /* __xmltooling_internal_h__ */\r