XKBfileInt.h revision 4e411241
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"
334e411241Smrg#include <string.h>
348c9fbc29Smrg
358c9fbc29Smrg#ifdef DEBUG
368c9fbc29Smrg#define	_XkbLibError(c,l,d) \
378c9fbc29Smrg	{ fprintf(stderr,"xkbfile: %s in %s\n",_XkbErrMessages[c],(l)); \
388c9fbc29Smrg	 _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
398c9fbc29Smrg#else
408c9fbc29Smrg#define	_XkbLibError(c,l,d) \
418c9fbc29Smrg	{ _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
428c9fbc29Smrg#endif
438c9fbc29Smrg
448c9fbc29Smrg#ifndef XKB_IN_SERVER
458c9fbc29Smrg
468c9fbc29Smrg#define	_XkbAlloc(s)		malloc((s))
478c9fbc29Smrg#define	_XkbCalloc(n,s)		calloc((n),(s))
488c9fbc29Smrg#define	_XkbRealloc(o,s)	realloc((o),(s))
498c9fbc29Smrg#define	_XkbTypedAlloc(t)	((t *)malloc(sizeof(t)))
508c9fbc29Smrg#define	_XkbTypedCalloc(n,t)	((t *)calloc((n),sizeof(t)))
518c9fbc29Smrg#define	_XkbTypedRealloc(o,n,t) \
528c9fbc29Smrg	((o)?(t *)realloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
538c9fbc29Smrg#define	_XkbClearElems(a,f,l,t)	bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
548c9fbc29Smrg#define	_XkbFree(p)		free(p)
558c9fbc29Smrg
568c9fbc29Smrg#ifndef PATH_MAX
578c9fbc29Smrg#ifdef MAXPATHLEN
588c9fbc29Smrg#define PATH_MAX MAXPATHLEN
598c9fbc29Smrg#else
608c9fbc29Smrg#define PATH_MAX 1024
618c9fbc29Smrg#endif
628c9fbc29Smrg#endif
638c9fbc29Smrg
648c9fbc29Smrg#endif
658c9fbc29Smrg
668c9fbc29Smrg_XFUNCPROTOBEGIN
678c9fbc29Smrg
684e411241Smrgstatic inline
694e411241Smrgchar *_XkbDupString(const char *s)
704e411241Smrg{
714e411241Smrg    return s ? strdup(s) : NULL;
724e411241Smrg}
738c9fbc29Smrg
748c9fbc29Smrg#define _XkbStrCaseEqual(s1,s2)	(_XkbStrCaseCmp(s1,s2)==0)
758c9fbc29Smrg
768c9fbc29Smrg#ifdef NEED_STRCASECMP
778c9fbc29Smrgextern int _XkbStrCaseCmp(char *s1, char *s2);
788c9fbc29Smrg#else
798c9fbc29Smrg#define _XkbStrCaseCmp strcasecmp
808c9fbc29Smrg#endif
818c9fbc29Smrg
828c9fbc29Smrg_XFUNCPROTOEND
838c9fbc29Smrg
848c9fbc29Smrg#endif /* _XKBFILEINT_H_ */
85