1 | /***********************************************************
|
---|
2 |
|
---|
3 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
4 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
5 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
6 | AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
7 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
8 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
9 |
|
---|
10 | ******************************************************************/
|
---|
11 |
|
---|
12 | #ifndef DIX_REGISTRY_H
|
---|
13 | #define DIX_REGISTRY_H
|
---|
14 |
|
---|
15 | /*
|
---|
16 | * Result returned from any unsuccessful lookup
|
---|
17 | */
|
---|
18 | #define XREGISTRY_UNKNOWN "<unknown>"
|
---|
19 |
|
---|
20 | #ifdef XREGISTRY
|
---|
21 |
|
---|
22 | #include "resource.h"
|
---|
23 | #include "extnsionst.h"
|
---|
24 |
|
---|
25 | /* Internal string registry - for auditing, debugging, security, etc. */
|
---|
26 |
|
---|
27 | /*
|
---|
28 | * Registration functions. The name string is not copied, so it must
|
---|
29 | * not be a stack variable.
|
---|
30 | */
|
---|
31 | extern _X_EXPORT void RegisterResourceName(RESTYPE type, const char *name);
|
---|
32 | extern _X_EXPORT void RegisterExtensionNames(ExtensionEntry *ext);
|
---|
33 |
|
---|
34 | /*
|
---|
35 | * Lookup functions. The returned string must not be modified or freed.
|
---|
36 | */
|
---|
37 | extern _X_EXPORT const char *LookupMajorName(int major);
|
---|
38 | extern _X_EXPORT const char *LookupRequestName(int major, int minor);
|
---|
39 | extern _X_EXPORT const char *LookupEventName(int event);
|
---|
40 | extern _X_EXPORT const char *LookupErrorName(int error);
|
---|
41 | extern _X_EXPORT const char *LookupResourceName(RESTYPE rtype);
|
---|
42 |
|
---|
43 | /*
|
---|
44 | * Setup and teardown
|
---|
45 | */
|
---|
46 | extern _X_EXPORT void dixResetRegistry(void);
|
---|
47 |
|
---|
48 | #else /* XREGISTRY */
|
---|
49 |
|
---|
50 | /* Define calls away when the registry is not being built. */
|
---|
51 |
|
---|
52 | #define RegisterResourceName(a, b) { ; }
|
---|
53 | #define RegisterExtensionNames(a) { ; }
|
---|
54 |
|
---|
55 | #define LookupMajorName(a) XREGISTRY_UNKNOWN
|
---|
56 | #define LookupRequestName(a, b) XREGISTRY_UNKNOWN
|
---|
57 | #define LookupEventName(a) XREGISTRY_UNKNOWN
|
---|
58 | #define LookupErrorName(a) XREGISTRY_UNKNOWN
|
---|
59 | #define LookupResourceName(a) XREGISTRY_UNKNOWN
|
---|
60 |
|
---|
61 | #define dixResetRegistry() { ; }
|
---|
62 |
|
---|
63 | #endif /* XREGISTRY */
|
---|
64 | #endif /* DIX_REGISTRY_H */
|
---|