/****************************************************************************1* Copyright (c) 1998,2000 Free Software Foundation, Inc. *2* *3* Permission is hereby granted, free of charge, to any person obtaining a *4* copy of this software and associated documentation files (the *5* "Software"), to deal in the Software without restriction, including *6* without limitation the rights to use, copy, modify, merge, publish, *7* distribute, distribute with modifications, sublicense, and/or sell *8* copies of the Software, and to permit persons to whom the Software is *9* furnished to do so, subject to the following conditions: *10* *11* The above copyright notice and this permission notice shall be included *12* in all copies or substantial portions of the Software. *13* *14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *15* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *16* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *17* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *18* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *19* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *20* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *21* *22* Except as contained in this notice, the name(s) of the above copyright *23* holders shall not be used in advertising or otherwise to promote the *24* sale, use or other dealings in this Software without prior written *25* authorization. *26****************************************************************************/2728/****************************************************************************29* Author: Juergen Pfeifer <[email protected]> 1995,1997 *30****************************************************************************/3132/* Common internal header for menu and form library */3334#if HAVE_CONFIG_H35# include <ncurses_cfg.h>36#endif3738#include <stdlib.h>39#include <sys/types.h>40#include <assert.h>41#include <string.h>42#include <ctype.h>43#include <errno.h>4445#if DECL_ERRNO46extern int errno;47#endif4849/* in case of debug version we ignore the suppression of assertions */50#ifdef TRACE51# ifdef NDEBUG52# undef NDEBUG53# endif54#endif5556#include <nc_alloc.h>5758#if USE_RCS_IDS59#define MODULE_ID(id) static const char Ident[] = id;60#else61#define MODULE_ID(id) /*nothing*/62#endif636465/* Maximum regular 8-bit character code */66#define MAX_REGULAR_CHARACTER (0xff)6768#define SET_ERROR(code) (errno=(code))69#define GET_ERROR() (errno)70#define RETURN(code) return( SET_ERROR(code) )7172/* The few common values in the status fields for menus and forms */73#define _POSTED (0x01) /* menu or form is posted */74#define _IN_DRIVER (0x02) /* menu or form is processing hook routine */7576/* Call object hook */77#define Call_Hook( object, handler ) \78if ( (object) && ((object)->handler) )\79{\80(object)->status |= _IN_DRIVER;\81(object)->handler(object);\82(object)->status &= ~_IN_DRIVER;\83}8485#define INLINE8687#ifndef TRACE88# if CC_HAS_INLINE_FUNCS89# undef INLINE90# define INLINE inline91# endif92#endif939495