XKBfileInt.h revision 8c9fbc29
18c9fbc29Smrg#ifndef _XKBFILEINT_H_
28c9fbc29Smrg#define	_XKBFILEINT_H_ 1
38c9fbc29Smrg
48c9fbc29Smrg/* $Xorg: XKBfileInt.h,v 1.3 2000/08/17 19:46:43 cpqbld Exp $ */
58c9fbc29Smrg/************************************************************
68c9fbc29Smrg Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
78c9fbc29Smrg
88c9fbc29Smrg Permission to use, copy, modify, and distribute this
98c9fbc29Smrg software and its documentation for any purpose and without
108c9fbc29Smrg fee is hereby granted, provided that the above copyright
118c9fbc29Smrg notice appear in all copies and that both that copyright
128c9fbc29Smrg notice and this permission notice appear in supporting
138c9fbc29Smrg documentation, and that the name of Silicon Graphics not be
148c9fbc29Smrg used in advertising or publicity pertaining to distribution
158c9fbc29Smrg of the software without specific prior written permission.
168c9fbc29Smrg Silicon Graphics makes no representation about the suitability
178c9fbc29Smrg of this software for any purpose. It is provided "as is"
188c9fbc29Smrg without any express or implied warranty.
198c9fbc29Smrg
208c9fbc29Smrg SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
218c9fbc29Smrg SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
228c9fbc29Smrg AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
238c9fbc29Smrg GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
248c9fbc29Smrg DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
258c9fbc29Smrg DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
268c9fbc29Smrg OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
278c9fbc29Smrg THE USE OR PERFORMANCE OF THIS SOFTWARE.
288c9fbc29Smrg
298c9fbc29Smrg ********************************************************/
308c9fbc29Smrg/* $XFree86$ */
318c9fbc29Smrg
328c9fbc29Smrg#include "XKBfile.h"
338c9fbc29Smrg
348c9fbc29Smrg#ifdef DEBUG
358c9fbc29Smrg#define	_XkbLibError(c,l,d) \
368c9fbc29Smrg	{ fprintf(stderr,"xkbfile: %s in %s\n",_XkbErrMessages[c],(l)); \
378c9fbc29Smrg	 _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
388c9fbc29Smrg#else
398c9fbc29Smrg#define	_XkbLibError(c,l,d) \
408c9fbc29Smrg	{ _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
418c9fbc29Smrg#endif
428c9fbc29Smrg
438c9fbc29Smrg#ifndef XKB_IN_SERVER
448c9fbc29Smrg
458c9fbc29Smrg#define	_XkbAlloc(s)		malloc((s))
468c9fbc29Smrg#define	_XkbCalloc(n,s)		calloc((n),(s))
478c9fbc29Smrg#define	_XkbRealloc(o,s)	realloc((o),(s))
488c9fbc29Smrg#define	_XkbTypedAlloc(t)	((t *)malloc(sizeof(t)))
498c9fbc29Smrg#define	_XkbTypedCalloc(n,t)	((t *)calloc((n),sizeof(t)))
508c9fbc29Smrg#define	_XkbTypedRealloc(o,n,t) \
518c9fbc29Smrg	((o)?(t *)realloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
528c9fbc29Smrg#define	_XkbClearElems(a,f,l,t)	bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
538c9fbc29Smrg#define	_XkbFree(p)		free(p)
548c9fbc29Smrg
558c9fbc29Smrg#ifndef PATH_MAX
568c9fbc29Smrg#ifdef MAXPATHLEN
578c9fbc29Smrg#define PATH_MAX MAXPATHLEN
588c9fbc29Smrg#else
598c9fbc29Smrg#define PATH_MAX 1024
608c9fbc29Smrg#endif
618c9fbc29Smrg#endif
628c9fbc29Smrg
638c9fbc29Smrg#endif
648c9fbc29Smrg
658c9fbc29Smrg_XFUNCPROTOBEGIN
668c9fbc29Smrg
678c9fbc29Smrgextern char *	_XkbDupString(
688c9fbc29Smrg	char *	/* old_str */
698c9fbc29Smrg);
708c9fbc29Smrg
718c9fbc29Smrg#define _XkbStrCaseEqual(s1,s2)	(_XkbStrCaseCmp(s1,s2)==0)
728c9fbc29Smrg
738c9fbc29Smrg#ifdef NEED_STRCASECMP
748c9fbc29Smrgextern int _XkbStrCaseCmp(char *s1, char *s2);
758c9fbc29Smrg#else
768c9fbc29Smrg#define _XkbStrCaseCmp strcasecmp
778c9fbc29Smrg#endif
788c9fbc29Smrg
798c9fbc29Smrg_XFUNCPROTOEND
808c9fbc29Smrg
818c9fbc29Smrg#endif /* _XKBFILEINT_H_ */
82