home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / g / gs241j11.zip / INCLUDE.SNF / OS.H < prev    next >
C/C++ Source or Header  |  1992-04-07  |  4KB  |  130 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.39 89/12/06 16:41:26 rws 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. #if defined(stellar)
  42. #define MAX_REQUEST_SIZE 65535
  43. #else
  44. #define MAX_REQUEST_SIZE 16384
  45. #endif
  46.  
  47. typedef pointer    FID;
  48. typedef struct _FontPathRec *FontPathPtr;
  49. typedef struct _NewClientRec *NewClientPtr;
  50.  
  51. #ifndef NO_ALLOCA
  52. /*
  53.  * os-dependent definition of local allocation and deallocation
  54.  * If you want something other than Xalloc/Xfree for ALLOCATE/DEALLOCATE
  55.  * LOCAL then you add that in here.
  56.  */
  57. #if defined(__HIGHC__)
  58.  
  59. extern char *alloca();
  60.  
  61. #if HCVERSION < 21003
  62. #define ALLOCATE_LOCAL(size)    alloca((int)(size))
  63. pragma on(alloca);
  64. #else /* HCVERSION >= 21003 */
  65. #define    ALLOCATE_LOCAL(size)    _Alloca((int)(size))
  66. #endif /* HCVERSION < 21003 */
  67.  
  68. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  69.  
  70. #endif /* defined(__HIGHC__) */
  71.  
  72.  
  73. #ifdef __GNUC__
  74. #define alloca __builtin_alloca
  75. #define ALLOCATE_LOCAL(size) alloca((int)(size))
  76. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  77. #else /* ! __GNUC__ */
  78. /*
  79.  * warning: mips alloca is unsuitable in the server, do not use.
  80.  */
  81. #if defined(vax) || defined(sun) || defined(apollo) || defined(stellar)
  82. /*
  83.  * Some System V boxes extract alloca.o from /lib/libPW.a; if you
  84.  * decide that you don't want to use alloca, you might want to fix 
  85.  * ../os/4.2bsd/Imakefile
  86.  */
  87. char *alloca();
  88. #define ALLOCATE_LOCAL(size) alloca((int)(size))
  89. #define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  90. #endif /* who does alloca */
  91. #endif /* __GNUC__ */
  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. int        ReadRequestFromClient();
  106. char        *strcat();
  107. char        *strncat();
  108. char        *strcpy();
  109. char        *strncpy();
  110. Bool        CloseDownConnection();
  111. FontPathPtr    GetFontPath();
  112. FontPathPtr    ExpandFontNamePattern();
  113. FID        FiOpenForRead();
  114. void        CreateWellKnownSockets();
  115. int        SetDefaultFontPath();
  116. void        FreeFontRecord();
  117. int        SetFontPath();
  118. void        ErrorF();
  119. void        Error();
  120. void        FatalError();
  121. void        ProcessCommandLine();
  122. void        Xfree();
  123. void        FlushAllOutput();
  124. void        FlushIfCriticalOutputPending();
  125. unsigned long    *Xalloc();
  126. unsigned long    *Xrealloc();
  127. long        GetTimeInMillis();
  128.  
  129. #endif /* OS_H */
  130.