home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / sun / sunUtils.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-09-10  |  1.9 KB  |  58 lines

  1. /************************************************************
  2. Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
  3.  
  4.                     All Rights Reserved
  5.  
  6. Permission  to  use,  copy,  modify,  and  distribute   this
  7. software  and  its documentation for any purpose and without
  8. fee is hereby granted, provided that the above copyright no-
  9. tice  appear  in all copies and that both that copyright no-
  10. tice and this permission notice appear in  supporting  docu-
  11. mentation,  and  that the names of Sun or MIT not be used in
  12. advertising or publicity pertaining to distribution  of  the
  13. software  without specific prior written permission. Sun and
  14. M.I.T. make no representations about the suitability of this
  15. software for any purpose. It is provided "as is" without any
  16. express or implied warranty.
  17.  
  18. SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO  THIS  SOFTWARE,
  19. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
  20. NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE  LI-
  21. ABLE  FOR  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  22. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,  DATA  OR
  23. PROFITS,  WHETHER  IN  AN  ACTION OF CONTRACT, NEGLIGENCE OR
  24. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
  25. THE USE OR PERFORMANCE OF THIS SOFTWARE.
  26.  
  27. ********************************************************/
  28.  
  29. #ifndef    lint
  30. static char sccsid[] = "%W %G Copyright 1987 Sun Micro";
  31. #endif
  32.  
  33. #include "sun.h"
  34.  
  35. /*
  36.  * Generates & caches a static value that determines whether we are running 
  37.  * in coexistence with the sunwindows, e.g. under overview.
  38.  */
  39.  
  40. Bool
  41. sunUseSunWindows()
  42. {
  43. #ifdef SUN_WINDOWS
  44.     static Bool sunUseSunWindowsFirstTime = TRUE;
  45.     static Bool useSunWindows;
  46.  
  47.     if ( sunUseSunWindowsFirstTime ) {
  48.     sunUseSunWindowsFirstTime = FALSE;
  49.     useSunWindows = ( getenv("WINDOW_PARENT") != NULL );
  50.     }
  51.     return( useSunWindows );
  52. #else
  53.     return( FALSE );
  54. #endif SUN_WINDOWS
  55. }
  56.  
  57.  
  58.