X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=menu%2Fmf_common.h;h=5b02eb4ce46fed9994f3b239c6586409da331412;hp=a98bee58d795b5b567f8928b0c7371ab3f36ef02;hb=55ccd2b959766810cf7db8d1c4462f338ce0afc8;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1 diff --git a/menu/mf_common.h b/menu/mf_common.h index a98bee58..5b02eb4c 100644 --- a/menu/mf_common.h +++ b/menu/mf_common.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,14 +27,18 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ +/* $Id: mf_common.h,v 0.21 2004/12/11 22:40:40 tom Exp $ */ + /* Common internal header for menu and form library */ -#if HAVE_CONFIG_H -# include -#endif +#ifndef MF_COMMON_H_incl +#define MF_COMMON_H_incl 1 + +#include +#include #include #include @@ -56,7 +60,7 @@ extern int errno; #include -#ifdef USE_RCS_IDS +#if USE_RCS_IDS #define MODULE_ID(id) static const char Ident[] = id; #else #define MODULE_ID(id) /*nothing*/ @@ -67,16 +71,21 @@ extern int errno; #define MAX_REGULAR_CHARACTER (0xff) #define SET_ERROR(code) (errno=(code)) -#define GET_ERROR() (errno) -#define RETURN(code) return( SET_ERROR(code) ) +#define GET_ERROR() (errno) + +#ifdef TRACE +#define RETURN(code) returnCode( SET_ERROR(code) ) +#else +#define RETURN(code) return( SET_ERROR(code) ) +#endif /* The few common values in the status fields for menus and forms */ -#define _POSTED (0x01) /* menu or form is posted */ -#define _IN_DRIVER (0x02) /* menu or form is processing hook routine */ +#define _POSTED (0x01U) /* menu or form is posted */ +#define _IN_DRIVER (0x02U) /* menu or form is processing hook routine */ /* Call object hook */ #define Call_Hook( object, handler ) \ - if ( (object) && ((object)->handler) )\ + if ( (object) != 0 && ((object)->handler) != (void *) 0 )\ {\ (object)->status |= _IN_DRIVER;\ (object)->handler(object);\ @@ -91,3 +100,5 @@ extern int errno; # define INLINE inline # endif #endif + +#endif /* MF_COMMON_H_incl */