home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 0 / 0987 / sprite.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  2.1 KB  |  95 lines

  1. /*
  2.  * sprite.h --
  3.  *
  4.  * Common constants and type declarations for Sprite.
  5.  *
  6.  * Copyright 1985, 1988 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /sprite/src/lib/include/RCS/sprite.h,v 1.6 89/09/08 16:27:43 mgbaker Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _SPRITE
  19. #define _SPRITE
  20.  
  21. /*
  22.  * A boolean type is defined as an integer, not an enum. This allows a
  23.  * boolean argument to be an expression that isn't strictly 0 or 1 valued.
  24.  */
  25.  
  26. #ifndef TRUE
  27. #define TRUE    1
  28. #endif
  29. #ifndef FALSE
  30. #define FALSE    0
  31. #endif
  32.  
  33. #ifndef _ASM
  34. typedef int Boolean;
  35.  
  36. /*
  37.  * Functions that must return a status can return a ReturnStatus to
  38.  * indicate success or type of failure.
  39.  */
  40.  
  41. typedef int  ReturnStatus;
  42. #endif /* _ASM */
  43.  
  44. /*
  45.  * The following statuses overlap with the first 2 generic statuses 
  46.  * defined in status.h:
  47.  *
  48.  * SUCCESS            There was no error.
  49.  * FAILURE            There was a general error.
  50.  */
  51.  
  52. #define    SUCCESS            0x00000000
  53. #define    FAILURE            0x00000001
  54.  
  55.  
  56. /*
  57.  * A nil pointer must be something that will cause an exception if 
  58.  * referenced.  There are two nils: the kernels nil and the nil used
  59.  * by user processes.
  60.  */
  61.  
  62. #define NIL         0xFFFFFFFF
  63. #define USER_NIL     0
  64. #ifndef NULL
  65. #define NULL         0
  66. #endif
  67.  
  68. #ifndef _ASM
  69. /*
  70.  * An address is just a pointer in C.  It is defined as a character pointer
  71.  * so that address arithmetic will work properly, a byte at a time.
  72.  */
  73.  
  74. typedef char *Address;
  75.  
  76. /*
  77.  * ClientData is an uninterpreted word.  It is defined as an int so that
  78.  * kdbx will not interpret client data as a string.  Unlike an "Address",
  79.  * client data will generally not be used in arithmetic.
  80.  */
  81.  
  82. #ifndef _CLIENTDATA
  83. typedef int *ClientData;
  84. #define _CLIENTDATA
  85. #endif
  86.  
  87. #ifndef __STDC__
  88. #define volatile
  89. #define const
  90. #endif
  91. #endif /* _ASM */
  92.  
  93.  
  94. #endif /* _SPRITE */
  95.