Starting migration to new SP library
[shibboleth/cpp-sp.git] / shibsp / base.h
1 /*
2  *  Copyright 2001-2006 Internet2
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /**
18  * @file shibsp/base.h
19  * 
20  * Base header file definitions
21  * Must be included prior to including any other header
22  */
23
24 #ifndef __shibsp_base_h__
25 #define __shibsp_base_h__
26
27 #include <saml/base.h>
28
29 // Windows and GCC4 Symbol Visibility Macros
30 #ifdef WIN32
31   #define SHIBSP_IMPORT __declspec(dllimport)
32   #define SHIBSP_EXPORT __declspec(dllexport)
33   #define SHIBSP_DLLLOCAL
34   #define SHIBSP_DLLPUBLIC
35 #else
36   #define SHIBSP_IMPORT
37   #ifdef GCC_HASCLASSVISIBILITY
38     #define SHIBSP_EXPORT __attribute__ ((visibility("default")))
39     #define SHIBSP_DLLLOCAL __attribute__ ((visibility("hidden")))
40     #define SHIBSP_DLLPUBLIC __attribute__ ((visibility("default")))
41   #else
42     #define SHIBSP_EXPORT
43     #define SHIBSP_DLLLOCAL
44     #define SHIBSP_DLLPUBLIC
45   #endif
46 #endif
47
48 // Define SHIBSP_API for DLL builds
49 #ifdef SHIBSP_EXPORTS
50   #define SHIBSP_API SHIBSP_EXPORT
51 #else
52   #define SHIBSP_API SHIBSP_IMPORT
53 #endif
54
55 // Throwable classes must always be visible on GCC in all binaries
56 #ifdef WIN32
57   #define SHIBSP_EXCEPTIONAPI(api) api
58 #elif defined(GCC_HASCLASSVISIBILITY)
59   #define SHIBSP_EXCEPTIONAPI(api) SHIBSP_EXPORT
60 #else
61   #define SHIBSP_EXCEPTIONAPI(api)
62 #endif
63
64 #ifdef WIN32
65
66 /**
67  * Default catalog path on Windows.
68  */
69 # define SHIBSP_SCHEMAS "/opt/shibboleth-sp/share/xml/xmltooling/catalog.xml;/opt/shibboleth-sp/share/xml/opensaml/catalog.xml;/opt/shibboleth-sp/share/xml/shibboleth/catalog.xml"
70
71 /**
72  * Default path to configuration file on Windows.
73  */
74 # define SHIBSP_CONFIG "/opt/shibboleth-sp/etc/shibboleth/shibboleth.xml"
75
76 #else
77 # include <shibsp/paths.h>
78 #endif
79
80 /**
81  * Logging category for Service Provider functions.
82  */
83 #define SHIBSP_LOGCAT "Shibboleth.SP"
84
85 /**
86  * Logging category for Service Provider auditing.
87  */
88 #define SHIBSP_TX_LOGCAT "Shibboleth-TRANSACTION"
89
90 /**
91  * Controls default logging level of console tools and other situations
92  * where fully-configured logging isn't used.
93  */
94 #define SHIBSP_LOGGING "WARN"
95
96 #endif /* __shibsp_base_h__ */