Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:31

0001 /* 
0002  * Motif
0003  *
0004  * Copyright (c) 1987-2012, The Open Group. All rights reserved.
0005  *
0006  * These libraries and programs are free software; you can
0007  * redistribute them and/or modify them under the terms of the GNU
0008  * Lesser General Public License as published by the Free Software
0009  * Foundation; either version 2 of the License, or (at your option)
0010  * any later version.
0011  *
0012  * These libraries and programs are distributed in the hope that
0013  * they will be useful, but WITHOUT ANY WARRANTY; without even the
0014  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
0015  * PURPOSE. See the GNU Lesser General Public License for more
0016  * details.
0017  *
0018  * You should have received a copy of the GNU Lesser General Public
0019  * License along with these librararies and programs; if not, write
0020  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
0021  * Floor, Boston, MA 02110-1301 USA
0022 */ 
0023 #ifndef _XmosP_h
0024 #define _XmosP_h
0025 
0026 /* Some SVR4 systems don't have bzero. */
0027 #include <Xm/Xmfuncs.h>     /* for bzero et al */
0028 
0029 /*
0030  * Fix for 8975 - using LOGNAME instead of USER on SYSV and SVR4 
0031 */
0032 
0033 #ifndef USER_VAR
0034 #if defined(SYSV) || defined(SVR4)
0035 #define USER_VAR "LOGNAME"
0036 #else
0037 #define USER_VAR "USER"
0038 #endif
0039 #endif
0040 
0041 /*
0042  * Fix for 5222 - if NO_MEMMOVE is defined, some systems will still
0043  *                require stdlib.h.
0044  */
0045 #ifdef NO_MEMMOVE
0046 #ifdef bcopy
0047 #undef bcopy
0048 #endif
0049 #ifdef memmove
0050 #undef memmove
0051 #endif
0052 #define memmove( p1, p2, p3 )   bcopy( p2, p1, p3 )
0053 #endif
0054 
0055 #ifndef X_NOT_STDC_ENV
0056 #include <stdlib.h> /* Needed for MB_CUR_MAX, mbtowc, mbstowcs and mblen */
0057 #endif
0058 
0059 /* On Sun systems, mblen is broken. It doesn't return 0 when the
0060    string is empty. Here's a patch. NOTE: On Sun systems, mblen
0061    is a macro wrapper around mbtowc. Hence the implementation below. */
0062 #if defined(sun)
0063 #undef  mblen
0064 #define mblen(ptr, size) \
0065   ((ptr && *(ptr) == '\0') ? 0 : mbtowc((wchar_t *)0, (ptr), (size)))
0066 #endif
0067 
0068 #include <limits.h>     /* for MB_LEN_MAX et al */
0069 
0070 #ifndef INT_MAX
0071 #define INT_MAX 2147483647
0072 #endif
0073 #ifndef LONG_MAX
0074 #define LONG_MAX 2147483647
0075 #endif
0076 #ifdef BOGUS_MB_MAX  /* some systems don't properly set MB_[CUR|LEN]_MAX */
0077 #undef MB_LEN_MAX
0078 #define MB_LEN_MAX 1 /* temp fix for ultrix */
0079 #undef MB_CUR_MAX
0080 #define MB_CUR_MAX 1 /* temp fix for ultrix */
0081 #endif /* BOGUS_MB_MAX */
0082 
0083 /**********************************************************************/
0084 /* here we duplicate Xtos.h, since we can't include this private file */
0085 
0086 #if defined(INCLUDE_ALLOCA_H) || defined(HAVE_ALLOCA_H)
0087 #include <alloca.h>
0088 #endif
0089 
0090 #ifdef CRAY
0091 #define WORD64
0092 #endif
0093 
0094 /* Don't Use Alloca On Solaris */
0095 #if defined(sun)
0096 #define NO_ALLOCA
0097 #endif
0098 
0099 /* stolen from server/include/os.h */
0100 #ifndef NO_ALLOCA
0101 /*
0102  * os-dependent definition of local allocation and deallocation
0103  * If you want something other than XtMalloc/XtFree for ALLOCATE/DEALLOCATE
0104  * LOCAL then you add that in here.
0105  */
0106 #if defined(__HIGHC__)
0107 
0108 #if HCVERSION < 21003
0109 #define ALLOCATE_LOCAL(size)    alloca(size)
0110 pragma on(alloca);
0111 #else /* HCVERSION >= 21003 */
0112 #define ALLOCATE_LOCAL(size)    _Alloca(size)
0113 #endif /* HCVERSION < 21003 */
0114 
0115 #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
0116 
0117 #endif /* defined(__HIGHC__) */
0118 
0119 
0120 #ifdef __GNUC__
0121 
0122 #ifndef alloca /* gnu itself might have done that already */
0123 #define alloca __builtin_alloca
0124 #endif
0125 
0126 #define ALLOCATE_LOCAL(size) alloca(size)
0127 #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
0128 #else /* ! __GNUC__ */
0129 /*
0130  * warning: mips alloca is unsuitable, do not use.
0131  */
0132 #if defined(vax) || defined(sun) || defined(apollo) || defined(stellar)
0133 /*
0134  * Some System V boxes extract alloca.o from libPW.a; if you
0135  * decide that you don't want to use alloca, you might want to fix it here.
0136  */
0137 char *alloca();
0138 #define ALLOCATE_LOCAL(size) alloca(size)
0139 #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
0140 #endif /* who does alloca */
0141 #endif /* __GNUC__ */
0142 
0143 #endif /* NO_ALLOCA */
0144 
0145 #ifndef ALLOCATE_LOCAL
0146 #define ALLOCATE_LOCAL(size)    XtMalloc(size)
0147 #define DEALLOCATE_LOCAL(ptr)   XtFree(ptr)
0148 #endif /* ALLOCATE_LOCAL */
0149 
0150 /* End of Xtos.h */
0151 /*****************/
0152 
0153 #include <Xm/XmP.h>
0154 
0155 /* For padding structures in Mrm we need to know how big pointers are. */
0156 #if !defined(CRAY) && !defined(__alpha)
0157 #define MrmShortPtr
0158 #endif
0159 
0160 #ifdef __cplusplus
0161 extern "C" {
0162 #endif
0163 
0164 
0165 #define MATCH_CHAR 'P'  /* referenced in InitPath strings and in the files 
0166              that uses it (ImageCache.c and Mrmhier.c) */
0167 
0168 /* OS-dependent file info for VirtKeys */
0169 
0170 #define XMBINDDIR "XMBINDDIR"
0171 #ifndef XMBINDDIR_FALLBACK
0172 #define XMBINDDIR_FALLBACK "/usr/lib/Xm/bindings"
0173 #endif
0174 #define XMBINDFILE "xmbind.alias"
0175 #define MOTIFBIND ".motifbind"
0176 
0177 typedef enum {
0178   XmOS_METHOD_NULL,
0179   XmOS_METHOD_DEFAULTED,
0180   XmOS_METHOD_REPLACED
0181 } XmOSMethodStatus;
0182 
0183 typedef XmDirection (*XmCharDirectionProc)(XtPointer   /* char */,
0184                        XmTextType  /* type */,
0185                        XmStringTag /* locale */);
0186 
0187 typedef Status  (*XmInitialDirectionProc)(XtPointer      /* chars */,
0188                       XmTextType     /* type */,
0189                       XmStringTag    /* locale */,
0190                       unsigned int * /* num_bytes */,
0191                       XmDirection *  /* direction */);
0192 
0193 
0194 /********    Private Function Declarations    ********/
0195 
0196 extern XmOSMethodStatus XmOSGetMethod(Widget w,
0197                       String method_name,
0198                       XtPointer * method,
0199                       XtPointer * os_data);
0200 
0201 /********    End Private Function Declarations    ********/
0202 
0203 
0204 #ifdef __cplusplus
0205 }  /* Close scope of 'extern "C"' declaration which encloses file. */
0206 #endif
0207 
0208 
0209 #endif /* _XmosP_h */
0210 /* DON'T ADD ANYTHING AFTER THIS #endif */