XKBfileInt.h revision 4e411241
1#ifndef _XKBFILEINT_H_
2#define	_XKBFILEINT_H_ 1
3
4/* $Xorg: XKBfileInt.h,v 1.3 2000/08/17 19:46:43 cpqbld Exp $ */
5/************************************************************
6 Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
7
8 Permission to use, copy, modify, and distribute this
9 software and its documentation for any purpose and without
10 fee is hereby granted, provided that the above copyright
11 notice appear in all copies and that both that copyright
12 notice and this permission notice appear in supporting
13 documentation, and that the name of Silicon Graphics not be
14 used in advertising or publicity pertaining to distribution
15 of the software without specific prior written permission.
16 Silicon Graphics makes no representation about the suitability
17 of this software for any purpose. It is provided "as is"
18 without any express or implied warranty.
19
20 SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
21 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22 AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
23 GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
24 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
25 DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
26 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
27 THE USE OR PERFORMANCE OF THIS SOFTWARE.
28
29 ********************************************************/
30/* $XFree86$ */
31
32#include "XKBfile.h"
33#include <string.h>
34
35#ifdef DEBUG
36#define	_XkbLibError(c,l,d) \
37	{ fprintf(stderr,"xkbfile: %s in %s\n",_XkbErrMessages[c],(l)); \
38	 _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
39#else
40#define	_XkbLibError(c,l,d) \
41	{ _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
42#endif
43
44#ifndef XKB_IN_SERVER
45
46#define	_XkbAlloc(s)		malloc((s))
47#define	_XkbCalloc(n,s)		calloc((n),(s))
48#define	_XkbRealloc(o,s)	realloc((o),(s))
49#define	_XkbTypedAlloc(t)	((t *)malloc(sizeof(t)))
50#define	_XkbTypedCalloc(n,t)	((t *)calloc((n),sizeof(t)))
51#define	_XkbTypedRealloc(o,n,t) \
52	((o)?(t *)realloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
53#define	_XkbClearElems(a,f,l,t)	bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
54#define	_XkbFree(p)		free(p)
55
56#ifndef PATH_MAX
57#ifdef MAXPATHLEN
58#define PATH_MAX MAXPATHLEN
59#else
60#define PATH_MAX 1024
61#endif
62#endif
63
64#endif
65
66_XFUNCPROTOBEGIN
67
68static inline
69char *_XkbDupString(const char *s)
70{
71    return s ? strdup(s) : NULL;
72}
73
74#define _XkbStrCaseEqual(s1,s2)	(_XkbStrCaseCmp(s1,s2)==0)
75
76#ifdef NEED_STRCASECMP
77extern int _XkbStrCaseCmp(char *s1, char *s2);
78#else
79#define _XkbStrCaseCmp strcasecmp
80#endif
81
82_XFUNCPROTOEND
83
84#endif /* _XKBFILEINT_H_ */
85