home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / include / os.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-18  |  3.7 KB  |  135 lines

  1. /***********************************************************
  2. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  3. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  4.  
  5.                         All Rights Reserved
  6.  
  7. Permission to use, copy, modify, and distribute this software and its 
  8. documentation for any purpose and without fee is hereby granted, 
  9. provided that the above copyright notice appear in all copies and that
  10. both that copyright notice and this permission notice appear in 
  11. supporting documentation, and that the names of Digital or MIT not be
  12. used in advertising or publicity pertaining to distribution of the
  13. software without specific, written prior permission.  
  14.  
  15. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  16. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  17. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  18. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  19. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  20. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  21. SOFTWARE.
  22.  
  23. ******************************************************************/
  24.  
  25. /* $XConsortium: os.h,v 1.44 91/07/18 23:01:12 keith Exp $ */
  26.  
  27. #ifndef OS_H
  28. #define OS_H
  29. #include "misc.h"
  30.  
  31. #ifdef INCLUDE_ALLOCA_H
  32. #include <alloca.h>
  33. #endif
  34.  
  35. #define NullFID ((FID) 0)
  36.  
  37. #define SCREEN_SAVER_ON   0
  38. #define SCREEN_SAVER_OFF  1
  39. #define SCREEN_SAVER_FORCER 2
  40.  
  41. #ifndef MAX_REQUEST_SIZE
  42. #define MAX_REQUEST_SIZE 65535
  43. #endif
  44.  
  45. typedef pointer    FID;
  46. typedef struct _FontPathRec *FontPathPtr;
  47. typedef struct _NewClientRec *NewClientPtr;
  48.  
  49. #ifndef NO_ALLOCA
  50. /*
  51.  * os-dependent definition of local allocation and deallocation
  52.  * If you want something other than Xalloc/Xfree for ALLOCATE/DEALLOCATE
  53.  * LOCAL then you add that in here.
  54.  */
  55. #ifdef __HIGHC__
  56.  
  57. extern char *alloca();
  58.  
  59. #if HCVERSION < 21003
  60. #define ALLOCATE_LOCAL(size)    alloca((int)(size))
  61. pragma on(alloca);
  62. #else /* HCVERSION >= 21003 */
  63. #define    ALLOCATE_LOCAL(size)    _Alloca((int)(size))
  64. #endif /* HCVERSION < 21003 */
  65.  
  66. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  67.  
  68. #endif /* defined(__HIGHC__) */
  69.  
  70.  
  71. #ifdef __GNUC__
  72. #define alloca __builtin_alloca
  73. #endif
  74.  
  75. /*
  76.  * warning: old mips alloca (pre 2.10) is unusable, new one is builtin
  77.  * Test is easy, the new one is named __builtin_alloca and comes
  78.  * from alloca.h which #defines alloca.
  79.  */
  80. #if defined(vax) || defined(sun) || defined(apollo) || defined(stellar) || defined(alloca)
  81. /*
  82.  * Some System V boxes extract alloca.o from /lib/libPW.a; if you
  83.  * decide that you don't want to use alloca, you might want to fix 
  84.  * ../os/4.2bsd/Imakefile
  85.  */
  86. #ifndef alloca
  87. char *alloca();
  88. #endif
  89. #define ALLOCATE_LOCAL(size) alloca((int)(size))
  90. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  91. #endif /* who does alloca */
  92.  
  93. #endif /* NO_ALLOCA */
  94.  
  95. #ifndef ALLOCATE_LOCAL
  96. #define ALLOCATE_LOCAL(size) Xalloc((unsigned long)(size))
  97. #define DEALLOCATE_LOCAL(ptr) Xfree((pointer)(ptr))
  98. #endif /* ALLOCATE_LOCAL */
  99.  
  100.  
  101. #define xalloc(size) Xalloc((unsigned long)(size))
  102. #define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size))
  103. #define xfree(ptr) Xfree((pointer)(ptr))
  104.  
  105. #ifndef X_NOT_STDC_ENV
  106. #include <string.h>
  107. #else
  108. #ifdef SYSV
  109. #include <string.h>
  110. #else
  111. #include <strings.h>
  112. #endif
  113. #endif
  114.  
  115. int        ReadRequestFromClient();
  116. Bool        CloseDownConnection();
  117. FontPathPtr    ExpandFontNamePattern();
  118. FID        FiOpenForRead();
  119. void        CreateWellKnownSockets();
  120. int        SetDefaultFontPath();
  121. void        FreeFontRecord();
  122. int        SetFontPath();
  123. void        ErrorF();
  124. void        Error();
  125. void        FatalError();
  126. void        ProcessCommandLine();
  127. void        Xfree();
  128. void        FlushAllOutput();
  129. void        FlushIfCriticalOutputPending();
  130. unsigned long    *Xalloc();
  131. unsigned long    *Xrealloc();
  132. long        GetTimeInMillis();
  133.  
  134. #endif /* OS_H */
  135.