Use shibboleth-sp as package name for compatibility.
[shibboleth/cpp-sp.git] / shibsp / base.h
1 /**
2  * Licensed to the University Corporation for Advanced Internet
3  * Development, Inc. (UCAID) under one or more contributor license
4  * agreements. See the NOTICE file distributed with this work for
5  * additional information regarding copyright ownership.
6  *
7  * UCAID licenses this file to you under the Apache License,
8  * Version 2.0 (the "License"); you may not use this file except
9  * in compliance with the License. You may obtain a copy of the
10  * License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17  * either express or implied. See the License for the specific
18  * language governing permissions and limitations under the License.
19  */
20
21 /**
22  * @file shibsp/base.h
23  *
24  * Base header file definitions
25  * Must be included prior to including any other header
26  */
27
28 #ifndef __shibsp_base_h__
29 #define __shibsp_base_h__
30
31 #ifdef SHIBSP_LITE
32 # define XMLTOOLING_LITE
33 # include <xmltooling/base.h>
34 #else
35 # include <saml/base.h>
36 #endif
37
38 #if defined (_MSC_VER) || defined(__BORLANDC__)
39   #include <shibsp/config_pub_win32.h>
40 #else
41   #include <shibsp/config_pub.h>
42 #endif
43
44 // Windows and GCC4 Symbol Visibility Macros
45 #ifdef WIN32
46   #define SHIBSP_IMPORT __declspec(dllimport)
47   #define SHIBSP_EXPORT __declspec(dllexport)
48   #define SHIBSP_DLLLOCAL
49   #define SHIBSP_DLLPUBLIC
50 #else
51   #define SHIBSP_IMPORT
52   #ifdef GCC_HASCLASSVISIBILITY
53     #define SHIBSP_EXPORT __attribute__ ((visibility("default")))
54     #define SHIBSP_DLLLOCAL __attribute__ ((visibility("hidden")))
55     #define SHIBSP_DLLPUBLIC __attribute__ ((visibility("default")))
56   #else
57     #define SHIBSP_EXPORT
58     #define SHIBSP_DLLLOCAL
59     #define SHIBSP_DLLPUBLIC
60   #endif
61 #endif
62
63 // Define SHIBSP_API for DLL builds
64 #ifdef SHIBSP_EXPORTS
65   #define SHIBSP_API SHIBSP_EXPORT
66 #else
67   #define SHIBSP_API SHIBSP_IMPORT
68 #endif
69
70 // Throwable classes must always be visible on GCC in all binaries
71 #ifdef WIN32
72   #define SHIBSP_EXCEPTIONAPI(api) api
73 #elif defined(GCC_HASCLASSVISIBILITY)
74   #define SHIBSP_EXCEPTIONAPI(api) SHIBSP_EXPORT
75 #else
76   #define SHIBSP_EXCEPTIONAPI(api)
77 #endif
78
79 /**
80  * Controls default logging level of console tools and other situations
81  * where fully-configured logging isn't used.
82  */
83 #define SHIBSP_LOGGING  "console.logger"
84
85 /** Default name of SP in-process logging config file. */
86 #define SHIBSP_INPROC_LOGGING "native.logger"
87
88 /** Default name of SP out-of-process logging config file. */
89 #define SHIBSP_OUTOFPROC_LOGGING "shibd.logger"
90
91 /** Logging category for Service Provider functions. */
92 #define SHIBSP_LOGCAT "Shibboleth"
93
94 /** Logging category for Service Provider auditing. */
95 #define SHIBSP_TX_LOGCAT "Shibboleth-TRANSACTION"
96
97 /** Default name of configuration file. */
98 # define SHIBSP_CONFIG  "shibboleth2.xml"
99
100 #ifdef WIN32
101
102 /** Default catalog path on Windows. */
103 # define SHIBSP_SCHEMAS "%PROGRAMDATA%/Shibboleth/SP/xml/xmltooling/catalog.xml;%PROGRAMDATA%/Shibboleth/SP/xml/opensaml/saml20-catalog.xml;%PROGRAMDATA%/Shibboleth/SP/xml/opensaml/saml11-catalog.xml;%PROGRAMDATA%/Shibboleth/SP/xml/shibboleth/catalog.xml"
104
105 /** Default prefix for installation (used to resolve relative paths). */
106 #define SHIBSP_PREFIX   "c:/opt/shibboleth-sp"
107
108 #ifdef _WIN64
109
110 /** Library directory for installation (used to resolve relative paths). */
111 #define SHIBSP_LIBDIR   "lib64"
112
113 #else
114
115 /** Library directory for installation (used to resolve relative paths). */
116 #define SHIBSP_LIBDIR   "lib"
117
118 #endif
119
120 /** Log directory for installation (used to resolve relative paths). */
121 #define SHIBSP_LOGDIR   "var/log"
122
123 /** Configuration directory for installation (used to resolve relative paths). */
124 #define SHIBSP_CFGDIR   "etc"
125
126 /** Runtime state directory for installation (used to resolve relative paths). */
127 #define SHIBSP_RUNDIR   "var/run"
128
129 /** Cache directory for installation (used to resolve relative paths). */
130 #define SHIBSP_CACHEDIR "var/cache"
131
132 /** XML directory for installation (used to resolve relative paths). */
133 #define SHIBSP_XMLDIR   "share/xml"
134
135 #else
136 # include <shibsp/paths.h>
137 #endif
138
139 #endif /* __shibsp_base_h__ */