home *** CD-ROM | disk | FTP | other *** search
/ PC Shareware 1999 March / PCShareware-3-99.iso / IMPLE / DJGPP.RAR / DJGPP2 / XLIB-SR0.ZIP / SRC / EXTENSIO / GLOBALS.C < prev    next >
C/C++ Source or Header  |  1991-01-24  |  2KB  |  66 lines

  1. /*
  2.  * $XConsortium: globals.c,v 1.1 89/10/03 17:25:16 jim Exp $
  3.  *
  4.  * Copyright 1989 Massachusetts Institute of Technology
  5.  *
  6.  *
  7.  *                                 Global data
  8.  *
  9.  * This file should contain only those objects which must be predefined.
  10.  */
  11. #include <X11/Xlib.h>
  12. #include <X11/extensions/Xext.h>
  13. #include <sys/param.h>            /* for definition of NULL */
  14.  
  15.  
  16. /*
  17.  * If possible, it is useful to have the global data default to a null value.
  18.  * Some shared library implementations are *much* happier if there isn't any
  19.  * global initialized data.
  20.  */
  21. #ifdef NULL_NOT_ZERO            /* then need to initialize */
  22. #define SetZero(t,var,z) t var = z
  23. #else 
  24. #define SetZero(t,var,z) t var
  25. #endif
  26.  
  27. #ifdef ATTSHAREDLIB            /* then need extra variables */
  28. /*
  29.  * If we need to define extra variables for each global
  30.  */
  31. #if defined(__STDC__) && !defined(UNIXCPP)  /* then ANSI C concatenation */
  32. #define ZEROINIT(t,var,val) SetZero(t,var,val); \
  33.   SetZero (long, _libX_##var##Flag, 0); \
  34.   SetZero (void *, _libX_##var##Ptr, NULL)
  35. #else /* else pcc concatenation */
  36. #define ZEROINIT(t,var,val) SetZero(t,var,val); \
  37.   SetZero (long, _libX_/**/var/**/Flag, 0); \
  38.   SetZero (void *, _libX_/**/var/**/Ptr, NULL)
  39. #endif /* concat ANSI C vs. pcc */
  40.  
  41. #else /* else not ATTSHAREDLIB */
  42. /*
  43.  * no extra crud
  44.  */
  45. #define ZEROINIT(t,var,val) SetZero (t, var, val)
  46.  
  47. #endif /* ATTSHAREDLIB */
  48.  
  49.  
  50. /*
  51.  * Error handlers; used to be in XlibInt.c
  52.  */
  53. typedef int (*funcptr)();
  54. ZEROINIT (funcptr, _XExtensionErrorFunction, NULL);
  55.  
  56. /*
  57.  * NOTE: any additional external definition NEED
  58.  * to be inserted BELOW this point!!!
  59.  */
  60.  
  61. /*
  62.  * NOTE: any additional external definition NEED
  63.  * to be inserted ABOVE this point!!!
  64.  */
  65.  
  66.