home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / ncurses-1.9.9e-src.tgz / tar.out / fsf / ncurses / menu / mf_common.h < prev    next >
C/C++ Source or Header  |  1996-09-28  |  3KB  |  75 lines

  1.  
  2. /***************************************************************************
  3. *                            COPYRIGHT NOTICE                              *
  4. ****************************************************************************
  5. *                ncurses is copyright (C) 1992-1995                        *
  6. *                          Zeyd M. Ben-Halim                               *
  7. *                          zmbenhal@netcom.com                             *
  8. *                          Eric S. Raymond                                 *
  9. *                          esr@snark.thyrsus.com                           *
  10. *                                                                          *
  11. *        Permission is hereby granted to reproduce and distribute ncurses  *
  12. *        by any means and for any fee, whether alone or as part of a       *
  13. *        larger distribution, in source or in binary form, PROVIDED        *
  14. *        this notice is included with any such distribution, and is not    *
  15. *        removed from any of its header files. Mention of ncurses in any   *
  16. *        applications linked with it is highly appreciated.                *
  17. *                                                                          *
  18. *        ncurses comes AS IS with no warranty, implied or expressed.       *
  19. *                                                                          *
  20. ***************************************************************************/
  21.  
  22. /* Common internal header for menu and form library */
  23.  
  24. #if HAVE_CONFIG_H
  25. #  include <config.h>
  26. #endif
  27.  
  28. #include <stdlib.h>
  29. #include <assert.h>
  30. #include <string.h>
  31. #include <ctype.h>
  32.  
  33. #if !HAVE_EXTERN_ERRNO
  34. extern int errno;
  35. #endif
  36.  
  37. #if HAVE_EXTERN_ERRNO
  38. #include <errno.h>
  39. #endif
  40.  
  41. /* in case of debug version we ignore the suppression of assertions */
  42. #ifdef TRACE
  43. #  ifdef NDEBUG
  44. #    undef NDEBUG
  45. #  endif
  46. #endif
  47.  
  48. /* Maximum regular 8-bit character code */
  49. #define MAX_REGULAR_CHARACTER (0xff)
  50.  
  51. #define SET_ERROR(code) (errno=(code))
  52. #define RETURN(code) return( SET_ERROR(code) )
  53.  
  54. /* The few common values in the status fields for menus and forms */
  55. #define _POSTED         (0x01)  /* menu or form is posted                  */
  56. #define _IN_DRIVER      (0x02)  /* menu or form is processing hook routine */
  57.  
  58. /* Call object hook */
  59. #define Call_Hook( object, handler ) \
  60.    if ( (object) && ((object)->handler) )\
  61.    {\
  62.     (object)->status |= _IN_DRIVER;\
  63.     (object)->handler(object);\
  64.     (object)->status &= ~_IN_DRIVER;\
  65.    }
  66.  
  67. #define INLINE
  68.  
  69. #ifndef TRACE
  70. #  ifdef __GNUC__
  71. #    undef INLINE
  72. #    define INLINE __inline__
  73. #  endif
  74. #endif
  75.