2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: os.h /main/6 1996/05/28 15:33:04 ageorge $ */
24 /***********************************************************
25 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
26 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
30 Permission to use, copy, modify, and distribute this software and its
31 documentation for any purpose and without fee is hereby granted,
32 provided that the above copyright notice appear in all copies and that
33 both that copyright notice and this permission notice appear in
34 supporting documentation, and that the names of Digital or MIT not be
35 used in advertising or publicity pertaining to distribution of the
36 software without specific, written prior permission.
38 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
39 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
40 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
41 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
42 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
43 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
46 (c) Copyright 1995 FUJITSU LIMITED
47 This is source code modified by FUJITSU LIMITED under the Joint
48 Development Agreement for the CDEnext PST.
49 This is unpublished proprietary source code of FUJITSU LIMITED
51 ******************************************************************/
58 #ifdef INCLUDE_ALLOCA_H
62 #define NullFID ((FID) 0)
64 #define SCREEN_SAVER_ON 0
65 #define SCREEN_SAVER_OFF 1
66 #define SCREEN_SAVER_FORCER 2
69 #define MAX_REQUEST_SIZE 65535
71 #define MAX_REQUEST_SIZE 16384
75 typedef struct _FontPathRec *FontPathPtr;
76 typedef struct _NewClientRec *NewClientPtr;
80 * os-dependent definition of local allocation and deallocation
81 * If you want something other than Xalloc/Xfree for ALLOCATE/DEALLOCATE
82 * LOCAL then you add that in here.
84 #if defined(__HIGHC__)
86 extern char *alloca();
89 #define ALLOCATE_LOCAL(size) alloca((int)(size))
91 #else /* HCVERSION >= 21003 */
92 #define ALLOCATE_LOCAL(size) _Alloca((int)(size))
93 #endif /* HCVERSION < 21003 */
95 #define DEALLOCATE_LOCAL(ptr) /* as nothing */
97 #endif /* defined(__HIGHC__) */
100 #if defined(__GNUC__)
101 #if !defined(__linux__)
105 #define alloca ___builtin_alloca
107 #define ALLOCATE_LOCAL(size) alloca((int)(size))
108 #define DEALLOCATE_LOCAL(ptr) /* as nothing */
109 #else /* ! __GNUC__ */
111 * warning: mips alloca is unsuitable in the server, do not use.
113 #if defined(vax) || defined(sun) || defined(apollo) || defined(stellar)
115 * Some System V boxes extract alloca.o from /lib/libPW.a; if you
116 * decide that you don't want to use alloca, you might want to fix
117 * ../os/4.2bsd/Imakefile
120 #define ALLOCATE_LOCAL(size) alloca((int)(size))
121 #define DEALLOCATE_LOCAL(ptr) /* as nothing */
122 #endif /* who does alloca */
123 #endif /* __GNUC__ */
125 #endif /* NO_ALLOCA */
127 #ifndef ALLOCATE_LOCAL
128 #define ALLOCATE_LOCAL(size) Xalloc((unsigned long)(size))
129 #define DEALLOCATE_LOCAL(ptr) Xfree((pointer)(ptr))
130 #endif /* ALLOCATE_LOCAL */
133 #define xalloc(size) Xalloc((unsigned long)(size))
134 #define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size))
135 #define xfree(ptr) Xfree((pointer)(ptr))
137 int ReadRequestFromClient();
150 Bool CloseDownConnection();
151 FontPathPtr GetFontPath();
152 FontPathPtr ExpandFontNamePattern();
154 void CreateWellKnownSockets();
155 int SetDefaultFontPath();
156 void FreeFontRecord();
161 void ProcessCommandLine();
163 void FlushAllOutput();
164 void FlushIfCriticalOutputPending();
165 unsigned long *Xalloc();
166 unsigned long *Xrealloc();
167 long GetTimeInMillis();