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